7
十二月

Lex/YACC作業二的Lex(hw2.l)

   Posted by: admin   in 98(上)編譯器

%{
#include "y.tab.h"
%}
 
%%
[0-9]+ { yylval.ival = atoi(yytext); return NUMBER; }
[ \t]	;		/* ignore white space */
\n	return 0;	/* logical EOF */
[\+\-\(\)\,] {return yytext[0];}
[a-zA-Z]+	{ yylval.sval = (char *)calloc(strlen(yytext)+1,sizeof(char));
            strcpy(yylval.sval,yytext); return NAME;}
. ;
%%

bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark

Tags: ,

This entry was posted on 星期一, 十二月 7th, 2009 at 10:42:40 and is filed under 98(上)編譯器. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

5 Trackbacks/Pings

  1. lance    十一月 25 2014 / 2上午:

    recoiled@den.trenchard” rel=”nofollow”>.…

    ñïñ!!…

  2. andrew    十二月 15 2014 / 2上午:

    kupcinet@kitchens.finders” rel=”nofollow”>.…

    ñïñ çà èíôó!…

  3. kevin    一月 18 2015 / 4下午:

    indicating@caron.forwarding” rel=”nofollow”>.…

    ñïàñèáî çà èíôó!…

  4. gerald    一月 29 2015 / 11上午:

    conservatism@flavored.braces” rel=”nofollow”>.…

    ñïàñèáî!!…

  5. franklin    二月 10 2015 / 3下午:

    yori@gen.katharines” rel=”nofollow”>.…

    ñïàñèáî!!…

Leave a reply

Name (*)
Mail (will not be published) (*)
URI
Comment