Grammar¶
What follows is a rough rendition of the Lama2 grammar, followed by a visual exploration of the grammar in the railroad diagram format (thanks to Railroad Diagram Generator)
EBNF Description¶
Lama2File ::= (Proceessor Separator)? Requestor (Separator Processor Separator Requestor)*
Separator ::= `^---$`
Processor ::= `(?!(get|post|head|put|delete|connect|trace|patch))`
Requestor ::= HTTPVerb Multipart? TheURL Details?
HTTPVerb ::= "get" | "head" | "post" | "put" | "delete" | "connect" | "trace" | "patch"
Multipart ::= "multipart"
TheURL ::= "http" "s"? "://" [A-Za-z0-9-._~:/?#[@!$&'()*+,;%=]+ /* ws: explicit */
Details ::= HeaderData | DataHeader
HeaderData ::= Headers DataInput?
DataHeader ::= DataInput Headers?
Headers ::= HeaderPair HeaderPair*
HeaderPair ::= (QuotedString | Unquoted) ":" (QuotedString | Unquoted)
DataInput ::= VarJSON | JSONType
VarJSON ::= VarJSONPair VarJSONPair* FilesPair?
VarJSONPair ::= (QuotedString | VarJSONUnquoted) "=" (QuotedString | VarJSONUnquoted)
FilesPair ::= FilesPair FilesPair*
FilesPair ::= (QuotedString | FilesUnquoted) "@" (QuotedString | FilesUnquoted)
VarJSONUnquoted ::= [@0-9A-Za-z \t!$%&()*+./;<>?^_`|~-]+ /* ws: explicit */
FilesUnquoted ::= [0-9A-Za-z \t!$%&()*+./;<>?^_`|~-]+ /* ws: explicit */
QuotedString ::= ['"] Char* ['"]
Unquoted ::= [0-9A-Za-z \t!$%&()*+./;<=>?^_`|~-]+ /* ws: explicit */
JSONType ::= ComplexType | PrimitiveType
ComplexType ::= List | Map
PrimitiveType ::= Null | Boolean | QuotedString | Number
Map ::= "{" Pair? (Pair ",")* "}"
List ::= "[" JSONType? (JSONType ",")* "]"
Pair ::= QuotedString ":" JSONType
Boolean ::= "true" | "false"
Null ::= "null"
Number ::= Integer Fraction? Exponent?
Exponent ::= [eE] Sign? Digits
Fraction ::= "." Digits
Integer ::= IntegerRule4 | IntegerRule3 | IntegerRule2 | IntegerRule1
IntegerRule1 ::= Digit
IntegerRule2 ::= OneNine Digits
IntegerRule3 ::= Sign IntegerRule1
IntegerRule4 ::= Sign IntegerRule2
Digits ::= Digit Digit*
Digit ::= "0"? OneNine
OneNine ::= [1-9]
Sign ::= [-+]
Railroad Diagram¶
no references
::= '---'
referenced by:
::= '(?!(get|post|head|put|delete|connect|trace|patch))'
referenced by:
referenced by:
HTTPVerb ::= 'get'
| 'head'
| 'post'
| 'put'
| 'delete'
| 'connect'
| 'trace'
| 'patch'
referenced by:
::= 'multipart'
referenced by:
TheURL ::= 'http' 's'? '://' [A-Za-z0-9._~:/?[@!$&'()*+,;%=#x2D#x23]+
/* ws: explicit */
referenced by:
Details ::= HeaderData
referenced by:
referenced by:
referenced by:
referenced by:
referenced by:
referenced by:
referenced by:
referenced by:
referenced by:
::= [@0-9A-Za-z \t!$%&()*+./;<>?^_`|~#x2D]+
/* ws: explicit */
referenced by:
::= [0-9A-Za-z \t!$%&()*+./;<>?^_`|~#x2D]+
/* ws: explicit */
referenced by:
::= ['"] Char* ['"]
referenced by:
Unquoted ::= [0-9A-Za-z \t!$%&()*+./;<=>?^_`|~#x2D]+
/* ws: explicit */
referenced by:
JSONType ::= ComplexType
referenced by:
referenced by:
referenced by:
referenced by:
referenced by:
referenced by:
Boolean ::= 'true'
| 'false'
referenced by:
Null ::= 'null'
referenced by:
referenced by:
referenced by:
referenced by:
Integer ::= IntegerRule4
referenced by:
::= Digit
referenced by:
referenced by:
referenced by:
referenced by:
referenced by:
referenced by:
OneNine ::= [1-9]
referenced by:
Sign ::= [-+]
referenced by:
|