annotate test/expression.x @ 339:6ee17c4dd6b8

Increase timeout
author Windel Bouwman
date Fri, 21 Feb 2014 13:35:07 +0100
parents e84047f29c78
children
rev   line source
318
e84047f29c78 Add burg and yacc initial attempts
Windel Bouwman
parents:
diff changeset
1
e84047f29c78 Add burg and yacc initial attempts
Windel Bouwman
parents:
diff changeset
2 %tokens '+' number '(' ')' '*'
e84047f29c78 Add burg and yacc initial attempts
Windel Bouwman
parents:
diff changeset
3 %%
e84047f29c78 Add burg and yacc initial attempts
Windel Bouwman
parents:
diff changeset
4
e84047f29c78 Add burg and yacc initial attempts
Windel Bouwman
parents:
diff changeset
5 input: expression {return $1};
e84047f29c78 Add burg and yacc initial attempts
Windel Bouwman
parents:
diff changeset
6
e84047f29c78 Add burg and yacc initial attempts
Windel Bouwman
parents:
diff changeset
7 expression: term { return $1 }
e84047f29c78 Add burg and yacc initial attempts
Windel Bouwman
parents:
diff changeset
8 | expression '+' term {};
e84047f29c78 Add burg and yacc initial attempts
Windel Bouwman
parents:
diff changeset
9
e84047f29c78 Add burg and yacc initial attempts
Windel Bouwman
parents:
diff changeset
10 term: factor { return $1 }
e84047f29c78 Add burg and yacc initial attempts
Windel Bouwman
parents:
diff changeset
11 | term '*' factor { return $1 * $3 };
e84047f29c78 Add burg and yacc initial attempts
Windel Bouwman
parents:
diff changeset
12
e84047f29c78 Add burg and yacc initial attempts
Windel Bouwman
parents:
diff changeset
13 factor: '(' expression ')'
e84047f29c78 Add burg and yacc initial attempts
Windel Bouwman
parents:
diff changeset
14 | number {return $1.val};
e84047f29c78 Add burg and yacc initial attempts
Windel Bouwman
parents:
diff changeset
15
e84047f29c78 Add burg and yacc initial attempts
Windel Bouwman
parents:
diff changeset
16