diff options
author | Teddy <ted.sybil@gmail.com> | 2014-03-24 22:10:49 +0800 |
---|---|---|
committer | Teddy <ted.sybil@gmail.com> | 2014-03-24 22:10:49 +0800 |
commit | 34c3611f364b3ea2955cbfac934b17900390364d (patch) | |
tree | d2379577f95f3956be3e492ed5e38b4bba68d2d6 /cibic.l | |
parent | f218a80d6ca8a69ba0b22cb87f99e8b82162bbee (diff) |
AST Construction: slightly modified
Diffstat (limited to 'cibic.l')
-rw-r--r-- | cibic.l | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -4,7 +4,7 @@ letter [a-zA-Z_$] digit [0-9] -%s IN_BLOCK_COMMENT IN_INLINE_COMMENT +%s IN_BLOCK_COMMENT IN_INLINE_COMMENT IN_DIRECTIVE %% <INITIAL>{ @@ -25,6 +25,14 @@ digit [0-9] [^\n]+ } +<INITIAL>{ +"#" BEGIN(IN_INLINE_COMMENT); +} +<IN_DIRECTIVE>{ +\n BEGIN(INITIAL); +[^\n]+ +} + "void" { return KW_VOID; } "char" { return KW_CHAR; } "int" { return KW_INT; } |