Formkl Full Grammar
This is the full grammar for the form markup language. It is written in EBNF logic.
- Words in code block like
formkl
are 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
base
flat
FormSubmissionFunction
FormHttpMethod (
StringLiteral )
FormHttpMethod
get
post
put
patch
delete
SectionBlockList
(SectionBlock)*
SectionBlock
[NumericLiteral | multiple
] StringLiteral includes
{
FieldStatementList }
[as
StringLiteral]
FieldStatementList
FieldStatement
- [NumericLiteral] [
require
] StringLiteral FieldExpression [as
StringLiteral] - [
multiple
] [require
] StringLiteral FieldExpression [as
StringLiteral]
FieldExpression
- FieldDefaultExpression
- FieldSelectionExpression
- FieldValidatedExpression
- FieldDatetimeExpression
- FieldExpression ValidationExpression
FieldDefaultExpression
text
paragraph
number
switch
FieldSelectionExpression
- [
select
|checkbox
|radio
] StringLiteral [url
](
StringList)
- [
select
|checkbox
|radio
] StringLiteral(
StringList)
FieldValidatedExpression
email
zip
age
FieldDatetimeExpression
datetimerange
datetime
daterange
date
time
timerange
ValidationExpression
valid
(
LogicalORExpression)
[regex
(
StringLiteral)
]regex
(
StringLiteral)
[valid
(
LogicalORExpression)
]
LogicalORExpression
LogicalANDExpression
RelationalExpression
>
NumericLiteral<
NumericLiteral>=
NumericLiteral<=
NumericLiteral==
Literal!=
Literalhas
IncludableLiteral
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