1 //===- ConfigLexer.h - ConfigLexer Declarations -----------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by Reid Spencer and is distributed under the
6 // University of Illinois Open Source License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file declares the types and data needed by ConfigLexer.l
12 //===------------------------------------------------------------------------===
13 #ifndef LLVM_TOOLS_LLVMC_CONFIGLEXER_H
14 #define LLVM_TOOLS_LLVMC_CONFIGLEXER_H
21 struct ConfigLexerInfo
24 std::string StringVal;
29 extern ConfigLexerInfo ConfigLexerState;
33 InputProvider(const std::string& nm) {
37 virtual ~InputProvider();
38 virtual unsigned read(char *buf, unsigned max_size) = 0;
39 virtual void error(const std::string& msg);
40 virtual void checkErrors();
47 extern InputProvider* ConfigLexerInput;
49 enum ConfigLexerTokens {
50 EOFTOK = 0, ///< Returned by Configlex when we hit end of file
51 EOLTOK, ///< End of line
52 ERRORTOK, ///< Error token
53 OPTION, ///< A command line option
54 SEPARATOR, ///< A configuration item separator
55 EQUALS, ///< The equals sign, =
56 TRUETOK, ///< A boolean true value (true/yes/on)
57 FALSETOK, ///< A boolean false value (false/no/off)
58 INTEGER, ///< An integer
59 STRING, ///< A quoted string
60 IN_SUBST, ///< The input substitution item @in@
61 OUT_SUBST, ///< The output substitution item @out@
62 STATS_SUBST, ///< The stats substitution item @stats@
63 TIME_SUBST, ///< The substitution item @time@
64 OPT_SUBST, ///< The substitution item @opt@
65 TARGET_SUBST, ///< The substitition item @target@
66 LANG, ///< The item "lang" (and case variants)
67 PREPROCESSOR, ///< The item "preprocessor" (and case variants)
68 TRANSLATOR, ///< The item "translator" (and case variants)
69 OPTIMIZER, ///< The item "optimizer" (and case variants)
70 ASSEMBLER, ///< The item "assembler" (and case variants)
71 LINKER, ///< The item "linker" (and case variants)
72 NAME, ///< The item "name" (and case variants)
73 REQUIRED, ///< The item "required" (and case variants)
74 COMMAND, ///< The item "command" (and case variants)
75 PREPROCESSES, ///< The item "preprocesses" (and case variants)
76 TRANSLATES, ///< The item "translates" (and case variants)
77 OPTIMIZES, ///< The item "optimizes" (and case variants)
78 GROKS_DASH_O, ///< The item "groks_dash_O" (and case variants)
79 OUTPUT_IS_ASM,///< The item "outut_is_asm" (and case variants)
80 OPT1, ///< The item "opt1" (and case variants)
81 OPT2, ///< The item "opt2" (and case variants)
82 OPT3, ///< The item "opt3" (and case variants)
83 OPT4, ///< The item "opt4" (and case variants)
84 OPT5, ///< The item "opt5" (and case variants)
85 VERSION, ///< The item "version" (and case variants)
88 extern ConfigLexerTokens Configlex();