40 #ifndef YY_YY_USERS_AKIM_SRC_LRDE_2_LIB_VCSN_RAT_PARSE_HH_INCLUDED
41 # define YY_YY_USERS_AKIM_SRC_LRDE_2_LIB_VCSN_RAT_PARSE_HH_INCLUDED
43 #line 16 "/Users/akim/src/lrde/2/lib/vcsn/rat/parse.yy" // lalr1.cc:377
82 #line 83 "/Users/akim/src/lrde/2/lib/vcsn/rat/parse.hh" // lalr1.cc:377
95 # define YYASSERT assert
100 # if (defined __GNUC__ \
101 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
102 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
103 # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
105 # define YY_ATTRIBUTE(Spec)
109 #ifndef YY_ATTRIBUTE_PURE
110 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
113 #ifndef YY_ATTRIBUTE_UNUSED
114 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
117 #if !defined _Noreturn \
118 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
119 # if defined _MSC_VER && 1200 <= _MSC_VER
120 # define _Noreturn __declspec (noreturn)
122 # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
127 #if ! defined lint || defined __GNUC__
128 # define YYUSE(E) ((void) (E))
133 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
135 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
136 _Pragma ("GCC diagnostic push") \
137 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
138 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
139 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
140 _Pragma ("GCC diagnostic pop")
142 # define YY_INITIAL_VALUE(Value) Value
144 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
145 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
146 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
148 #ifndef YY_INITIAL_VALUE
149 # define YY_INITIAL_VALUE(Value)
157 #line 11 "/Users/akim/src/lrde/2/lib/vcsn/rat/parse.yy" // lalr1.cc:377
158 namespace vcsn {
namespace rat {
159 #line 160 "/Users/akim/src/lrde/2/lib/vcsn/rat/parse.hh" // lalr1.cc:377
179 template <
typename T>
183 new (yyas_<T> ()) T (t);
191 template <
typename T>
195 return *
new (yyas_<T> ()) T;
199 template <
typename T>
203 return *
new (yyas_<T> ()) T (t);
207 template <
typename T>
215 template <
typename T>
230 template <
typename T>
234 std::swap (as<T> (), other.
as<T> ());
240 template <
typename T>
250 template <
typename T>
254 build<T> (other.
as<T> ());
258 template <
typename T>
271 template <
typename T>
276 return static_cast<T*
> (yyp);
280 template <
typename T>
285 return static_cast<const T*
> (yyp);
326 char dummy6[
sizeof(std::vector<vcsn::dyn::expression>)];
340 syntax_error (
const location_type& l,
const std::string& m);
399 template <
typename Base>
413 basic_symbol (
typename Base::kind_type t,
const location_type& l);
423 basic_symbol (
typename Base::kind_type t,
const std::string
v,
const location_type& l);
425 basic_symbol (
typename Base::kind_type t,
const std::vector<vcsn::dyn::expression>
v,
const location_type& l);
430 const semantic_type&
v,
431 const location_type& l);
479 symbol_number_type
type_get ()
const;
482 token_type
token ()
const;
592 make_LETTER (
const std::string&
v,
const location_type& l);
596 make_WEIGHT (
const std::string&
v,
const location_type& l);
617 virtual int parse ();
636 virtual void error (
const location_type& loc,
const std::string& msg);
653 const symbol_type& yyla)
const;
709 static std::string
yytnamerr_ (
const char *n);
729 template <
typename Base>
737 template <
typename Base>
764 symbol_number_type
type_get ()
const;
806 void yypush_ (
const char* m, state_type s, symbol_type& sym);
809 void yypop_ (
unsigned int n = 1);
834 const token_number_type
837 0, 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, 2, 2, 2, 2,
846 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
847 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
848 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
849 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
850 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
851 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
852 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
853 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
854 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
855 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
856 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
857 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
858 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
859 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
860 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
861 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
862 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
863 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
864 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
865 25, 26, 27, 28, 29, 30
867 const unsigned int user_token_number_max_ = 285;
868 const token_number_type undef_token_ = 2;
870 if (static_cast<int>(t) <=
yyeof_)
872 else if (static_cast<unsigned int> (t) <= user_token_number_max_)
873 return translate_table[t];
880 :
std::runtime_error (m)
885 template <
typename Base>
891 template <
typename Base>
898 switch (other.type_get ())
935 template <
typename Base>
943 switch (this->type_get ())
970 value.
copy< std::vector<vcsn::dyn::expression> > (
v);
981 template <
typename Base>
988 template <
typename Base>
995 template <
typename Base>
1002 template <
typename Base>
1009 template <
typename Base>
1016 template <
typename Base>
1023 template <
typename Base>
1031 template <
typename Base>
1038 template <
typename Base>
1044 symbol_number_type yytype = this->type_get ();
1060 value.template destroy< braced_expression > ();
1064 value.template destroy< class_t > ();
1068 value.template destroy< dyn::weight > ();
1072 value.template destroy< irange_type > ();
1077 value.template destroy< std::string > ();
1081 value.template destroy< std::vector<vcsn::dyn::expression> > ();
1091 template <
typename Base>
1099 template <
typename Base>
1104 super_type::move(s);
1105 switch (this->type_get ())
1128 value.move< std::string > (s.
value);
1132 value.move< std::vector<vcsn::dyn::expression> > (s.
value);
1187 const unsigned short int
1190 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1191 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1192 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1195 return static_cast<token_type
> (yytoken_number_[
type]);
1373 #line 11 "/Users/akim/src/lrde/2/lib/vcsn/rat/parse.yy" // lalr1.cc:377
1375 #line 1376 "/Users/akim/src/lrde/2/lib/vcsn/rat/parse.hh" // lalr1.cc:377
1379 #line 56 "/Users/akim/src/lrde/2/lib/vcsn/rat/parse.yy" // lalr1.cc:377
1381 #define YY_DECL_(Class) \
1382 parser::symbol_type Class lex(driver& driver_)
1383 #define YY_DECL YY_DECL_(yyFlexLexer::)
1385 #line 1386 "/Users/akim/src/lrde/2/lib/vcsn/rat/parse.hh" // lalr1.cc:377
1388 #endif // !YY_YY_USERS_AKIM_SRC_LRDE_2_LIB_VCSN_RAT_PARSE_HH_INCLUDED
static symbol_type make_LT_PLUS(const location_type &l)
variant()
Empty construction.
static bool yy_pact_value_is_default_(int yyvalue)
Whether the given yypact_ value indicates a defaulted state.
static symbol_type make_DASH(const location_type &l)
void move(by_state &that)
Steal the symbol type from that.
bool lparen
Whether there was a left-paren.
Provide a variadic mul on top of a binary mul(), and one().
Termination state number.
basic_symbol< by_state > super_type
Superclass.
static const signed char yypact_ninf_
static const unsigned char yystos_[]
variant< S > self_type
Type of *this.
void copy(const self_type &other)
Copy the content of other to this.
static symbol_type make_ONE(const location_type &l)
basic_symbol< by_type > symbol_type
"External" symbols: returned by the scanner.
char dummy3[sizeof(dyn::weight)]
void yy_print_(std::ostream &yyo, const basic_symbol< Base > &yysym) const
Display a symbol type, value and location.
token_type token() const
The token.
static symbol_type make_PERCENT(const location_type &l)
static symbol_type make_RWEIGHT(const location_type &l)
union vcsn::rat::variant::@5 yybuffer_
static symbol_type make_RBRACKET(const location_type &l)
Syntax errors thrown from user actions.
symbol_number_type type_get() const
The (internal) type number (corresponding to state).
static const short int yypact_[]
char dummy1[sizeof(braced_expression)]
static symbol_type make_TRANSPOSITION(const location_type &l)
void move(by_type &that)
Steal the symbol type from that.
Define the vcsn::rat::location class.
void set_debug_level(debug_level_type l)
Set the current debugging level.
~basic_symbol()
Destroy the symbol.
dyn::expression exp
The expression parsed so far.
std::tuple< int, int > irange_type
An integer range, for quantifiers/exponents.
token_type kind_type
The symbol type as needed by the constructor.
void yypop_(unsigned int n=1)
Pop n symbols the three stacks.
static const unsigned char yyr2_[]
static symbol_type make_CARET(const location_type &l)
static const signed char yycheck_[]
virtual int parse()
Parse.
static symbol_type make_LBRACKET(const location_type &l)
static symbol_type make_PLUS(const location_type &l)
static const signed char yytable_ninf_
static symbol_type make_STAR(const irange_type &v, const location_type &l)
virtual void yy_reduce_print_(int r)
Report on the debug stream that the rule r is going to be reduced.
State and public interface for rational expression parsing.
void set_debug_stream(std::ostream &)
Set the current debugging stream.
void clear()
Record that this symbol is empty.
static symbol_type make_AMPERSAND(const location_type &l)
char dummy4[sizeof(irange_type)]
semantic_type value
The semantic value.
void clear()
Record that this symbol is empty.
int debug_level_type
Type for debugging levels.
std::string type(const automaton &a)
The implementation type of a.
static symbol_type make_COMMA(const location_type &l)
T & build()
Instantiate an empty T in here.
static symbol_type make_DOT(const location_type &l)
static symbol_type make_BANG(const location_type &l)
void destroy()
Destroy the stored T.
int state_type
State numbers.
stack_symbol_type()
Construct an empty symbol.
T * yyas_()
Accessor to raw memory as T.
int symbol_number_type
Symbol type: an internal symbol number.
static const unsigned char yyr1_[]
void move(self_type &other)
Move the content of other to this.
char dummy2[sizeof(class_t)]
stack_type yystack_
The stack.
char dummy5[sizeof(std::string)]
static symbol_type make_END(const location_type &l)
basic_symbol & operator=(const basic_symbol &other)
Assignment operator.
static bool yy_table_value_is_error_(int yyvalue)
Whether the given yytable_ value indicates a syntax error.
by_state()
Default constructor.
const T & as() const
Const accessor to a built T (for printer).
char yyraw[S]
A buffer large enough to store any of the semantic values.
static symbol_type make_WEIGHT(const std::string &v, const location_type &l)
state_type kind_type
The symbol type as needed by the constructor.
self_type & operator=(const self_type &)
Prohibit blind copies.
braced_expression & operator=(dyn::expression e)
long double yyalign_me
Strongest alignment constraints.
unsigned char token_number_type
Internal symbol number for tokens (subsumed by symbol_number_type).
void move(basic_symbol &s)
Destructive move, s is emptied into this.
void swap(self_type &other)
Swap the content with other, of same type.
static symbol_type make_LWEIGHT(const location_type &l)
bool rparen
Whether there was a right-paren.
virtual void error(const location_type &loc, const std::string &msg)
Report a syntax error.
static std::string yytnamerr_(const char *n)
Convert the symbol name n to a form suitable for a diagnostic.
stack< stack_symbol_type > stack_type
Stack type.
token::yytokentype token_type
(External) token type, as returned by yylex.
variant< sizeof(union_type)> semantic_type
Symbol semantic values.
symbol_number_type type_get() const
The (internal) type number (corresponding to type).
static const char *const yytname_[]
For a symbol, its name in clear.
state_type state
The state.
static symbol_type make_COLON(const location_type &l)
An auxiliary type to compute the largest semantic type.
std::shared_ptr< const detail::weight_base > weight
Base super_type
Alias to Base.
static symbol_type make_LPAREN(const location_type &l)
static symbol_type make_PIPE(const location_type &l)
static symbol_type make_COMPLEMENT(const location_type &l)
by_type()
Default constructor.
std::set< std::pair< std::string, std::string >> class_t
A set of label ranges.
static symbol_type make_CONCAT(const location_type &l)
T & as()
Accessor to a built T.
static const unsigned short int yyrline_[]
virtual void yystack_print_()
Print the state stack on the debug stream.
T & build(const T &t)
Instantiate a T in here from t.
~variant()
Destruction, allowed only if empty.
static symbol_type make_LETTER(const std::string &v, const location_type &l)
A char[S] buffer to store and retrieve objects.
Define the vcsn::rat::stack class.
#define YY_ATTRIBUTE_PURE
Type access provider for token (enum) based symbols.
Number of nonterminal symbols.
Type access provider for state based symbols.
void yypush_(const char *m, stack_symbol_type &s)
Push a new state on the stack.
parser & operator=(const parser &)
void destroy()
Destroy the stored T.
stack_symbol_type & operator=(const stack_symbol_type &that)
Assignment, needed by push_back.
static token_number_type yytranslate_(token_type t)
Convert a scanner token number t to a symbol number.
static symbol_type make_SLASH(const location_type &l)
parser(driver &driver__yyarg)
Build a parser object.
basic_symbol()
Default constructor.
static const signed char yypgoto_[]
An expression that "remembers" whether it was in parentheses.
bool empty() const
Whether empty.
syntax_error(const location_type &l, const std::string &m)
location location_type
Symbol locations.
void yy_destroy_(const char *yymsg, basic_symbol< Base > &yysym) const
Reclaim the memory associated to a symbol.
state_type yy_lr_goto_state_(state_type yystate, int yysym)
Compute post-reduction state.
T & as()
Accessor to a built T.
static symbol_type make_BACKSLASH(const location_type &l)
static symbol_type make_ZERO(const location_type &l)
location_type location
The location.
static const unsigned char yytable_[]
"Internal" symbol: element of the stack.
variant(const T &t)
Construct and fill.
static const unsigned char yydefact_[]
std::shared_ptr< detail::expression_base > expression
debug_level_type debug_level() const
The current debugging level.
static const signed char yydefgoto_[]
char dummy6[sizeof(std::vector< vcsn::dyn::expression >)]
const T * yyas_() const
Const accessor to raw memory as T.
virtual std::string yysyntax_error_(state_type yystate, const symbol_type &yyla) const
Generate an error message.
A char[S] buffer to store and retrieve objects.
static symbol_type make_AMPERSAND_COLON(const location_type &l)
void clear()
Destroy contents, and record that is empty.
std::ostream & debug_stream() const
The current debugging stream.
static symbol_type make_RPAREN(const location_type &l)