Guest User

Untitled

a guest
Dec 6th, 2015
520
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. match_c_comments.lex
  2.  
  3. %x IN_COMMENT
  4.  
  5. %%
  6.  
  7. <INITIAL>{
  8. "/*" BEGIN(IN_COMMENT);
  9. }
  10. <IN_COMMENT>{
  11. "*/" BEGIN(INITIAL);
  12. [^*\n]+ // eat comment in chunks
  13. "*" // eat the lone star
  14. \n yylineno++;
  15. }
  16.  
  17. %%
  18.  
  19. main() {
  20. yylex();
  21. return 0;
  22. }
  23.  
  24. input.txt
  25.  
  26. #include<stdio.h>
  27.  
  28. main() {
  29. /*
  30. comentariu
  31. */
  32. printf("*/");
  33.  
  34. return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment