编译原理
源代码在线查看: simple.xml
C001
A simple expression.
9 - 3 * 2
3
C002
Expression with arithmetic operations.
2.25E+2 - (55.5 + 4 * (10 / 2) ^ 2)
69.5
C003
Expression with arithmetic operations.
65 / 5 - 130e-1
0.0
E001
Left parenthesis expected.
(2 + 3) ^ 3) - ((1 + 1)
MissingLeftParenthesisException
E002
Right parenthesis expected.
((2 + 3) ^ ((3 - 1) + 1)
MissingRightParenthesisException
E003
Operator expected.
(1 + 2) ^ (3 - 4) 5
MissingOperatorException
E004
Operand expected.
(1 + 2) ^ (3 - ) + 5
MissingOperandException
E005
Divided by 0.
4 / (12 - 3 * 4) + 1
DividedByZeroException