Skip to content

Instantly share code, notes, and snippets.

@vihanb
Created April 2, 2016 17:19
Show Gist options
  • Save vihanb/359d81e5571dd9c8f0f6a5d14d992fd4 to your computer and use it in GitHub Desktop.
Save vihanb/359d81e5571dd9c8f0f6a5d14d992fd4 to your computer and use it in GitHub Desktop.
Hello!

Cheddar Grammar

Using WSN

Expression

Expression Definitions:

TypedLiteral = TOKEN ':' (PARENTHESIZED_EXPRESSION | PROPERTY | LITERAL)
             | LITERAL .
Operator     = TOKEN | OPERATOR .
Expression   = Expression Operator Expression |
             | Operator Expression
             | Expression Operator
             | '(' Expression ')'
             | PROPERTY
             | TypedLiteral .

Class Names:

TOKEN : CheddarLiteralToken
LITERAL : CheddarAnyLiteral
OPERATOR : CheddarOperatorToken
PROPERTY : CheddarProperty
PARENTHESIZED_EXPRESSION : CheddarParenthesizedExpression

Code Block

Todo...

Command Parser

Command = TOKEN { Expression } .

Function Parser

Function Definitions:

FunctionOpen = "->" | "=>"

FunctionBody = FunctionOpen (
              '{' CodeBlock '}'
             | Command
             | Expression  ) .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment