Unit | ::= | ( Signature )? ( Statement )* <EOF> |
Signature | ::= | <SIGNATURE> IntLiteral IntLiteral <SEMICOLON> |
Statement | ::= | Block |
| | Declaration | |
| | ExpressionStatement | |
| | PrintStatement | |
| | DrawStatement | |
| | IfStatement | |
| | WhileStatement | |
| | ForStatement | |
Block | ::= | <LBRACE> ( Statement )* <RBRACE> |
Declaration | ::= | <BOOLEAN> BooleanDeclaration <SEMICOLON> |
| | <INT> IntDeclaration <SEMICOLON> | |
| | <DOUBLE> DoubleDeclaration <SEMICOLON> | |
| | <CLIFFORD> CliffordDeclaration <SEMICOLON> | |
| | <COLOR> ColorDeclaration <SEMICOLON> | |
BooleanDeclaration | ::= | <ID> ( <COMMA> BooleanDeclaration )? |
IntDeclaration | ::= | <ID> ( <COMMA> IntDeclaration )? |
DoubleDeclaration | ::= | <ID> ( <COMMA> DoubleDeclaration )? |
CliffordDeclaration | ::= | <ID> ( <COMMA> CliffordDeclaration )? |
ColorDeclaration | ::= | <ID> <LPAREN> DoubleLiteral <COMMA> DoubleLiteral <COMMA> DoubleLiteral <RPAREN> ( <COMMA> ColorDeclaration )? |
ExpressionStatement | ::= | Expression <SEMICOLON> |
Expression | ::= | Assignment |
| | OrExpression | |
Assignment | ::= | <ID> ( <LBRAKET> Expression <RBRAKET> )? <ASSIGNMENT> Expression |
OrExpression | ::= | AndExpression ( <OR> AndExpression )* |
AndExpression | ::= | EqualityExpression ( <AND> EqualityExpression )* |
EqualityExpression | ::= | RelationalExpression ( ( <EQUAL> | <UNEQUAL> ) RelationalExpression )* |
RelationalExpression | ::= | Sum ( ( <GREATER> | <GREATEREQUAL> | <LOWER> | <LOWEREQUAL> ) Sum )* |
Sum | ::= | Product ( ( <MINUS> | <PLUS> ) Product )* |
Product | ::= | Unary ( ( <COMMUTATION> | <DIVISION> | <DUAL> | <LCONTRACTION> | <MEET> | <POWER> | <PRODUCT> | <RCONTRACTION> | <ROTATION> | <WPRODUCT> ) Unary )* |
Unary | ::= | ( <DUAL> | <MINUS> | <NOT> | <REVERSION> ) Unary |
| | PrimaryExpression | |
PrimaryExpression | ::= | BooleanLiteral |
| | IntLiteral | |
| | DoubleLiteral | |
| | BinaryLiteral | |
| | StringLiteral | |
| | Function | |
| | PointP3 | |
| | RotorP3 | |
| | Identifier | |
| | <LPAREN> Expression <RPAREN> | |
BooleanLiteral | ::= | ( <FALSE> | <TRUE> ) |
IntLiteral | ::= | <INTLITERAL> |
DoubleLiteral | ::= | <DOUBLELITERAL> |
BinaryLiteral | ::= | <BINARYLITERAL> |
StringLiteral | ::= | <STRINGLITERAL> |
Function | ::= | ( <ABS> | <ACOS> | <ASIN> | <ATAN> | <COS> | <EXP> | <FLOOR> | <LOG> | <ROUND> | <SIN> | <SQRT> | <TAN> | <TODOUBLE> ) <LPAREN> Expression <RPAREN> |
PointP3 | ::= | <POINTP3> <LPAREN> Expression <COMMA> Expression <COMMA> Expression <RPAREN> |
RotorP3 | ::= | <ROTORP3> <LPAREN> Expression <COMMA> Expression <COMMA> Expression <COMMA> Expression <COMMA> Expression <COMMA> Expression <RPAREN> |
Identifier | ::= | <ID> ( <LBRAKET> Expression <RBRAKET> )? |
PrintStatement | ::= | <PRINT> Expression <SEMICOLON> |
DrawStatement | ::= | <DRAW> <LPAREN> Expression <COMMA> Identifier ( <COMMA> Expression )? <RPAREN> <SEMICOLON> |
IfStatement | ::= | <IF> <LPAREN> Expression <RPAREN> Statement ( <ELSE> Statement )? |
WhileStatement | ::= | <WHILE> <LPAREN> Expression <RPAREN> Statement |
ForStatement | ::= | <FOR> <LPAREN> OptionalExpression <SEMICOLON> Expression <SEMICOLON> OptionalExpression <RPAREN> Statement |
OptionalExpression | ::= | ( Expression )? |