What's wrong with this lex file? <p>I have a Makefile so that when I type make the following commands run:</p> <pre><code>yacc -d parser.y gcc -c y.tab.c flex calclexer.l gcc -c lex.yy.c </code></pre> <p>But then after this I get the following error messages:</p> <pre><code>calclexer.l:10: error: parse error before '[' token calclexer.l:10: error: stray '\' in program calclexer.l:15: error: stray '\' in program calclexer.l:24: error: stray '\' in program make: *** [lex.yy.o] Error 1 </code></pre> <p>This is what is inside calclexer. How can it be fixed?</p> <pre><code>%{ #include "y.tab.h" #include "parser.h" #include &lt;math.h&gt; %} %% %% ([0-9]+|([0-9]*\.[0-9]+)([eE][-+]?[0-9]+)?) { yylval.dval = atof(yytext); return NUMBER; } [ \t] ; /* ignore white space */ [A-Za-z][A-Za-z0-9]* { /* return symbol pointer */ yylval.symp = symlook(yytext); return NAME; } "$" { return 0; /* end of input */ } \n |. return yytext[0]; %% </code></pre>