diff options
Diffstat (limited to 'util/qlalr/examples/lambda/lambda.g')
-rw-r--r-- | util/qlalr/examples/lambda/lambda.g | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/util/qlalr/examples/lambda/lambda.g b/util/qlalr/examples/lambda/lambda.g new file mode 100644 index 0000000..2fb9594 --- /dev/null +++ b/util/qlalr/examples/lambda/lambda.g @@ -0,0 +1,41 @@ + +-- lambda calculus + +%decl lambda.h + +%token LPAREN +%token RPAREN +%token ID +%token FUN +%token DOT + +%nonassoc SHIFT_THERE +%nonassoc LPAREN RPAREN ID FUN DOT +%nonassoc REDUCE_HERE + +%start Expr + +/: +enum { +:/ + + +Expr ::= ID %prec SHIFT_THERE ; +/: Symbol = $rule_number, +:/ + +Expr ::= LPAREN Expr RPAREN %prec SHIFT_THERE ; +/: SubExpression = $rule_number, +:/ + +Expr ::= Expr Expr %prec REDUCE_HERE ; +/: Appl = $rule_number, +:/ + +Expr ::= FUN ID DOT Expr %prec SHIFT_THERE ; +/: Abstr = $rule_number, +:/ + +/:}; +:/ + |