Advertisement
Guest User

Untitled

a guest
Apr 5th, 2011
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. %{
  2. #include "yacc_parser.hh"
  3. %}
  4.  
  5. %%
  6.  
  7. if return IF;
  8. ei return ELSEIF;
  9. else return ELSE;
  10. endif return ENDIF;
  11. while return WHILE;
  12. loop return LOOP;
  13. func return FUNC;
  14. end return END;
  15.  
  16. := return ASSIGN;
  17. \. return DOT;
  18. , return COMMA;
  19. : return COLON;
  20. \( return OPAREN;
  21. \) return CPAREN;
  22.  
  23. (\n|\r\n?) { /* increment line count */ return LF; }
  24. ; return LF;
  25.  
  26. [!?A-Za-z][!?A-Za-z0-9] { yylval.str = yytext; return NAME; }
  27. [0-9]+ { yylval.str = yytext; return INTEGER; }
  28.  
  29. %%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement