Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %ignore " "
- COMMENT: "#" /[^\n]/*
- %ignore COMMENT
- SEMICOLON: ";"
- END_LINE: "\n"
- SEPARATOR: SEMICOLON | END_LINE
- ZERO: "0"
- POSITIVE_DIGIT: "1".."9"
- DIGIT: ZERO | POSITIVE_DIGIT
- UPPERCASE_LETTER: "A".."Z"
- LOWERCASE_LETTER: "a".."z"
- LETTER: UPPERCASE_LETTER | LOWERCASE_LETTER
- POSITIVE_INTEGER: POSITIVE_DIGIT DIGIT*
- NEGATIVE_INTEGER: "-" POSITIVE_INTEGER
- INTEGER: ZERO | POSITIVE_INTEGER | NEGATIVE_INTEGER
- DECIMAL: INTEGER "." ZERO* POSITIVE_DIGIT
- NUMBER: INTEGER | DECIMAL
- PLUS: "+"
- MINUS: "-"
- MULTIPLE: "*"
- DIVIDE: "//"
- DIV: "div"
- sum_operator: PLUS | MINUS
- multiple_operator: MULTIPLE | DIVIDE | DIV
- operator: sum_operator | multiple_operator
- LOWERCASE_NAME: LOWERCASE_LETTER (LOWERCASE_LETTER | "_")*
- const_indent: LOWERCASE_NAME
- const_multiplied: const_indent | NUMBER
- const_multiple_expression: (const_multiplied multiple_operator)+ const_multiplied
- | "(" const_multiple_expression ")" multiple_operator const_multiplied
- | "(" const_multiple_expression ")" multiple_operator const_multiple_expression
- | const_multiplied multiple_operator "(" const_multiple_expression ")"
- | const_multiple_expression multiple_operator "(" const_multiple_expression ")"
- | "(" const_multiple_expression ")" multiple_operator "(" const_multiple_expression ")"
- const_addend: NUMBER | const_indent | const_multiple_expression
- const_sum_expression: (const_addend sum_operator)+ const_addend
- | "(" const_sum_expression ")" sum_operator const_addend
- | "(" const_multiple_expression ")" sum_operator const_addend
- | const_addend sum_operator "(" const_sum_expression ")"
- | const_addend sum_operator "(" const_multiple_expression ")"
- const_expression: const_multiple_expression
- | const_sum_expression
- | "(" const_expression ")" operator "(" const_expression ")"
- const_value: NUMBER | const_indent | const_expression
- start: const_value
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement