From 9c990ae801b949de2728bfff4258aa90f9c96a52 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 8 Apr 2015 23:49:42 +0200 Subject: Allow adding source blocks to the top the of header and source files --- src/parser_state.hpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/parser_state.hpp') diff --git a/src/parser_state.hpp b/src/parser_state.hpp index 882fec2..b183898 100644 --- a/src/parser_state.hpp +++ b/src/parser_state.hpp @@ -44,6 +44,9 @@ private: std::string current_var; std::string current_type; + std::string header_block; + std::string source_block; + public: parser_state_t() : current("") {} @@ -59,6 +62,22 @@ public: return term_types; } + const std::string & get_header_block() const { + return header_block; + } + + void set_header_block(const char *value) { + header_block = value; + } + + const std::string & get_source_block() const { + return source_block; + } + + void set_source_block(const char *value) { + source_block = value; + } + void new_rule(const char *nonterm); void add_rule_nonterminal(const char *nonterm); void add_rule_terminal(const char *term); -- cgit v1.2.3