%option never-interactive
%option batch
%option noyywrap
-%option nodefault
%option 8bit
%option outfile="ConfigLexer.cpp"
%option ecs
}
YY_FATAL_ERROR("Substitition tokens not allowed in names" );
return ERRORTOK;
-};
+}
inline llvm::ConfigLexerTokens handleValueContext(llvm::ConfigLexerTokens token) {
ConfigLexerState.StringVal = yytext;
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
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 \=
%%
-{White} { /* Ignore whitespace */ }
+{White} { if (ConfigLexerState.in_value) return SPACE; }
{Comment} { /* Ignore comments */
ConfigLexerState.in_value = false;
return EQUALS;
}
-{VERSION} { return handleNameContext(VERSION); }
+{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); }
{LINKER} { return handleNameContext(LINKER); }
%args% { return handleSubstitution(ARGS_SUBST); }
+%bindir% { return handleSubstitution(BINDIR_SUBST); }
%defs% { return handleSubstitution(DEFS_SUBST); }
-%force% { return handleSubstitution(FORCE_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); }
%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); }
--ConfigLexerState.StringVal.end());
return STRING;
}
-{Sep} { if (ConfigLexerState.in_value) { ConfigLexerState.StringVal = yytext;
- return OPTION; } }
-
+{BadSubst} { YY_FATAL_ERROR("Invalid substitution token"); }
%%