daily pastebin goal
0%
SHARE
TWEET

Untitled

a guest Mar 26th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. %%
  2. <<EOF>>     return END;
  3. " "     |
  4. "\t"        ;
  5. the     |
  6. an?     return ARTICLE;
  7.  
  8. go(es)?     |
  9. runs?       |
  10. likes?      |
  11. eats?       return VERB;
  12.  
  13. dogs?       |
  14. cats?       |
  15. moose       return NOUN;
  16.  
  17. quick       |
  18. slow        |
  19. small       return ADJECTIVE;
  20.  
  21. quickly     |
  22. easily      |
  23. slowly      return ADVERB;
  24.  
  25. "."     |
  26. ,       |
  27. ")"     return PUNCTUATION;
  28.  
  29. over        |
  30. under       |
  31. between     return PREPOSITION;
  32.  
  33. %%
  34.  
  35. int main(void)
  36. {
  37.     int result;
  38.     int running = 1;
  39.     while(runnig){
  40.         result = yylex();
  41.         switch(result){
  42.             case ARTICLE: printf("Article"); break;
  43.             case VERB: printf("Verb); break;
  44.             case NOUN: printf("Noun); break;
  45.             case ADJECTIVE: printf("Adjective); break;
  46.             case ADVERB: printf("Adverb"); break;
  47.             case PUNCTUATION: printf("Punctuation); break;
  48.             case PREPOSITION: printf("Preposition); break;
  49.             case END: running = 0; break;
  50.             default: printf("Huh?");       
  51.         }
  52.     }
  53.     return 0;
  54. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top