//
// The LLVM Compiler Infrastructure
//
-// This file was developed by Reid Spencer and is distributed under the
-// University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
%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
-LINKER linker|Linker|LINKER
+LIBS libs|Libs|LIBS
+LINKER linker|Linker|LINKER
NAME name|Name|NAME
OPT1 opt1|Opt1|OPT1
OPT2 opt2|Opt2|OPT2
True true|True|TRUE|on|On|ON|yes|Yes|YES
False false|False|FALSE|off|Off|OFF|no|No|NO
-Bytecode bc|BC|bytecode|Bytecode|BYTECODE
+Bitcode bc|BC|bitcode|Bitcode|BITCODE
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;
}
+{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); }
%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); }
+{Bitcode} { return handleValueContext(BITCODE); }
{True} { return handleValueContext(TRUETOK); }
{False} { return handleValueContext(FALSETOK); }
--ConfigLexerState.StringVal.end());
return STRING;
}
-{Sep} { if (ConfigLexerState.in_value) { ConfigLexerState.StringVal = yytext;
- return OPTION; } }
-
+{BadSubst} { YY_FATAL_ERROR("Invalid substitution token"); }
%%