betoesquivel

lex example

Jan 25th, 2015
538
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.38 KB | None | 0 0
  1. %{
  2. #include <stdio.h>
  3. %}
  4.  
  5. %%
  6. [a-zA-Z][a-zA-Z0-9]*    printf("WORD ");
  7. [a-zA-Z0-9\/.-]+        printf("FILENAME ");
  8. \"                      printf("QUOTE ");
  9. \{                      printf("OBRACE ");
  10. \}                      printf("EBRACE ");
  11. ;                       printf("SEMICOLON ");
  12. \n                      printf("\n");
  13. [ \t]+                  /* ignore whitespace */;
  14. %%
Advertisement
Add Comment
Please, Sign In to add comment