18 #include <hilti/ast/all.h> 19 #include <hilti/base/preprocessor.h> 21 #include <spicy/ast/all.h> 22 #include <spicy/autogen/config.h> 26 spicy::detail::parser::Parser::token_type \ 27 spicy::detail::parser::Scanner::lex(spicy::detail::parser::Parser::semantic_type* yylval, \ 28 spicy::detail::parser::location* yylloc, \ 29 spicy::detail::parser::Driver* driver) 31 #define YYSTYPE yystype_spicy 33 #ifndef __FLEX_LEXER_H 34 #define yyFlexLexer SpicyFlexLexer 35 #include <FlexLexer.h> 49 hilti::Declaration declaration;
52 hilti::Expression expression;
53 hilti::Statement statement;
57 std::optional<hilti::Expression> opt_expression;
58 std::optional<hilti::Statement> opt_statement;
59 std::optional<hilti::AttributeSet> opt_attributes;
61 hilti::declaration::Linkage linkage;
62 hilti::declaration::parameter::Kind function_parameter_kind;
63 hilti::function::CallingConvention function_calling_convention;
66 hilti::type::function::Flavor function_flavor;
69 std::vector<std::string> strings;
70 std::vector<hilti::Declaration> declarations;
71 std::vector<hilti::Expression> expressions;
72 std::vector<hilti::Statement> statements;
73 std::vector<hilti::type::function::Parameter> function_parameters;
74 std::vector<hilti::statement::switch_::Case> switch_cases;
76 std::pair<hilti::ID, hilti::Type> tuple_type_elem;
77 std::vector<std::pair<hilti::ID, hilti::Type>> tuple_type_elems;
80 hilti::ctor::struct_::Field struct_elem;
81 std::vector<hilti::type::struct_::Field> struct_fields;
82 std::vector<hilti::ctor::struct_::Field> struct_elems;
84 hilti::ctor::Map::Element map_elem;
85 std::vector<hilti::ctor::Map::Element> map_elems;
88 std::vector<hilti::type::enum_::Label> enum_labels;
91 std::vector<spicy::type::bitfield::Bits> bitfield_bits;
93 std::pair<std::vector<hilti::Declaration>, std::vector<hilti::Statement>> decls_and_stmts;
96 std::optional<hilti::ID> opt_id;
97 std::vector<spicy::type::unit::Item> unit_items;
98 spicy::type::unit::Item unit_item;
100 std::vector<spicy::Hook> hooks;
104 std::vector<spicy::type::unit::item::switch_::Case> unit_switch_cases;
109 namespace logging::debug {
122 Driver() : _preprocessor(spicy::configuration().preprocessor_constants) {}
127 Scanner* scanner()
const {
return _scanner; }
128 Parser* parser()
const {
return _parser; }
132 std::string* currentFile() {
return &_filename; }
133 int currentLine() {
return _line; }
134 void error(
const std::string& msg,
const Meta& m);
135 void enablePatternMode();
136 void disablePatternMode();
137 void enableExpressionMode();
138 void disableExpressionMode();
139 void enableDottedIDMode();
140 void disableDottedIDMode();
141 void enableHookIDMode();
142 void disableHookIDMode();
143 void setDestinationModule(
Module m) { _module = std::move(m); }
144 void setDestinationExpression(Expression e) { _expression = std::move(e); }
146 void processPreprocessorLine(
const std::string_view& directive,
const std::string_view& expression,
const Meta& m);
150 Expression _expression;
151 std::string _filename;
153 Parser* _parser =
nullptr;
Definition: bitfield.h:25
Definition: function.h:47
Definition: function.h:44
Definition: preprocessor.h:22
Definition: attribute.h:26
Definition: parameter.h:45