Example productionset
For the purposes of testing, the MultExpression
is in a separate productionset
.
[1] MultExpression:=MultExpression
'*'
MultExpression
| MultExpression '/' MultExpression
| Number div0
| MultExpression '/' MultExpression
| Number div0
The full grammar follows:
Arithemetic Expressions
Second RHS for testing.
/* This isn’t grammatical! */
[1] MultExpression:=MultExpression
'*'
MultExpression
| MultExpression '/' MultExpression
| Number div0
| MultExpression '/' MultExpression
| Number div0
[4] Number:=[0-9]+
Division by Zero
Division by zero is an error.