Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. %{
  2. #include <stdio.h>
  3. #include <string>
  4. #include "parser.tab.h"
  5. #include <memory>
  6. #include <cstring>
  7. int ch;
  8. %}
  9.  
  10. %option noyywrap
  11.  
  12.  
  13. words ([A-Za-z0-9]*)
  14.  
  15. %%
  16.  
  17. {words} { ch += yyleng; yylval.string = new char[100](); sscanf(yytext, "%s", yylval.string); return STRINGG; }
  18.  
  19. %%
  20.  
  21. int main() {
  22. yyparse();
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement