40 #ifndef YY_YY_LIB_VCSN_RAT_PARSE_HH_INCLUDED
41 # define YY_YY_LIB_VCSN_RAT_PARSE_HH_INCLUDED
43 #line 16 "lib/vcsn/rat/parse.yy" // lalr1.cc:372
82 #line 83 "./lib/vcsn/rat/parse.hh" // lalr1.cc:372
94 # define YYASSERT assert
99 # if (defined __GNUC__ \
100 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
101 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
102 # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
104 # define YY_ATTRIBUTE(Spec)
108 #ifndef YY_ATTRIBUTE_PURE
109 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
112 #ifndef YY_ATTRIBUTE_UNUSED
113 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
116 #if !defined _Noreturn \
117 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
118 # if defined _MSC_VER && 1200 <= _MSC_VER
119 # define _Noreturn __declspec (noreturn)
121 # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
126 #if ! defined lint || defined __GNUC__
127 # define YYUSE(E) ((void) (E))
132 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
134 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
135 _Pragma ("GCC diagnostic push") \
136 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
137 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
138 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
139 _Pragma ("GCC diagnostic pop")
141 # define YY_INITIAL_VALUE(Value) Value
143 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
144 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
145 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
147 #ifndef YY_INITIAL_VALUE
148 # define YY_INITIAL_VALUE(Value)
156 #line 11 "lib/vcsn/rat/parse.yy" // lalr1.cc:372
157 namespace vcsn {
namespace rat {
158 #line 159 "./lib/vcsn/rat/parse.hh" // lalr1.cc:372
178 template <
typename T>
182 new (yyas_<T> ()) T (t);
190 template <
typename T>
194 return *
new (yyas_<T> ()) T;
198 template <
typename T>
202 return *
new (yyas_<T> ()) T (t);
206 template <
typename T>
214 template <
typename T>
229 template <
typename T>
233 std::swap (as<T> (), other.
as<T> ());
239 template <
typename T>
249 template <
typename T>
253 build<T> (other.
as<T> ());
257 template <
typename T>
270 template <
typename T>
275 return static_cast<T*
> (yyp);
279 template <
typename T>
284 return static_cast<const T*
> (yyp);
325 char dummy6[
sizeof(std::vector<vcsn::dyn::expression>)];
339 syntax_error (
const location_type& l,
const std::string& m);
395 template <
typename Base>
409 basic_symbol (
typename Base::kind_type t,
const location_type& l);
419 basic_symbol (
typename Base::kind_type t,
const std::string
v,
const location_type& l);
421 basic_symbol (
typename Base::kind_type t,
const std::vector<vcsn::dyn::expression>
v,
const location_type& l);
426 const semantic_type&
v,
427 const location_type& l);
465 symbol_number_type
type_get ()
const;
468 token_type
token ()
const;
579 make_LETTER (
const std::string&
v,
const location_type& l);
583 make_WEIGHT (
const std::string&
v,
const location_type& l);
604 virtual int parse ();
623 virtual void error (
const location_type& loc,
const std::string& msg);
640 symbol_number_type yytoken)
const;
696 static std::string
yytnamerr_ (
const char *n);
716 template <
typename Base>
724 template <
typename Base>
748 symbol_number_type
type_get ()
const;
788 void yypush_ (
const char* m, state_type s, symbol_type& sym);
791 void yypop_ (
unsigned int n = 1);
817 const token_number_type
820 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
821 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
822 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
823 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
824 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
825 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
826 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
827 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
828 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
829 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
830 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
831 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
832 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
833 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
834 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
835 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
836 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
837 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
838 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
839 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
840 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
841 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
842 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
843 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
844 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
845 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
846 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
847 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
848 25, 26, 27, 28, 29, 30
850 const unsigned int user_token_number_max_ = 285;
851 const token_number_type undef_token_ = 2;
853 if (static_cast<int>(t) <=
yyeof_)
855 else if (static_cast<unsigned int> (t) <= user_token_number_max_)
856 return translate_table[t];
863 :
std::runtime_error (m)
868 template <
typename Base>
874 template <
typename Base>
881 switch (other.type_get ())
918 template <
typename Base>
926 switch (this->type_get ())
953 value.
copy< std::vector<vcsn::dyn::expression> > (
v);
964 template <
typename Base>
971 template <
typename Base>
978 template <
typename Base>
985 template <
typename Base>
992 template <
typename Base>
999 template <
typename Base>
1006 template <
typename Base>
1014 template <
typename Base>
1019 symbol_number_type yytype = this->type_get ();
1033 value.template destroy< braced_expression > ();
1037 value.template destroy< class_t > ();
1041 value.template destroy< dyn::weight > ();
1045 value.template destroy< irange_type > ();
1050 value.template destroy< std::string > ();
1054 value.template destroy< std::vector<vcsn::dyn::expression> > ();
1063 template <
typename Base>
1068 super_type::move(s);
1069 switch (this->type_get ())
1092 value.move< std::string > (s.
value);
1096 value.move< std::vector<vcsn::dyn::expression> > (s.
value);
1144 const unsigned short int
1147 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1148 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1149 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1152 return static_cast<token_type
> (yytoken_number_[
type]);
1330 #line 11 "lib/vcsn/rat/parse.yy" // lalr1.cc:372
1332 #line 1333 "./lib/vcsn/rat/parse.hh" // lalr1.cc:372
1336 #line 56 "lib/vcsn/rat/parse.yy" // lalr1.cc:372
1338 #define YY_DECL_(Class) \
1339 parser::symbol_type Class lex(driver& driver_)
1340 #define YY_DECL YY_DECL_(yyFlexLexer::)
1342 #line 1343 "./lib/vcsn/rat/parse.hh" // lalr1.cc:372
1345 #endif // !YY_YY_LIB_VCSN_RAT_PARSE_HH_INCLUDED
std::shared_ptr< const detail::weight_base > weight
char dummy3[sizeof(dyn::weight)]
int state_type
State numbers.
T & build()
Instantiate an empty T in here.
void move(by_state &that)
Steal the symbol type from that.
static symbol_type make_COMPLEMENT(const location_type &l)
static bool yy_pact_value_is_default_(int yyvalue)
Whether the given yypact_ value indicates a defaulted state.
bool lparen
Whether there was a left-paren.
static symbol_type make_DASH(const location_type &l)
basic_symbol< by_state > super_type
Superclass.
T * yyas_()
Accessor to raw memory as T.
token_number_type type
The symbol type.
stack_symbol_type & operator=(const stack_symbol_type &that)
Assignment, needed by push_back.
void yy_print_(std::ostream &yyo, const basic_symbol< Base > &yysym) const
Display a symbol type, value and location.
void set_debug_level(debug_level_type l)
Set the current debugging level.
token_type token() const
The token.
static symbol_type make_LPAREN(const location_type &l)
static symbol_type make_PIPE(const location_type &l)
T & as()
Accessor to a built T.
virtual void yystack_print_()
Print the state stack on the debug stream.
variant< S > self_type
Type of *this.
static const signed char yypact_ninf_
symbol_number_type type_get() const
The (internal) type number (corresponding to state).
static symbol_type make_CARET(const location_type &l)
void move(by_type &that)
Steal the symbol type from that.
static const unsigned short int yyrline_[]
virtual void error(const location_type &loc, const std::string &msg)
Report a syntax error.
virtual std::string yysyntax_error_(state_type yystate, symbol_number_type yytoken) const
Generate an error message.
union vcsn::rat::variant::@5 yybuffer_
static symbol_type make_PERCENT(const location_type &l)
const T * yyas_() const
Const accessor to raw memory as T.
dyn::expression exp
The expression parsed so far.
token_type kind_type
The symbol type as needed by the constructor.
virtual int parse()
Parse.
void yypop_(unsigned int n=1)
Pop n symbols the three stacks.
static symbol_type make_TRANSPOSITION(const location_type &l)
A char[S] buffer to store and retrieve objects.
static token_number_type yytranslate_(token_type t)
Convert a scanner token number t to a symbol number.
void swap(self_type &other)
Swap the content with other, of same type.
static symbol_type make_AMPERSAND(const location_type &l)
const T & as() const
Const accessor to a built T (for printer).
Termination state number.
semantic_type value
The semantic value.
static symbol_type make_DOT(const location_type &l)
variant()
Empty construction.
long double yyalign_me
Strongest alignment constraints.
static symbol_type make_ZERO(const location_type &l)
int debug_level_type
Type for debugging levels.
char yyraw[S]
A buffer large enough to store any of the semantic values.
int symbol_number_type
Internal symbol number.
syntax_error(const location_type &l, const std::string &m)
char dummy4[sizeof(irange_type)]
static bool yy_table_value_is_error_(int yyvalue)
Whether the given yytable_ value indicates a syntax error.
debug_level_type debug_level() const
The current debugging level.
static symbol_type make_AMPERSAND_COLON(const location_type &l)
unsigned char token_number_type
Internal symbol number for tokens (subsumed by symbol_number_type).
basic_symbol & operator=(const basic_symbol &other)
Assignment operator.
by_state()
Default constructor.
static symbol_type make_ONE(const location_type &l)
basic_symbol< by_type > symbol_type
"External" symbols: returned by the scanner.
Define the vcsn::rat::stack class.
state_type kind_type
The symbol type as needed by the constructor.
~variant()
Destruction, allowed only if empty.
char dummy6[sizeof(std::vector< vcsn::dyn::expression >)]
"Internal" symbol: element of the stack.
state_type yy_lr_goto_state_(state_type yystate, int yysym)
Compute post-reduction state.
braced_expression & operator=(dyn::expression e)
std::set< std::pair< std::string, std::string >> class_t
A set of label ranges.
stack< stack_symbol_type > stack_type
Stack type.
static symbol_type make_BACKSLASH(const location_type &l)
static symbol_type make_END(const location_type &l)
variant< sizeof(union_type)> semantic_type
Symbol semantic values.
void move(basic_symbol &s)
Destructive move, s is emptied into this.
void destroy()
Destroy the stored T.
State and public interface for rational expression parsing.
virtual void yy_reduce_print_(int r)
Report on the debug stream that the rule r is going to be reduced.
static const unsigned char yytable_[]
static symbol_type make_COLON(const location_type &l)
static const unsigned char yystos_[]
bool rparen
Whether there was a right-paren.
static const unsigned char yydefact_[]
self_type & operator=(const self_type &)
Prohibit blind copies.
static const signed char yydefgoto_[]
Define the vcsn::rat::location class.
symbol_number_type type_get() const
The (internal) type number (corresponding to type).
char dummy1[sizeof(braced_expression)]
static symbol_type make_RBRACKET(const location_type &l)
state_type state
The state.
static const short int yypact_[]
A char[S] buffer to store and retrieve objects.
Base super_type
Alias to Base.
static symbol_type make_LT_PLUS(const location_type &l)
Syntax errors thrown from user actions.
Number of nonterminal symbols.
by_type()
Default constructor.
stack_symbol_type()
Construct an empty symbol.
Provide a variadic mul on top of a binary mul(), and one().
static symbol_type make_CONCAT(const location_type &l)
variant(const T &t)
Construct and fill.
static const unsigned char yyr2_[]
std::string type(const automaton &a)
The implementation type of a.
static const signed char yytable_ninf_
static symbol_type make_BANG(const location_type &l)
void move(self_type &other)
Move the content of other to this.
static symbol_type make_RWEIGHT(const location_type &l)
static symbol_type make_SLASH(const location_type &l)
parser(driver &driver__yyarg)
Build a parser object.
static const signed char yycheck_[]
Type access provider for token (enum) based symbols.
T & build(const T &t)
Instantiate a T in here from t.
static symbol_type make_LBRACKET(const location_type &l)
Type access provider for state based symbols.
An auxiliary type to compute the largest semantic type.
void set_debug_stream(std::ostream &)
Set the current debugging stream.
std::tuple< int, int > irange_type
An integer range, for quantifiers/exponents.
stack_type yystack_
The stack.
static symbol_type make_LETTER(const std::string &v, const location_type &l)
void yypush_(const char *m, stack_symbol_type &s)
Push a new state on the stack.
basic_symbol()
Default constructor.
static symbol_type make_WEIGHT(const std::string &v, const location_type &l)
void destroy()
Destroy the stored T.
location location_type
Symbol locations.
std::shared_ptr< detail::expression_base > expression
An expression that "remembers" whether it was in parentheses.
static const unsigned char yyr1_[]
parser & operator=(const parser &)
static const signed char yypgoto_[]
static symbol_type make_PLUS(const location_type &l)
static symbol_type make_STAR(const irange_type &v, const location_type &l)
void yy_destroy_(const char *yymsg, basic_symbol< Base > &yysym) const
Reclaim the memory associated to a symbol.
location_type location
The location.
static symbol_type make_LWEIGHT(const location_type &l)
void copy(const self_type &other)
Copy the content of other to this.
T & as()
Accessor to a built T.
char dummy2[sizeof(class_t)]
static std::string yytnamerr_(const char *n)
Convert the symbol name n to a form suitable for a diagnostic.
std::ostream & debug_stream() const
The current debugging stream.
token::yytokentype token_type
(External) token type, as returned by yylex.
static symbol_type make_RPAREN(const location_type &l)
char dummy5[sizeof(std::string)]
static const char *const yytname_[]
For a symbol, its name in clear.
static symbol_type make_COMMA(const location_type &l)
#define YY_ATTRIBUTE_PURE