Formkl Full Grammar
This is the full grammar for the form markup language. It is written in EBNF logic.
- Words in code block like
formklare the language keywords/tokens. - Square brackets
[]indicates an optional element. - List-like bullet points or
|indicate alternative cases. - Parentheses
()indicate grouping. *indicates zero or more repetitions.
FormBlock
formkl [FormModel] [FormSubmissionFunction] [StringLiteral] [StringLiteral] { [SectionBlockList] }
FormModel
baseflat
FormSubmissionFunction
FormHttpMethod ( StringLiteral )
FormHttpMethod
getpostputpatchdelete
SectionBlockList
(SectionBlock)*
SectionBlock
[NumericLiteral | multiple] StringLiteral includes { FieldStatementList } [as StringLiteral]
FieldStatementList
FieldStatement
- [NumericLiteral] [
require] StringLiteral FieldExpression [asStringLiteral] - [
multiple] [require] StringLiteral FieldExpression [asStringLiteral]
FieldExpression
- FieldDefaultExpression
- FieldSelectionExpression
- FieldValidatedExpression
- FieldDatetimeExpression
- FieldExpression ValidationExpression
FieldDefaultExpression
textparagraphnumberswitch
FieldSelectionExpression
- [
select|checkbox|radio] StringLiteral [url](StringList) - [
select|checkbox|radio] StringLiteral(StringList)
FieldValidatedExpression
emailzipage
FieldDatetimeExpression
datetimerangedatetimedaterangedatetimetimerange
ValidationExpression
valid(LogicalORExpression)[regex(StringLiteral)]regex(StringLiteral)[valid(LogicalORExpression)]
LogicalORExpression
LogicalANDExpression
RelationalExpression
>NumericLiteral<NumericLiteral>=NumericLiteral<=NumericLiteral==Literal!=LiteralhasIncludableLiteral
IncludableLiteral
StringLiteral | NumericLiteral
Literal
StringList
NaNLiteral
NaN
BooleanLiteral
true | false
NullLiteral
null
UndefinedLiteral
undefined
StringLiteral
NumericLiteral
(Digit)*
Character
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | v | w | x | y | z
Digit
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9