# BNF Math Expression

May 7th, 2014
760
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. Initial symbol = <expression>
2.
3. <expression> ::= <arithmetic_expression> | <boolean_expression>
4.
5. <arithmetic_expression> ::= <arithmetic_expression_type> |
6.                 <arithmetic_expression_type><operator><arithmetic_expression> |
7.                 <parentized_expression> |
8.                 <parentized_expression><operator><arithmetic_expression> |
9.                 <polynomial_expression_with_result>
10.
11. <arithmetic_expression_type> ::= <function> | <number> | <polynomial_expression>
12.
13. <parentized_expression> ::= "(" <arithmetic_expression> ")"
14.
15. <boolean_expression> ::= <boolean_condition> |
16.              <boolean_condition> <boolean_operator> <boolean_expression> |
17.              <parentized_boolean_expression> |
18.              <parentized_boolean_expression><boolean_operator><boolean_expression>
19.
20. <parentized_boolean_expression> ::= "(" <boolean_expression> ")"
21.
22. <number> ::= <integer> | <float> | <signal><integer> | <signal><float>
23.
24. <integer> ::= <digit> | <digit><integer>
25.
26. <float> ::= <integer>"."<integer>
27.
28. <digit> ::= "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "0"
29.
30. <letter> ::= "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" |
31.          "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" |
32.          "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" |
33.          "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z"
34.
35. <signal> ::= "-" | "+"
36.
37. <operator> ::= "+" | "-" | "*" | "/" | "^" | "%"
38.
39. <relational_operator> ::= ">" | "<" | ">=" | "<=" | "=="
40.
41. <boolean_operator> ::= "&&" | "||"
42.
43. <boolean_condition> ::= "true" | "false"
44.
45. <function> ::= <function_name> "(" <parameter_list> ")"
46.
47. <function_name> ::= <letter> <name>
48.
49. <name> ::= <letter> | <digit> | <letter><name> | <digit><name> | ""
50.
51. <parameter_list> ::= <parameter> | <parameter>","<parameter_list>
52.
53. <parameter> ::= <function> | <number> | <polynomial_expression>
54.
55. <polynomial_expression> ::= <polynomial_term> |
56.                 <polynomial_term> <operator> <polynomial_expression>
57.
58. <polynomial_term> ::= <letter><exponent> |
59.               <signal><letter><exponent> |
60.               <number><letter><exponent>
61.
62. <exponent> ::=  "^"<function><exponent> |
63.         "^"<polynomial_expression> |
64.         "^"<number><exponent> | ""
65.
66. <polynomial_expression_with_result> ::= <polynomial_expression> "=" <result>
67.
68. <result> ::= <function> | <number> | <polynomial_expression>
RAW Paste Data

# Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×