Grammar: Difference between revisions
Content added Content deleted
mNo edit summary |
No edit summary |
||
Line 10: | Line 10: | ||
<verb> ::= <term> <Adverb> | <Verb> |
<verb> ::= <term> <Adverb> | <Verb> |
||
<noun> ::= <term> "[" <Exprs> "]" | "(" <Exprs> ")" | "{" <Exprs> "}" | <Noun> |
<noun> ::= <term> "[" <Exprs> "]" | "(" <Exprs> ")" | "{" <Exprs> "}" | <Noun> |
||
<tt><Adverb></tt>, <tt><Verb></tt>, and <tt><Noun></tt> can be further defined (with minor variations between dialects) as: |
|||
<Adverb> ::= "'" | "/" | "\" | "':" | "/:" | "\:" |
<Adverb> ::= "'" | "/" | "\" | "':" | "/:" | "\:" |
||
<Verb> ::= <Verb1> | <Verb1> ":" |
<Verb> ::= <Verb1> | <Verb1> ":" |
||
<Verb1> ::= ":" | "+" | "-" | "*" | "%" | "!" | "&" | "|" | "<" | ">" | "=" | "~" | "," | |
<Verb1> ::= ":" | "+" | "-" | "*" | "%" | "!" | "&" | "|" | "<" | ">" | "=" | "~" | "," | |
||
"^" | "#" | "_" | "$" | "?" | "@" | "." | <Digit> ":" |
"^" | "#" | "_" | "$" | "?" | "@" | "." | <Digit> ":" |
||
<Noun> ::= <Ints> | <Floats> | < |
<Noun> ::= <Names> | <Ints> | <Floats> | <String> | <Symbols> |
||
<Names> ::= <Names> "." <Name> | <Name> |
|||
.. |
|||
<Name> ::= <Letter> | <Name> <Letter> | <Name> <Digit> |
|||
<Ints> ::= <Int> | <Ints> " " <Int> |
|||
<Int> ::= "-" <Digits> | <Digits> |
|||
<Floats> ::= <Float> | <Floats> " " <Float> |
|||
<Float> ::= <Int> | <Int> "." <Digits> | <Int> "." <Digits> "e" <Int> |
|||
<String> ::= '"' <Chars> '"' | "0x" <Bytes> |
|||
<Chars> ::= <Chars> <Char> | empty |
|||
<Char> ::= "\0" | "\t" | "\n" | "\r" | '\"' | "\\" | any |
|||
<Bytes> ::= <Bytes> <Hex> <Hex> | empty |
|||
<Symbols>::= <Symbols> <Symbol> | <Symbol> |
|||
<Symbol> ::= "`" | "`" <Name> | "`" <String> |
|||
<Digits> ::= <Digit> | <Digits> <Digit> |
|||
<Digit> ::= "0" | .. | "9" |
|||
<Hex> ::= <Digit> | "a" | .. | "f" |
|||
<Letter> ::= "A" | .. | "Z" | "a" | .. | "z" |
|||
K can be parsed statically - no knowledge about the runtime values of variables is required to build a parse tree. |
K can be parsed statically - no knowledge about the runtime values of variables is required to build a parse tree. |