lex.h (317B)
1 #include <stdlib.h> 2 #include <string.h> 3 #include <ctype.h> 4 5 struct Pos { 6 int row, col; 7 }; 8 9 struct Token { 10 struct Pos pos; 11 short type; 12 void *data; 13 void *dataend; 14 }; 15 16 struct Lexer { 17 struct Pos pos; 18 char *input; 19 struct Token (*f)(); 20 }; 21 22 extern struct Lexer lex; 23 extern struct Token lasttok; 24 25 extern int yylex();