etc/services - sync with NetBSD-8
[minix.git] / external / bsd / flex / dist / examples / manual / front.lex
blob449cb007bcb2c84d3fe7cfb77476334f9854247e
1 %{
2 #include <stdio.h>
3 #include <string.h>
4 #include "y.tab.h"                 /* this comes from bison        */
6 #define TRUE  1
7 #define FALSE 0
9 #define copy_and_return(token_type) { strcpy(yylval.name,yytext); \
10                                       return(token_type); }
12 int             yylexlinenum = 0;  /* so we can count lines        */
16                             /* Lexical scanning rules begin from here.  */
18 MEN|WOMEN|STOCKS|TREES      copy_and_return(NOUN)
19 MISTAKES|GNUS|EMPLOYEES     copy_and_return(NOUN)
20 LOSERS|USERS|CARS|WINDOWS   copy_and_return(NOUN)
22 DATABASE|NETWORK|FSF|GNU    copy_and_return(PROPER_NOUN)
23 COMPANY|HOUSE|OFFICE|LPF    copy_and_return(PROPER_NOUN)
25 THE|THIS|THAT|THOSE         copy_and_return(DECLARATIVE)
27 ALL|FIRST|LAST              copy_and_return(CONDITIONAL)
29 FIND|SEARCH|SORT|ERASE|KILL copy_and_return(VERB)
30 ADD|REMOVE|DELETE|PRINT     copy_and_return(VERB)
32 QUICKLY|SLOWLY|CAREFULLY    copy_and_return(ADVERB)
34 IN|AT|ON|AROUND|INSIDE|ON   copy_and_return(POSITIONAL)
36 "."                         return(PERIOD);                             
37 "\n"                        yylexlinenum++; return(NEWLINE);            
38 .