implement lexical analysis function for c-minus
This commit is contained in:
@@ -23,17 +23,17 @@
|
||||
#endif
|
||||
|
||||
/* MAXRESERVED = the number of reserved words */
|
||||
#define MAXRESERVED 8
|
||||
#define MAXRESERVED 6
|
||||
|
||||
typedef enum
|
||||
/* book-keeping tokens */
|
||||
{ENDFILE,ERROR,
|
||||
/* reserved words */
|
||||
IF,THEN,ELSE,END,REPEAT,UNTIL,READ,WRITE,
|
||||
IF,ELSE,WHILE,RETURN,INT,VOID,
|
||||
/* multicharacter tokens */
|
||||
ID,NUM,
|
||||
/* special symbols */
|
||||
ASSIGN,EQ,LT,PLUS,MINUS,TIMES,OVER,LPAREN,RPAREN,SEMI
|
||||
ASSIGN,EQ,NE,LT,LE,GT,GE,PLUS,MINUS,TIMES,OVER,LPAREN,RPAREN,LBRACE,RBRACE,LCURLY,RCURLY,SEMI,COMMA
|
||||
} TokenType;
|
||||
|
||||
extern FILE* source; /* source code text file */
|
||||
|
||||
Reference in New Issue
Block a user