to declare a parameter to yyparse(), you can use a define: #define yyparse() myparse(x) <type> x; This makes x a parameter to yyparse(). You can do the same with lex.