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>)];
335 typedef YYSTYPE semantic_type;
343 syntax_error (
const location_type& l,
const std::string& m);
354 AMPERSAND_COLON = 259,
393 enum { empty_symbol = -2 };
404 template <
typename Base>
418 basic_symbol (
typename Base::kind_type t,
const location_type& l);
428 basic_symbol (
typename Base::kind_type t,
const std::string
v,
const location_type& l);
430 basic_symbol (
typename Base::kind_type t,
const std::vector<vcsn::dyn::expression>
v,
const location_type& l);
437 const semantic_type&
v,
438 const location_type& l);
486 symbol_number_type type_get ()
const;
489 token_type
token ()
const;
503 make_END (
const location_type& l);
507 make_AMPERSAND (
const location_type& l);
511 make_AMPERSAND_COLON (
const location_type& l);
515 make_AT (
const location_type& l);
519 make_BACKSLASH (
const location_type& l);
523 make_BANG (
const location_type& l);
527 make_CARET (
const location_type& l);
531 make_COLON (
const location_type& l);
535 make_COMMA (
const location_type& l);
539 make_COMPLEMENT (
const location_type& l);
543 make_DASH (
const location_type& l);
547 make_DOT (
const location_type& l);
551 make_LBRACKET (
const location_type& l);
555 make_LT_PLUS (
const location_type& l);
559 make_ONE (
const location_type& l);
563 make_PERCENT (
const location_type& l);
567 make_PIPE (
const location_type& l);
571 make_PLUS (
const location_type& l);
575 make_RBRACKET (
const location_type& l);
579 make_RPAREN (
const location_type& l);
583 make_SLASH (
const location_type& l);
587 make_TRANSPOSITION (
const location_type& l);
591 make_TRANSPOSE (
const location_type& l);
595 make_ZERO (
const location_type& l);
599 make_STAR (
const irange_type&
v,
const location_type& l);
603 make_LETTER (
const std::string&
v,
const location_type& l);
607 make_WEIGHT (
const std::string&
v,
const location_type& l);
611 make_LPAREN (
const symbol&
v,
const location_type& l);
615 make_CONCAT (
const location_type& l);
619 make_RWEIGHT (
const location_type& l);
623 make_LWEIGHT (
const location_type& l);
632 virtual int parse ();
638 void set_debug_stream (
std::ostream &);
645 void set_debug_level (debug_level_type l);
651 virtual void error (
const location_type& loc,
const std::string& msg);
667 virtual std::string yysyntax_error_ (state_type yystate,
668 const symbol_type& yyla)
const;
673 state_type yy_lr_goto_state_ (state_type yystate,
int yysym);
677 static bool yy_pact_value_is_default_ (
int yyvalue);
681 static bool yy_table_value_is_error_ (
int yyvalue);
687 static token_number_type yytranslate_ (token_type t);
692 static const short int yypact_[];
697 static const unsigned char yydefact_[];
700 static const signed char yypgoto_[];
703 static const signed char yydefgoto_[];
708 static const unsigned char yytable_[];
710 static const signed char yycheck_[];
714 static const unsigned char yystos_[];
717 static const unsigned char yyr1_[];
720 static const unsigned char yyr2_[];
724 static std::string yytnamerr_ (
const char *n);
728 static const char*
const yytname_[];
731 static const unsigned short int yyrline_[];
733 virtual void yy_reduce_print_ (
int r);
735 virtual void yystack_print_ ();
744 template <
typename Base>
752 template <
typename Base>
779 symbol_number_type type_get ()
const;
782 enum { empty_state = -1 };
821 void yypush_ (
const char* m, state_type s, symbol_type& sym);
824 void yypop_ (
unsigned int n = 1);
849 const token_number_type
852 0, 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, 2, 2, 2, 2,
873 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
874 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
875 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
876 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
877 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
878 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
879 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
880 25, 26, 27, 28, 29, 30, 31, 32
882 const unsigned int user_token_number_max_ = 287;
883 const token_number_type undef_token_ = 2;
885 if (static_cast<int>(t) <= yyeof_)
887 else if (static_cast<unsigned int> (t) <= user_token_number_max_)
888 return translate_table[t];
895 :
std::runtime_error (m)
900 template <
typename Base>
906 template <
typename Base>
913 switch (other.type_get ())
936 value.copy< std::string > (other.
value);
940 value.copy< std::vector<vcsn::dyn::expression> > (other.
value);
954 template <
typename Base>
962 switch (this->type_get ())
985 value.copy< std::string > (
v);
989 value.copy< std::vector<vcsn::dyn::expression> > (
v);
1004 template <
typename Base>
1011 template <
typename Base>
1018 template <
typename Base>
1025 template <
typename Base>
1032 template <
typename Base>
1039 template <
typename Base>
1046 template <
typename Base>
1053 template <
typename Base>
1061 template <
typename Base>
1068 template <
typename Base>
1074 symbol_number_type yytype = this->type_get ();
1090 value.template destroy< braced_expression > ();
1094 value.template destroy< class_t > ();
1098 value.template destroy< dyn::weight > ();
1102 value.template destroy< irange_type > ();
1107 value.template destroy< std::string > ();
1111 value.template destroy< std::vector<vcsn::dyn::expression> > ();
1115 value.template destroy< symbol > ();
1125 template <
typename Base>
1130 return Base::type_get () == empty_symbol;
1133 template <
typename Base>
1138 super_type::move(s);
1139 switch (this->type_get ())
1162 value.move< std::string > (s.
value);
1166 value.move< std::vector<vcsn::dyn::expression> > (s.
value);
1182 parser::by_type::by_type ()
1183 :
type (empty_symbol)
1225 const unsigned short int 1228 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1229 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1230 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1233 return static_cast<token_type
> (yytoken_number_[
type]);
1423 #line 11 "/Users/akim/src/lrde/2/lib/vcsn/rat/parse.yy" // lalr1.cc:377 1425 #line 1426 "/Users/akim/src/lrde/2/lib/vcsn/rat/parse.hh" // lalr1.cc:377 1429 #line 56 "/Users/akim/src/lrde/2/lib/vcsn/rat/parse.yy" // lalr1.cc:377 1431 #define YY_DECL_(Class) \ 1432 parser::symbol_type Class lex(driver& driver_) 1433 #define YY_DECL YY_DECL_(yyFlexLexer::) 1435 #line 1436 "/Users/akim/src/lrde/2/lib/vcsn/rat/parse.hh" // lalr1.cc:377 1438 #endif // !YY_YY_USERS_AKIM_SRC_LRDE_2_LIB_VCSN_RAT_PARSE_HH_INCLUDED void copy(const self_type &other)
Copy the content of other to this.
token::yytokentype token_type
(External) token type, as returned by yylex.
Base super_type
Alias to Base.
T & as()
Accessor to a built T.
location_type location
The location.
const T * yyas_() const
Const accessor to raw memory as T.
void destroy()
Destroy the stored T.
static symbol_type make_PERCENT(const location_type &l)
unsigned char token_number_type
Internal symbol number for tokens (subsumed by symbol_number_type).
static symbol_type make_PLUS(const location_type &l)
static symbol_type make_RBRACKET(const location_type &l)
static token_number_type yytranslate_(token_type t)
Convert a scanner token number t to a symbol number.
braced_expression & operator=(dyn::expression e)
dyn::expression exp
The expression parsed so far.
Type access provider for state based symbols.
static symbol_type make_END(const location_type &l)
state_type state
The state.
long double yyalign_me
Strongest alignment constraints.
static symbol_type make_LPAREN(const symbol &v, const location_type &l)
T & as()
Accessor to a built T.
int state_type
State numbers.
~variant()
Destruction, allowed only if empty.
basic_symbol()
Default constructor.
semantic_type value
The semantic value.
static symbol_type make_COMPLEMENT(const location_type &l)
static symbol_type make_CONCAT(const location_type &l)
static symbol_type make_DASH(const location_type &l)
void move(self_type &other)
Move the content of other to this.
static symbol_type make_AT(const location_type &l)
token_type kind_type
The symbol type as needed by the constructor.
boost::flyweight< std::string, boost::flyweights::no_tracking, boost::flyweights::intermodule_holder > symbol
An internalized string.
variant(const T &t)
Construct and fill.
syntax_error(const location_type &l, const std::string &m)
static symbol_type make_AMPERSAND_COLON(const location_type &l)
static symbol_type make_DOT(const location_type &l)
static symbol_type make_PIPE(const location_type &l)
static symbol_type make_COLON(const location_type &l)
Provide a variadic mul on top of a binary mul(), and one().
static symbol_type make_AMPERSAND(const location_type &l)
T & build()
Instantiate an empty T in here.
State and public interface for rational expression parsing.
Type access provider for token (enum) based symbols.
variant< sizeof(union_type)> semantic_type
Symbol semantic values.
An auxiliary type to compute the largest semantic type.
A char[S] buffer to store and retrieve objects.
"Internal" symbol: element of the stack.
#define YY_ATTRIBUTE_PURE
static symbol_type make_SLASH(const location_type &l)
void clear()
Record that this symbol is empty.
static symbol_type make_STAR(const irange_type &v, const location_type &l)
void swap(self_type &other)
Swap the content with other, of same type.
static symbol_type make_CARET(const location_type &l)
static symbol_type make_RWEIGHT(const location_type &l)
static symbol_type make_WEIGHT(const std::string &v, const location_type &l)
static symbol_type make_ZERO(const location_type &l)
Define the vcsn::rat::stack class.
by_type()
Default constructor.
static symbol_type make_BANG(const location_type &l)
static symbol_type make_RPAREN(const location_type &l)
static symbol_type make_ONE(const location_type &l)
static const signed char yypact_ninf_
const T & as() const
Const accessor to a built T (for printer).
static symbol_type make_TRANSPOSE(const location_type &l)
A char[S] buffer to store and retrieve objects.
static symbol_type make_LBRACKET(const location_type &l)
void swap(config::value &first, config::value &second)
void move(by_type &that)
Steal the symbol type from that.
T * yyas_()
Accessor to raw memory as T.
stack< stack_symbol_type > stack_type
Stack type.
basic_symbol< by_state > super_type
Superclass.
static symbol_type make_TRANSPOSITION(const location_type &l)
static symbol_type make_LETTER(const std::string &v, const location_type &l)
static symbol_type make_LWEIGHT(const location_type &l)
value_impl< detail::expression_tag > expression
static symbol_type make_BACKSLASH(const location_type &l)
bool lparen
Whether there was a left-paren.
bool rparen
Whether there was a right-paren.
static symbol_type make_COMMA(const location_type &l)
variant< S > self_type
Type of *this.
basic_symbol< by_type > symbol_type
"External" symbols: returned by the scanner.
An expression that "remembers" whether it was in parentheses.
int symbol_number_type
Symbol type: an internal symbol number.
T & build(const T &t)
Instantiate a T in here from t.
static int debug_level()
Debug level set in the user's environment.
int debug_level_type
Type for debugging levels.
static symbol_type make_LT_PLUS(const location_type &l)
void destroy()
Destroy the stored T.
static const signed char yytable_ninf_
token_type token() const
The token.
value_impl< detail::weight_tag > weight
state_type kind_type
The symbol type as needed by the constructor.
Syntax errors thrown from user actions.
stack_type yystack_
The stack.
std::set< std::pair< std::string, std::string > > class_t
A set of label ranges.
std::tuple< int, int > irange_type
An integer range, for quantifiers/exponents.
variant()
Empty construction.
void copy(const self_type &other)
Copy the content of other to this.
symbol_number_type type_get() const
The (internal) type number (corresponding to type).