diff options
Diffstat (limited to 'src/tpc.lex')
-rw-r--r-- | src/tpc.lex | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/tpc.lex b/src/tpc.lex index 5137d39..7a0d6b6 100644 --- a/src/tpc.lex +++ b/src/tpc.lex | |||
@@ -5,7 +5,8 @@ | |||
5 | */ | 5 | */ |
6 | 6 | ||
7 | #include "tpc.tab.h" | 7 | #include "tpc.tab.h" |
8 | 8 | #define INT 0 | |
9 | #define CHAR 1 | ||
9 | int lineno = 1; | 10 | int lineno = 1; |
10 | %} | 11 | %} |
11 | 12 | ||
@@ -22,8 +23,8 @@ int lineno = 1; | |||
22 | "+"|- { yylval.addsub=yytext[0]; return ADDSUB; } | 23 | "+"|- { yylval.addsub=yytext[0]; return ADDSUB; } |
23 | "<"|"<="|">"|">=" { strcpy(yylval.comp, yytext); return ORDER; } | 24 | "<"|"<="|">"|">=" { strcpy(yylval.comp, yytext); return ORDER; } |
24 | ==|!= { strcpy(yylval.comp, yytext); return EQ; } | 25 | ==|!= { strcpy(yylval.comp, yytext); return EQ; } |
25 | entier { strcpy(yylval.type, yytext); return TYPE; } | 26 | entier { yylval.type = INT; return TYPE; } |
26 | caractere { strcpy(yylval.type, yytext); return TYPE; } | 27 | caractere { yylval.type = CHAR; return TYPE; } |
27 | void { return VOID; } | 28 | void { return VOID; } |
28 | const { return CONST; } | 29 | const { return CONST; } |
29 | if { return IF; } | 30 | if { return IF; } |