%{ #include "calctree.tab.h" YYSTYPE yylval; %} %% \n { yylval.np = alcleaf('\n', yytext); return '\n'; } [ \t] { /* ignore */ } [0-9]+"."?[0-9]* { yylval.np = alcleaf(NUM, yytext); return NUM; } "+"|"-"|"*"|"/"|"^"|"("|")" { yylval.np = alcleaf(yytext[0], yytext); return yytext[0]; }