aboutsummaryrefslogtreecommitdiff
path: root/src/tpc.lex
diff options
context:
space:
mode:
authorpacien2018-02-23 01:11:34 +0100
committerpacien2018-02-23 01:11:34 +0100
commit806dd4ff649a1fb9a28dc469cc17d7dd5dbc1da5 (patch)
treeda414ebbb1807a2dea82235faa429f6e6613db69 /src/tpc.lex
parent11acfa2e75350d31a665b8ee99925916c2c8b5f1 (diff)
downloadtpc-compiler-806dd4ff649a1fb9a28dc469cc17d7dd5dbc1da5.tar.gz
Adapt for new grammar
Diffstat (limited to 'src/tpc.lex')
-rw-r--r--src/tpc.lex9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/tpc.lex b/src/tpc.lex
index 63d4391..8b824c0 100644
--- a/src/tpc.lex
+++ b/src/tpc.lex
@@ -16,15 +16,13 @@ int lineno = 1;
16[ \t\r]+ ; 16[ \t\r]+ ;
17\n { lineno++; } 17\n { lineno++; }
18"/*" { BEGIN COMMENT; } 18"/*" { BEGIN COMMENT; }
19&& { return AND; } 19"&&" { return AND; }
20"||" { return OR; } 20"||" { return OR; }
21"*"|"/"|% { return DIVSTAR; } 21"*"|"/"|% { return DIVSTAR; }
22"+"|- { return ADDSUB; } 22"+"|- { return ADDSUB; }
23"<"|"<="|">"|>= { return ORDER; } 23"<"|"<="|">"|">=" { return ORDER; }
24==|!= { return EQ; } 24==|!= { return EQ; }
25int { return TYPE; } 25int { return TYPE; }
26float { return TYPE; }
27double { return TYPE; }
28char { return TYPE; } 26char { return TYPE; }
29void { return VOID; } 27void { return VOID; }
30const { return CONST; } 28const { return CONST; }
@@ -32,6 +30,9 @@ if { return IF; }
32else { return ELSE; } 30else { return ELSE; }
33while { return WHILE; } 31while { return WHILE; }
34return { return RETURN; } 32return { return RETURN; }
33print { return PRINT; }
34readc { return READC; }
35reade { return READE; }
35[a-zA-Z_][a-zA-Z0-9_]* { return IDENT; } 36[a-zA-Z_][a-zA-Z0-9_]* { return IDENT; }
36[0-9]+ { return NUM; } 37[0-9]+ { return NUM; }
37'\\?.' { return CARACTERE; } 38'\\?.' { return CARACTERE; }