%require "~> 0.1" %generator "ruby" %define api.push-pull pull %define panic-mode true %token NUMBER %token SEMICOLON ";" %token ADD "+" %token LPAREN "(" %token RPAREN ")" %type s e t %null.data api.prefix "antelope_" %union { struct slip_parser_node* node; struct slip_lex_token* lex; struct slip_parser_list* list; } %% s: e e: t[a] SEMICOLON[b] { $$ = $1 } | t[a] ADD[b] e[c] { $$ = $1 + $2 } | error[a] t: NUMBER | LPAREN e RPAREN { $$ = $2 } %% class DeterministicParser < Antelope::Parser %{write} end