X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=tools%2Fllvmc%2FConfigLexer.l;h=34b9a17de189037e5dd08050fd685b0981e0c394;hb=9ba8a76f8baaa1092d60ccfbc04e7efdc207c98f;hp=6633156eb334b68f1b259449b76bbfd25a627948;hpb=3a9b22234ff43c58315c1397d096f78229f85af1;p=oota-llvm.git diff --git a/tools/llvmc/ConfigLexer.l b/tools/llvmc/ConfigLexer.l index 6633156eb33..34b9a17de18 100644 --- a/tools/llvmc/ConfigLexer.l +++ b/tools/llvmc/ConfigLexer.l @@ -18,7 +18,6 @@ %option never-interactive %option batch %option noyywrap -%option nodefault %option 8bit %option outfile="ConfigLexer.cpp" %option ecs @@ -65,7 +64,7 @@ handleSubstitution(llvm::ConfigLexerTokens token) { } YY_FATAL_ERROR("Substitition tokens not allowed in names" ); return ERRORTOK; -}; +} inline llvm::ConfigLexerTokens handleValueContext(llvm::ConfigLexerTokens token) { ConfigLexerState.StringVal = yytext; @@ -79,6 +78,7 @@ inline llvm::ConfigLexerTokens handleValueContext(llvm::ConfigLexerTokens token) ASSEMBLER assembler|Assembler|ASSEMBLER COMMAND command|Command|COMMAND LANG lang|Lang|LANG +LIBS libs|Libs|LIBS LINKER linker|Linker|LINKER NAME name|Name|NAME OPT1 opt1|Opt1|OPT1 @@ -100,7 +100,7 @@ False false|False|FALSE|off|Off|OFF|no|No|NO Bytecode bc|BC|bytecode|Bytecode|BYTECODE Assembly asm|ASM|assembly|Assembly|ASSEMBLY -BadSubst \%[^iots][a-zA-Z]\% +BadSubst \%[a-zA-Z]*\% Comment \#[^\r\n]*\r?\n NewLine \r?\n Eq \= @@ -113,7 +113,7 @@ White [ \t]* %% -{White} { /* Ignore whitespace */ } +{White} { if (ConfigLexerState.in_value) return SPACE; } {Comment} { /* Ignore comments */ ConfigLexerState.in_value = false; @@ -134,9 +134,12 @@ White [ \t]* return EQUALS; } +{Sep} { return SEPARATOR; } + {VERSION} { return handleNameContext(VERSION_TOK); } {LANG} { return handleNameContext(LANG); } +{LIBS} { return handleNameContext(LIBS); } {NAME} { return handleNameContext(NAME); } {OPT1} { return handleNameContext(OPT1); } {OPT2} { return handleNameContext(OPT2); } @@ -160,10 +163,18 @@ White [ \t]* {LINKER} { return handleNameContext(LINKER); } %args% { return handleSubstitution(ARGS_SUBST); } +%bindir% { return handleSubstitution(BINDIR_SUBST); } %defs% { return handleSubstitution(DEFS_SUBST); } %in% { return handleSubstitution(IN_SUBST); } %incls% { return handleSubstitution(INCLS_SUBST); } +%libdir% { return handleSubstitution(LIBDIR_SUBST); } %libs% { return handleSubstitution(LIBS_SUBST); } +%llvmgccdir% { return handleSubstitution(LLVMGCCDIR_SUBST); } +%llvmgccarch% { return handleSubstitution(LLVMGCCARCH_SUBST); } +%llvmgcc% { return handleSubstitution(LLVMGCC_SUBST); } +%llvmgxx% { return handleSubstitution(LLVMGXX_SUBST); } +%llvmcc1% { return handleSubstitution(LLVMCC1_SUBST); } +%llvmcc1plus% { return handleSubstitution(LLVMCC1PLUS_SUBST); } %opt% { return handleSubstitution(OPT_SUBST); } %out% { return handleSubstitution(OUT_SUBST); } %stats% { return handleSubstitution(STATS_SUBST); } @@ -173,7 +184,6 @@ White [ \t]* %fOpts% { return handleSubstitution(FOPTS_SUBST); } %MOpts% { return handleSubstitution(MOPTS_SUBST); } %WOpts% { return handleSubstitution(WOPTS_SUBST); } -{BadSubst} { YY_FATAL_ERROR("Invalid substitution token"); } {Assembly} { return handleValueContext(ASSEMBLY); } {Bytecode} { return handleValueContext(BYTECODE); } @@ -186,8 +196,6 @@ White [ \t]* --ConfigLexerState.StringVal.end()); return STRING; } -{Sep} { if (ConfigLexerState.in_value) { ConfigLexerState.StringVal = yytext; - return OPTION; } } - +{BadSubst} { YY_FATAL_ERROR("Invalid substitution token"); } %%