Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Statement := ' '*, (Control | Operation | Assignment), ' '*, ';';
- Control := 'if(' CompBoolOperation ')', '\n'*, '{', '\n'*, Statement*, '\n'*, '}', ('\n'*, 'else', '\n'*, '{', Statement*, '\n'*, '}')?;
- | 'while(' BoolOperation ')', '\n'*, '{', '\n'*, Statement*, '\n'*, '}'
- | 'break';
- Operation := String, '(', (,(MathOperation | NumberLiteral | Identifier | StringLiteral) , (,',', (MathOperation | NumberLiteral | Identifier | StringLiteral,),)*,)? ,')';
- Assignment := Identifier, ' '*, '=', ' '*, (MathOperation | NumberLiteral);
- MathOperation := MathOperand, BinaryMathOp, MathOperand;
- ParenMathOperation := '(', (MathOperation | Identifier | NumberLiteral), ')';
- MathOperand := Identifier
- | NumberLiteral
- | MathOperation
- | ParenMathOperation;
- Identifier := String;
- CompBoolOperation := BooleanOperation
- | UnaryLogicalOp, '(', BooleanOperation ')',
- | CompBooleanOperation, BinaryLogicalOp, CompBooleanOperation;
- BinaryLogicalOp := '&&'
- | '||'
- | '^';
- UnaryLogicalOp := '!';
- BoolOperation := Identifier, BooleanOp, Identifier
- | Identifier, BooleanOp, NumberLiteral
- | Identifier, BooleanOp, MathOperation
- | Identifier, BooleanOp, BooleanOperation
- | NumberLiteral, BooleanOp, Identifier
- | NumberLiteral, BooleanOp, NumberLiteral
- | NumberLiteral, BooleanOp, MathOperation
- | NumberLiteral, BooleanOp, BooleanOperation
- | MathOperation, BooleanOp, Identifier
- | MathOperation, BooleanOp, NumberLiteral
- | MathOperation, BooleanOp, MathOperation
- | MathOperation, BooleanOp, BooleanOperation;
- ParenBoolOperation := '(', BoolOperation, ')';
- BooleanOp := '=='
- | '!='
- | '<'
- | '>'
- | '<='
- | '>=';
- NumberLiteral := ['-'], Number, ['.', {Digit}];
- Number := NonZeroDigit
- | NonZeroDigit {Digit};
- Digit := '0'
- | NonZeroDigit;
- NonZeroDigit := '1'
- | '2'
- | '3'
- | '4'
- | '5'
- | '6'
- | '7'
- | '8'
- | '9';
- String := Character
- | Character String;
- Character := 'a'
- | 'b'
- | 'c'
- | 'd'
- | 'e'
- | 'f'
- | 'g'
- | 'h'
- | 'i'
- | 'j'
- | 'k'
- | 'l'
- | 'm'
- | 'n'
- | 'o'
- | 'p'
- | 'q'
- | 'r'
- | 's'
- | 't'
- | 'u'
- | 'v'
- | 'w'
- | 'x'
- | 'y'
- | 'z'
- | 'A'
- | 'B'
- | 'C'
- | 'D'
- | 'E'
- | 'F'
- | 'G'
- | 'H'
- | 'I'
- | 'J'
- | 'K'
- | 'L'
- | 'M'
- | 'N'
- | 'O'
- | 'P'
- | 'Q'
- | 'R'
- | 'S'
- | 'T'
- | 'U'
- | 'V'
- | 'W'
- | 'X'
- | 'Y'
- | 'Z';
- BinaryMathOp := '+'
- | '-'
- | '*'
- | '/';
- StringLiteral := '"', String, '"';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement