This project is read-only.

Parser Grammar

This is a description of the language parsed by the LambdaParser class.

LAMBDA := (PARAM_LIST | PARAM) "=>" EXPRESSION
PARAM_LIST := "(" PARAM ("," PARAM)* ")"
PARAM := IDENTIFIER
EXPRESSION := CONDITIONAL
CONDITIONAL := BOOLEAN ("?" CONDITIONAL ":" CONDITIONAL)?
BOOLEAN := EQUALITY (("&&" | "||") EQUALITY)*
EQUALITY := RELATIONAL (("==" | "!=") RELATIONAL)*
RELATIONAL := ADDITION ((">=" | "<=" | ">" | "<") ADDITION)*
ADDITION := MULTIPLICATION (("+" | "-") MULTIPLICATION)*
MULTIPLICATION := POWER (("*" | "/") POWER)*
POWER := UNARY ("^" UNARY)*
UNARY := ("!" | "-")? PRIMARY
PRIMARY := "(" CONDITIONAL ")" | VALUE
VALUE := NUMBER | STRING | IDENTIFIER
NUMBER := [0-9]+ ("." [0-9]*)?
STRING := "'" .* "'" // Use the escape sequence "\'" to include a single-quote in your string.
IDENTIFIER := "null" | "true" | "false" | [A-Za-z_][A-Za-z_0-9]*

Last edited Aug 17, 2010 at 9:56 PM by treytomes, version 4

Comments

No comments yet.