diff options
author | Carl Worth <cworth@cworth.org> | 2010-05-26 09:32:12 -0700 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2010-05-26 09:32:12 -0700 |
commit | 8fed1cddae8b024972d0c08f120bfd0292cb9cca (patch) | |
tree | f4e4fdca40c20c3aa78bad3d3913c8bd4806b264 /glcpp-lex.l | |
parent | ad0dee6bb0f197b9addb45f38e8843d6a504723c (diff) |
stash
Diffstat (limited to 'glcpp-lex.l')
-rw-r--r-- | glcpp-lex.l | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/glcpp-lex.l b/glcpp-lex.l index 516f42d..97f01d0 100644 --- a/glcpp-lex.l +++ b/glcpp-lex.l @@ -62,11 +62,47 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]? return HASH_UNDEF; } +{HASH}if { + yyextra->space_tokens = 0; + return HASH_IF; +} + +{HASH}elif { + yyextra->space_tokens = 0; + return HASH_ELIF; +} + +{HASH}else { + yyextra->space_tokens = 0; + return HASH_ELSE; +} + +{HASH}endif { + yyextra->space_tokens = 0; + return HASH_ENDIF; +} + {HASH} { yyextra->space_tokens = 0; return HASH; } +{DECIMAL_INTEGER} { + yylval.ival = strtoll (yytext, NULL, 10); + return INTEGER; +} + +{OCTAL_INTEGER} { + yylval.ival = strtoll (yytext + 1, NULL, 8); + return INTEGER; +} + +{HEXADECIMAL_INTEGER} { + yylval.ival = strtoll (yytext + 2, NULL, 16); + return INTEGER; +} + + {IDENTIFIER} { yylval.str = xtalloc_strdup (yyextra, yytext); return IDENTIFIER; @@ -108,6 +144,10 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]? return PASTE; } +"defined" { + return DEFINED; +} + {PUNCTUATION} { return yytext[0]; } |