Código C:
Ver original
#include<stdio.h> #include<ctype.h> char *progname; #define NUMBER 400 #define COMMENT 401 #define TEXT 402 #define COMMAND 403 main(argc,argv) int argc; char *argv[]; { int val; } lexer() { int c; ; if(c == EOF) return 0; return NUMBER; } if(c == '#') { /*comment */ return COMMENT; } if(c == '"') { /*literal text*/ c != '"' && c != '\n'); return TEXT; } return COMMAND; } return c; }