1234567891011121314151617181920212223242526 |
- %{
- #include "main.h"
- #include "save.tab.h"
- void yystring( char* src );
- %}
- %%
- pc|npc yystring( yytext ); return CH;
- map return MAP;
- [0-9]+ yylval.num=atoi(yytext); return NUM;
- rep|id|win|ispc|alert|alertness|fatigue|exhausted|health|pos yystring( yytext ); return STAT;
- [{},()=] return *yytext;
- [ \t\n]
- .
- %%
- void yystring( char* source ) {
- char* sink = malloc(sizeof(source)+1);
- strcpy( sink, source );
- yylval.str = sink;
- }
- int yywrap() {
- return 1;
- }
|