From 806dd4ff649a1fb9a28dc469cc17d7dd5dbc1da5 Mon Sep 17 00:00:00 2001 From: pacien Date: Fri, 23 Feb 2018 01:11:34 +0100 Subject: Adapt for new grammar --- src/tpc.lex | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/tpc.lex') 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; [ \t\r]+ ; \n { lineno++; } "/*" { BEGIN COMMENT; } -&& { return AND; } +"&&" { return AND; } "||" { return OR; } "*"|"/"|% { return DIVSTAR; } "+"|- { return ADDSUB; } -"<"|"<="|">"|>= { return ORDER; } +"<"|"<="|">"|">=" { return ORDER; } ==|!= { return EQ; } int { return TYPE; } -float { return TYPE; } -double { return TYPE; } char { return TYPE; } void { return VOID; } const { return CONST; } @@ -32,6 +30,9 @@ if { return IF; } else { return ELSE; } while { return WHILE; } return { return RETURN; } +print { return PRINT; } +readc { return READC; } +reade { return READE; } [a-zA-Z_][a-zA-Z0-9_]* { return IDENT; } [0-9]+ { return NUM; } '\\?.' { return CARACTERE; } -- cgit v1.2.3