Skip to content
On this page

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)*

FieldStatement

FieldExpression

FieldDefaultExpression

  • text
  • paragraph
  • number
  • switch

FieldSelectionExpression

FieldValidatedExpression

  • email
  • zip
  • age

FieldDatetimeExpression

  • datetimerange
  • datetime
  • daterange
  • date
  • time
  • timerange

ValidationExpression

LogicalORExpression

LogicalANDExpression

RelationalExpression

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

Released under the MIT License.