aboutsummaryrefslogtreecommitdiff
path: root/cibic.l
diff options
context:
space:
mode:
authorTeddy <ted.sybil@gmail.com>2014-04-12 22:24:35 +0800
committerTeddy <ted.sybil@gmail.com>2014-04-12 22:24:35 +0800
commitbbce3104de593c90b10778a379728f982bc3fdcb (patch)
treea7dc481f72b14dc454c60b3384d1ba11b3fdefc8 /cibic.l
parent85d862310c2e00361f68c317c6256b29f18eae36 (diff)
typedef now works
Diffstat (limited to 'cibic.l')
-rw-r--r--cibic.l4
1 files changed, 3 insertions, 1 deletions
diff --git a/cibic.l b/cibic.l
index e6e449b..e597729 100644
--- a/cibic.l
+++ b/cibic.l
@@ -1,5 +1,6 @@
%{
#include "cibic.tab.h"
+#include "semantics.h"
#define MAX_LINEBUFF 1024
int yycolumn = 1;
char linebuff[MAX_LINEBUFF], *lptr = linebuff;
@@ -69,10 +70,11 @@ char ([^\n'\\]|\\.|\\[0-7]+|\\[xX][0-9a-fA-F]+)
"break" { return KW_BREAK; }
"return" { return KW_RET; }
"sizeof" { return KW_SIZEOF; }
+"typedef" { return KW_TYPEDEF; }
{letter}({letter}|{digit})* {
yylval.strval = strdup(yytext);
- return IDENTIFIER;
+ return is_identifier(yytext) ? IDENTIFIER : USER_TYPE;
}
({digit}+)|(0[xX][0-9a-fA-F]+) {