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>
240 template <
typename T>
250 template <
typename T>
254 build<T> (other.
as<T> ());
258 template <
typename T>
271 template <
typename T>
275 void *yyp = yybuffer_.yyraw;
276 return static_cast<T*
> (yyp);
280 template <
typename T>
284 const void *yyp = yybuffer_.yyraw;
285 return static_cast<const T*
> (yyp);
323 char dummy5[
sizeof(std::string)];
326 char dummy6[
sizeof(std::vector<vcsn::dyn::expression>)];
332 typedef YYSTYPE semantic_type;
340 syntax_error (
const location_type& l,
const std::string& m);
351 AMPERSAND_COLON = 259,
390 enum { empty_symbol = -2 };
401 template <
typename Base>
415 basic_symbol (
typename Base::kind_type t,
const location_type& l);
425 basic_symbol (
typename Base::kind_type t,
const std::string
v,
const location_type& l);
427 basic_symbol (
typename Base::kind_type t,
const std::vector<vcsn::dyn::expression>
v,
const location_type& l);
432 const semantic_type&
v,
433 const location_type& l);
481 symbol_number_type type_get ()
const;
484 token_type
token ()
const;
498 make_END (
const location_type& l);
502 make_AMPERSAND (
const location_type& l);
506 make_AMPERSAND_COLON (
const location_type& l);
510 make_AT (
const location_type& l);
514 make_BACKSLASH (
const location_type& l);
518 make_BANG (
const location_type& l);
522 make_CARET (
const location_type& l);
526 make_COLON (
const location_type& l);
530 make_COMMA (
const location_type& l);
534 make_COMPLEMENT (
const location_type& l);
538 make_DASH (
const location_type& l);
542 make_DOT (
const location_type& l);
546 make_LBRACKET (
const location_type& l);
550 make_LPAREN (
const location_type& l);
554 make_LT_PLUS (
const location_type& l);
558 make_ONE (
const location_type& l);
562 make_PERCENT (
const location_type& l);
566 make_PIPE (
const location_type& l);
570 make_PLUS (
const location_type& l);
574 make_RBRACKET (
const location_type& l);
578 make_RPAREN (
const location_type& l);
582 make_SLASH (
const location_type& l);
586 make_TRANSPOSITION (
const location_type& l);
590 make_TRANSPOSE (
const location_type& l);
594 make_ZERO (
const location_type& l);
598 make_STAR (
const irange_type&
v,
const location_type& l);
602 make_LETTER (
const std::string&
v,
const location_type& l);
606 make_WEIGHT (
const std::string&
v,
const location_type& l);
610 make_CONCAT (
const location_type& l);
614 make_RWEIGHT (
const location_type& l);
618 make_LWEIGHT (
const location_type& l);
627 virtual int parse ();
633 void set_debug_stream (
std::ostream &);
640 void set_debug_level (debug_level_type l);
646 virtual void error (
const location_type& loc,
const std::string& msg);
662 virtual std::string yysyntax_error_ (state_type yystate,
663 const symbol_type& yyla)
const;
668 state_type yy_lr_goto_state_ (state_type yystate,
int yysym);
672 static bool yy_pact_value_is_default_ (
int yyvalue);
676 static bool yy_table_value_is_error_ (
int yyvalue);
682 static token_number_type yytranslate_ (token_type t);
687 static const short int yypact_[];
692 static const unsigned char yydefact_[];
695 static const signed char yypgoto_[];
698 static const signed char yydefgoto_[];
703 static const unsigned char yytable_[];
705 static const signed char yycheck_[];
709 static const unsigned char yystos_[];
712 static const unsigned char yyr1_[];
715 static const unsigned char yyr2_[];
719 static std::string yytnamerr_ (
const char *n);
723 static const char*
const yytname_[];
726 static const unsigned short int yyrline_[];
728 virtual void yy_reduce_print_ (
int r);
730 virtual void yystack_print_ ();
739 template <
typename Base>
747 template <
typename Base>
774 symbol_number_type type_get ()
const;
777 enum { empty_state = -1 };
816 void yypush_ (
const char* m, state_type s, symbol_type& sym);
819 void yypop_ (
unsigned int n = 1);
844 const token_number_type
847 0, 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, 2, 2, 2, 2,
863 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
864 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
865 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
866 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
867 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
868 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
869 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
870 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
871 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
872 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
873 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
874 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
875 25, 26, 27, 28, 29, 30, 31, 32
877 const unsigned int user_token_number_max_ = 287;
878 const token_number_type undef_token_ = 2;
880 if (static_cast<int>(t) <= yyeof_)
882 else if (static_cast<unsigned int> (t) <= user_token_number_max_)
883 return translate_table[t];
890 :
std::runtime_error (m)
895 template <
typename Base>
901 template <
typename Base>
908 switch (other.type_get ())
931 value.copy< std::string > (other.
value);
935 value.copy< std::vector<vcsn::dyn::expression> > (other.
value);
945 template <
typename Base>
953 switch (this->type_get ())
976 value.copy< std::string > (
v);
980 value.copy< std::vector<vcsn::dyn::expression> > (
v);
991 template <
typename Base>
998 template <
typename Base>
1005 template <
typename Base>
1012 template <
typename Base>
1019 template <
typename Base>
1026 template <
typename Base>
1033 template <
typename Base>
1041 template <
typename Base>
1048 template <
typename Base>
1054 symbol_number_type yytype = this->type_get ();
1070 value.template destroy< braced_expression > ();
1074 value.template destroy< class_t > ();
1078 value.template destroy< dyn::weight > ();
1082 value.template destroy< irange_type > ();
1087 value.template destroy< std::string > ();
1091 value.template destroy< std::vector<vcsn::dyn::expression> > ();
1101 template <
typename Base>
1106 return Base::type_get () == empty_symbol;
1109 template <
typename Base>
1114 super_type::move(s);
1115 switch (this->type_get ())
1138 value.move< std::string > (s.
value);
1142 value.move< std::vector<vcsn::dyn::expression> > (s.
value);
1154 parser::by_type::by_type ()
1155 :
type (empty_symbol)
1197 const unsigned short int 1200 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1201 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1202 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1205 return static_cast<token_type
> (yytoken_number_[
type]);
1395 #line 11 "/Users/akim/src/lrde/2/lib/vcsn/rat/parse.yy" // lalr1.cc:377 1397 #line 1398 "/Users/akim/src/lrde/2/lib/vcsn/rat/parse.hh" // lalr1.cc:377 1401 #line 56 "/Users/akim/src/lrde/2/lib/vcsn/rat/parse.yy" // lalr1.cc:377 1403 #define YY_DECL_(Class) \ 1404 parser::symbol_type Class lex(driver& driver_) 1405 #define YY_DECL YY_DECL_(yyFlexLexer::) 1407 #line 1408 "/Users/akim/src/lrde/2/lib/vcsn/rat/parse.hh" // lalr1.cc:377 1410 #endif // !YY_YY_USERS_AKIM_SRC_LRDE_2_LIB_VCSN_RAT_PARSE_HH_INCLUDED stack_type yystack_
The stack.
int debug_level_type
Type for debugging levels.
state_type state
The state.
static symbol_type make_PERCENT(const location_type &l)
static symbol_type make_LPAREN(const location_type &l)
static int debug_level()
Debug level set in the user's environment.
void move(by_type &that)
Steal the symbol type from that.
token_type token() const
The token.
static const signed char yytable_ninf_
static token_number_type yytranslate_(token_type t)
Convert a scanner token number t to a symbol number.
variant(const T &t)
Construct and fill.
basic_symbol< by_type > symbol_type
"External" symbols: returned by the scanner.
Base super_type
Alias to Base.
void swap(config::config_value &first, config::config_value &second)
semantic_type value
The semantic value.
void swap(self_type &other)
Swap the content with other, of same type.
unsigned char token_number_type
Internal symbol number for tokens (subsumed by symbol_number_type).
std::tuple< int, int > irange_type
An integer range, for quantifiers/exponents.
int state_type
State numbers.
T * yyas_()
Accessor to raw memory as T.
static symbol_type make_DOT(const location_type &l)
syntax_error(const location_type &l, const std::string &m)
void clear()
Record that this symbol is empty.
symbol_number_type type_get() const
The (internal) type number (corresponding to type).
value_impl< detail::expression_tag > expression
static symbol_type make_CONCAT(const location_type &l)
static symbol_type make_AMPERSAND_COLON(const location_type &l)
static symbol_type make_AT(const location_type &l)
An expression that "remembers" whether it was in parentheses.
const T & as() const
Const accessor to a built T (for printer).
static symbol_type make_PIPE(const location_type &l)
static symbol_type make_ZERO(const location_type &l)
static symbol_type make_DASH(const location_type &l)
braced_expression & operator=(dyn::expression e)
static symbol_type make_SLASH(const location_type &l)
Syntax errors thrown from user actions.
value_impl< detail::weight_tag > weight
void copy(const self_type &other)
Copy the content of other to this.
T & as()
Accessor to a built T.
static symbol_type make_COMPLEMENT(const location_type &l)
static symbol_type make_COLON(const location_type &l)
void copy(const self_type &other)
Copy the content of other to this.
static symbol_type make_AMPERSAND(const location_type &l)
variant< S > self_type
Type of *this.
T & as()
Accessor to a built T.
T & build(const T &t)
Instantiate a T in here from t.
static symbol_type make_RPAREN(const location_type &l)
#define YY_ATTRIBUTE_PURE
state_type kind_type
The symbol type as needed by the constructor.
variant< sizeof(union_type)> semantic_type
Symbol semantic values.
A char[S] buffer to store and retrieve objects.
static symbol_type make_STAR(const irange_type &v, const location_type &l)
"Internal" symbol: element of the stack.
static symbol_type make_ONE(const location_type &l)
variant()
Empty construction.
void destroy()
Destroy the stored T.
static symbol_type make_RWEIGHT(const location_type &l)
static symbol_type make_BACKSLASH(const location_type &l)
static symbol_type make_COMMA(const location_type &l)
by_type()
Default constructor.
int symbol_number_type
Symbol type: an internal symbol number.
void destroy()
Destroy the stored T.
void move(self_type &other)
Move the content of other to this.
Provide a variadic mul on top of a binary mul(), and one().
State and public interface for rational expression parsing.
static symbol_type make_TRANSPOSE(const location_type &l)
static const signed char yypact_ninf_
long double yyalign_me
Strongest alignment constraints.
Define the vcsn::rat::stack class.
static symbol_type make_BANG(const location_type &l)
bool lparen
Whether there was a left-paren.
token_type kind_type
The symbol type as needed by the constructor.
const T * yyas_() const
Const accessor to raw memory as T.
bool rparen
Whether there was a right-paren.
An auxiliary type to compute the largest semantic type.
A char[S] buffer to store and retrieve objects.
static symbol_type make_LBRACKET(const location_type &l)
stack< stack_symbol_type > stack_type
Stack type.
basic_symbol< by_state > super_type
Superclass.
Type access provider for state based symbols.
static symbol_type make_LT_PLUS(const location_type &l)
static symbol_type make_LWEIGHT(const location_type &l)
static symbol_type make_CARET(const location_type &l)
static symbol_type make_PLUS(const location_type &l)
basic_symbol()
Default constructor.
dyn::expression exp
The expression parsed so far.
static symbol_type make_WEIGHT(const std::string &v, const location_type &l)
static symbol_type make_RBRACKET(const location_type &l)
T & build()
Instantiate an empty T in here.
token::yytokentype token_type
(External) token type, as returned by yylex.
static symbol_type make_TRANSPOSITION(const location_type &l)
static symbol_type make_END(const location_type &l)
static symbol_type make_LETTER(const std::string &v, const location_type &l)
~variant()
Destruction, allowed only if empty.
Type access provider for token (enum) based symbols.
location_type location
The location.
std::set< std::pair< std::string, std::string > > class_t
A set of label ranges.