1*3c3a7b76Schristos %{ 2*3c3a7b76Schristos #include <stdio.h> 3*3c3a7b76Schristos #include <string.h> 4*3c3a7b76Schristos #include "y.tab.h" /* this comes from bison */ 5*3c3a7b76Schristos 6*3c3a7b76Schristos #define TRUE 1 7*3c3a7b76Schristos #define FALSE 0 8*3c3a7b76Schristos 9*3c3a7b76Schristos #define copy_and_return(token_type) { strcpy(yylval.name,yytext); \ 10*3c3a7b76Schristos return(token_type); } 11*3c3a7b76Schristos 12*3c3a7b76Schristos int yylexlinenum = 0; /* so we can count lines */ 13*3c3a7b76Schristos %} 14*3c3a7b76Schristos 15*3c3a7b76Schristos %% 16*3c3a7b76Schristos /* Lexical scanning rules begin from here. */ 17*3c3a7b76Schristos 18*3c3a7b76Schristos MEN|WOMEN|STOCKS|TREES copy_and_return(NOUN) 19*3c3a7b76Schristos MISTAKES|GNUS|EMPLOYEES copy_and_return(NOUN) 20*3c3a7b76Schristos LOSERS|USERS|CARS|WINDOWS copy_and_return(NOUN) 21*3c3a7b76Schristos 22*3c3a7b76Schristos DATABASE|NETWORK|FSF|GNU copy_and_return(PROPER_NOUN) 23*3c3a7b76Schristos COMPANY|HOUSE|OFFICE|LPF copy_and_return(PROPER_NOUN) 24*3c3a7b76Schristos 25*3c3a7b76Schristos THE|THIS|THAT|THOSE copy_and_return(DECLARATIVE) 26*3c3a7b76Schristos 27*3c3a7b76Schristos ALL|FIRST|LAST copy_and_return(CONDITIONAL) 28*3c3a7b76Schristos 29*3c3a7b76Schristos FIND|SEARCH|SORT|ERASE|KILL copy_and_return(VERB) 30*3c3a7b76Schristos ADD|REMOVE|DELETE|PRINT copy_and_return(VERB) 31*3c3a7b76Schristos 32*3c3a7b76Schristos QUICKLY|SLOWLY|CAREFULLY copy_and_return(ADVERB) 33*3c3a7b76Schristos 34*3c3a7b76Schristos IN|AT|ON|AROUND|INSIDE|ON copy_and_return(POSITIONAL) 35*3c3a7b76Schristos 36*3c3a7b76Schristos "." return(PERIOD); 37*3c3a7b76Schristos "\n" yylexlinenum++; return(NEWLINE); 38*3c3a7b76Schristos . 39*3c3a7b76Schristos %% 40*3c3a7b76Schristos 41