/* vi: set ts=4 sw=4 noet ft= : */ %include { #include "ast.h" } %token_type {char *} %type start {ast *} start(A) ::= expr(B). { A = B; } %type expr {ast *} expr(A) ::= LPAREN expr(B) SEP expr(C) RPAREN. { A = new_pair(B, C); } expr(A) ::= INT(B). { A = new_int(B); } expr(A) ::= FLOAT(B). { A = new_float(B); } expr(A) ::= ID(B). { A = new_id(B); }