Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Statement := ' '* ({Control} | {Operation | {Assignment}) ' '* ';'
- Control := 'if(' {CompoundBooleanOperation} ')' '\n'* '{' '\n'* {Statement}* '\n'* '}' ('\n'* 'else' '\n'* '{' {Statement}* '\n'* '}')? | 'while(' {BooleanOp} ')' '\n'* '{' '\n'* {Statement}* '\n'* '}'
- Operation := {String} '(' (({MathOperation} | {RealNumber} | {Variable} | {StringLiteral}) (',' ({MathOperation} | {RealNumber} | {Variable} | {StringLiteral}))*)? ')'
- Assignment := {Variable} ' '* '=' ' '* ({MathOperation} | {RealNumber})
- MathOperation := {Variable} ' '* {BinaryMathOp} ' '* {Variable} | {Variable} ' '* {BinaryMathOp} ' '* {RealNumber} | {Variable} ' '* {BinaryMathOp} ' '* {MathOperation} | {Variable} ' '* {BinaryMathOp} ' '* {ParenMathOperation} | {RealNumber} ' '* {BinaryMathOp} ' '* {Variable} | {RealNumber} ' '* {BinaryMathOp} ' '* {RealNumber} | {RealNumber} ' '* {BinaryMathOp} ' '* {MathOperation} | {RealNumber} ' '* {BinaryMathOp} ' '* {ParenMathOperation} | {MathOperation} ' '* {BinaryMathOp} ' '* {Variable} | {MathOperation} ' '* {BinaryMathOp} ' '* {RealNumber} | {MathOperation} ' '* {BinaryMathOp} ' '* {MathOperation} | {MathOperation} ' '* {BinaryMathOp} ' '* {ParenMathOperation} | {ParenMathOperation} ' '* {BinaryMathOp} ' '* {Variable} | {ParenMathOperation} ' '* {BinaryMathOp} ' '* {RealNumber} | {ParenMathOperation} ' '* {BinaryMathOp} ' '* {MathOperation} | {ParenMathOperation} ' '* {BinaryMathOp} ' '* {ParenMathOperation}
- ParenMathOperation := '(' ({MathOperation} | {Variable} | {RealNumber}) ')'
- Variable := {String}
- CompoundBooleanOperation := {BooleanOperation} | {UnaryLogicalOp} '(' {BooleanOperation} ')' | {CompoundBooleanOperation} {BinaryLogicalOp} {CompoundBooleanOperation}
- BinaryLogicalOp := '&&' | '||' '^'
- UnaryLogicalOp := '!'
- BooleanOperation := {Variable} {BooleanOp} {Variable} | {Variable} {BooleanOp} {RealNumber} | {Variable} {BooleanOp} {MathOperation} | {Variable} {BooleanOp} {ParenBooleanOperation} | {RealNumber} {BooleanOp} {Variable} | {RealNumber} {BooleanOp} {RealNumber} | {RealNumber} {BooleanOp} {MathOperation} | {RealNumber} {BooleanOp} {ParenBooleanOperation} | {MathOperation} {BooleanOp} {Variable} | {MathOperation} {BooleanOp} {RealNumber} | {MathOperation} {BooleanOp} {MathOperation} | {MathOperation} {BooleanOp} {ParenBooleanOperation}
- ParenBooleanOperation := '(' {BooleanOperation} ')'
- BooleanOp := '==' | '!=' | '{' | '}' | '}=' | '{='
- RealNumber := {DigitList} | {DigitList} '.' {DigitList} | '-' {DigitList} | '-' {DigitList} '.' {DigitList}
- DigitList := {Digit}
- | {Digit} {DigitList}
- Digit := '0'
- | '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