37 #line 38 "evalexpr_parser.cpp"
45 #line 46 "evalexpr_parser.cpp"
48 #line 26 "evalexpr_parser.yy"
54 #line 55 "evalexpr_parser.cpp"
58 # if defined __cplusplus && 201103L <= __cplusplus
59 # define YY_NULL nullptr
66 # if defined YYENABLE_NLS && YYENABLE_NLS
69 # define YY_(msgid) dgettext("bison-runtime", msgid)
73 # define YY_(msgid) msgid
77 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
83 # ifndef YYLLOC_DEFAULT
84 # define YYLLOC_DEFAULT(Current, Rhs, N) \
88 (Current).begin = YYRHSLOC(Rhs, 1).begin; \
89 (Current).end = YYRHSLOC(Rhs, N).end; \
93 (Current).begin = (Current).end = YYRHSLOC(Rhs, 0).end; \
101 #define YYUSE(e) ((void)(e))
107 # define YYCDEBUG if (yydebug_) (*yycdebug_)
109 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
113 *yycdebug_ << Title << ' '; \
114 yy_symbol_print_((Type), (Value), (Location)); \
115 *yycdebug_ << std::endl; \
120 # define YY_REDUCE_PRINT(Rule) \
123 yy_reduce_print_(Rule); \
127 # define YY_STACK_PRINT() \
136 # define YYCDEBUG if (false) std::cerr
137 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) YYUSE(Type)
138 # define YY_REDUCE_PRINT(Rule) static_cast<void>(0)
139 # define YY_STACK_PRINT() static_cast<void>(0)
142 #define yyerrok (yyerrstatus_ = 0)
143 #define yyclearin (yychar = yyempty_)
145 #define YYACCEPT goto yyacceptlab
146 #define YYABORT goto yyabortlab
147 #define YYERROR goto yyerrorlab
148 #define YYRECOVERING() (!!yyerrstatus_)
151 #line 4 "evalexpr_parser.yy"
154 #line 151 "evalexpr_parser.cpp"
166 std::string yyr =
"";
167 char const *yyp = yystr;
174 goto do_not_strip_quotes;
178 goto do_not_strip_quotes;
189 do_not_strip_quotes:;
201 yycdebug_(&std::cerr),
225 std::ostream& yyoutput = yyo;
231 #line 40 "evalexpr_parser.yy"
233 yyoutput << ((*yyvaluep).sym);
236 #line 227 "evalexpr_parser.cpp"
241 #line 41 "evalexpr_parser.yy"
243 yyoutput << ((*yyvaluep).val);
246 #line 234 "evalexpr_parser.cpp"
251 #line 41 "evalexpr_parser.yy"
253 yyoutput << ((*yyvaluep).val);
256 #line 241 "evalexpr_parser.cpp"
271 << *yylocationp <<
": ";
294 #line 43 "evalexpr_parser.yy"
296 free(((*yyvaluep).sym));
299 #line 279 "evalexpr_parser.cpp"
376 int yyerrstatus_ = 0;
397 YYCDEBUG <<
"Starting parse" << std::endl;
413 YYCDEBUG <<
"Entering state " << yystate << std::endl;
439 yychar = yytoken =
yyeof_;
440 YYCDEBUG <<
"Now at end of input." << std::endl;
518 #line 49 "evalexpr_parser.yy"
526 #line 51 "evalexpr_parser.yy"
534 #line 52 "evalexpr_parser.yy"
543 #line 53 "evalexpr_parser.yy"
552 #line 54 "evalexpr_parser.yy"
560 #line 55 "evalexpr_parser.yy"
568 #line 56 "evalexpr_parser.yy"
576 #line 57 "evalexpr_parser.yy"
584 #line 58 "evalexpr_parser.yy"
592 #line 59 "evalexpr_parser.yy"
600 #line 60 "evalexpr_parser.yy"
608 #line 61 "evalexpr_parser.yy"
616 #line 562 "evalexpr_parser.cpp"
644 if ((0 <= yystate) && (yystate <=
yylast_) &&
645 (
yycheck_[yystate] == yystate_stack_[0]))
669 yyerror_range[1] = yylloc;
670 if (yyerrstatus_ == 3)
681 yydestruct_(
"Error: discarding", yytoken, &yylval, &yylloc);
708 yystate = yystate_stack_[0];
731 if (yystate_stack_.height() == 1)
739 yystate = yystate_stack_[0];
743 yyerror_range[2] = yylloc;
773 yydestruct_(
"Cleanup: discarding lookahead", yytoken, &yylval,
780 while (1 < yystate_stack_.height())
793 YYCDEBUG <<
"Exception caught: cleaning lookahead and stack"
831 YYERROR_VERBOSE_ARGS_MAXIMUM = 5
834 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
863 yyarg[yycount++] =
yytname_[yytoken];
870 int yyxbegin = yyn < 0 ? -yyn : 0;
872 int yychecklim =
yylast_ - yyn + 1;
874 for (
int yyx = yyxbegin; yyx < yyxend; ++yyx) {
878 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
889 char const *yyformat =
YY_NULL;
892 #define YYCASE_(N, S) \
897 YYCASE_(1,
YY_(
"syntax error, unexpected %s"));
898 YYCASE_(2,
YY_(
"syntax error, unexpected %s, expecting %s"));
899 YYCASE_(3,
YY_(
"syntax error, unexpected %s, expecting %s or %s"));
900 YYCASE_(4,
YY_(
"syntax error, unexpected %s, expecting %s or %s or %s"));
901 YYCASE_(5,
YY_(
"syntax error, unexpected %s, expecting %s or %s or %s or %s"));
907 for (
char const *yyp = yyformat; *yyp; ++yyp) {
908 if ((yyp[0] ==
'%') && (yyp[1] ==
's') && (yyi < yycount))
925 2, -10, -11, 2, 2, 2, 4, 28, 2, 8,
926 8, 10, -11, 2, 2, 2, 2, 2, 19, -11,
936 2, 5, 4, 0, 0, 0, 0, 3, 0, 12,
937 11, 0, 1, 0, 0, 0, 0, 0, 0, 14,
962 9, 10, 11, 8, 12, 18, 1, 2, 3, 4,
963 20, 21, 22, 23, 24, 5, 13, 14, 15, 16,
964 17, 0, 17, 0, 19, 13, 14, 15, 16, 0,
965 0, 17, 0, 25, 13, 14, 15, 16, 15, 16,
973 3, 4, 5, 13, 0, 8, 4, 5, 6, 7,
974 13, 14, 15, 16, 17, 13, 6, 7, 8, 9,
975 12, -1, 12, -1, 14, 6, 7, 8, 9, -1,
976 -1, 12, -1, 14, 6, 7, 8, 9, 8, 9,
985 0, 4, 5, 6, 7, 13, 16, 17, 13, 17,
986 17, 17, 0, 6, 7, 8, 9, 12, 17, 14,
987 17, 17, 17, 17, 17, 14
994 const unsigned short int
997 0, 256, 257, 258, 259, 260, 45, 43, 42, 47,
1006 0, 15, 16, 16, 17, 17, 17, 17, 17, 17,
1014 0, 2, 0, 1, 1, 1, 4, 3, 3, 3,
1024 "$end",
"error",
"$undefined",
"EOL",
"IDENTIFIER",
"NUMBER",
"'-'",
1025 "'+'",
"'*'",
"'/'",
"NEG",
"PLS",
"'^'",
"'('",
"')'",
"$accept",
1034 16, 0, -1, -1, 17, -1, 5, -1, 4, -1,
1035 4, 13, 17, 14, -1, 17, 7, 17, -1, 17,
1036 6, 17, -1, 17, 8, 17, -1, 17, 9, 17,
1037 -1, 7, 17, -1, 6, 17, -1, 17, 12, 17,
1046 0, 0, 3, 4, 6, 8, 10, 15, 19, 23,
1054 0, 48, 48, 49, 51, 52, 53, 54, 55, 56,
1075 unsigned int yylno =
yyrline_[yyrule];
1076 int yynrhs =
yyr2_[yyrule];
1079 *
yycdebug_ <<
"Reducing stack by rule " << yyrule - 1
1080 <<
" (line " << yylno <<
"):" << std::endl;
1082 for (
int yyi = 0; yyi < yynrhs; yyi++) {
1101 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1102 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1103 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1104 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1105 13, 14, 8, 7, 2, 6, 2, 9, 2, 2,
1106 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1107 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1108 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1109 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1110 2, 2, 2, 2, 12, 2, 2, 2, 2, 2,
1111 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1112 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1113 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1114 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1115 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1116 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1117 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1118 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1119 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1120 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1121 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1122 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1123 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1124 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1125 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1126 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
1131 return translate_table[t];
1150 #line 4 "evalexpr_parser.yy"
1153 #line 1085 "evalexpr_parser.cpp"
1155 #line 63 "evalexpr_parser.yy"
static const signed char yypgoto_[]
void error(const std::string &msg)
static const rhs_number_type yyrhs_[]
A `-1'-separated list of the rules' RHS.
static const char *const yytname_[]
For a symbol, its name in clear.
static const unsigned char yystos_[]
For a state, its accessing symbol.
void set_debug_stream(std::ostream &)
Set the current debugging stream.
virtual std::string yysyntax_error_(int yystate, int tok)
static const signed char yytable_ninf_
state_stack_type yystate_stack_
The state stack.
function_t get_symbol_function(char const *name)
int debug_level_type
Type for debugging levels.
void yydestruct_(const char *yymsg, int yytype, semantic_type *yyvaluep, location_type *yylocationp)
Reclaim the memory associated to a symbol.
virtual void yy_symbol_print_(int yytype, const semantic_type *yyvaluep, const location_type *yylocationp)
Report a symbol on the debug stream.
std::ostream & debug_stream() const
The current debugging stream.
int yylex(EvalExpr::semantic_type *yylval, EvalExpr &driver)
static const unsigned char yydefact_[]
std::deque< state_type >::const_reverse_iterator const_iterator
signed char rhs_number_type
A type to store symbol numbers and -1.
static std::string yytnamerr_(const char *n)
Convert the symbol name n to a form suitable for a diagnostic.
#define YYLLOC_DEFAULT(Current, Rhs, N)
debug_level_type debug_level() const
The current debugging level.
virtual void yy_symbol_value_print_(int yytype, const semantic_type *yyvaluep, const location_type *yylocationp)
Report a symbol value on the debug stream.
static const unsigned char yytable_[]
static const unsigned char yyprhs_[]
For each rule, the index of the first RHS symbol in yyrhs_.
void set_debug_level(debug_level_type l)
Set the current debugging level.
parser(EvalExpr &driver_yyarg)
Build a parser object.
static const unsigned short int yytoken_number_[]
For each scanner token number, its symbol number.
static const unsigned char yyr1_[]
For a rule, its LHS.
EvalExpr class for algebraic expression in parameter strings.
#define YY_REDUCE_PRINT(Rule)
virtual void error(const location_type &loc, const std::string &msg)
unsigned int height() const
virtual void yystack_print_()
Print the state stack on the debug stream.
void yypop_(unsigned int n=1)
Pop n symbols the three stacks.
stack< location_type > location_stack_type
location stack type.
static const unsigned char yyrline_[]
For each rule, its source line number.
virtual void yy_reduce_print_(int r)
Report on the debug stream that the rule r is going to be reduced.
static bool yy_table_value_is_error_(int yyvalue)
static const signed char yypact_ninf_
static const int yyntokens_
Present a slice of the top of a stack.
static const signed char yycheck_[]
static const int yyfinal_
stack< semantic_type > semantic_stack_type
Semantic value stack type.
token_number_type yytranslate_(int t)
Convert a scanner token number t to a symbol number.
double get_symbol_value(char const *name)
void set_result(double result)
static const token_number_type yyundef_token_
static const unsigned char yyr2_[]
For a rule, its RHS length.
stack< state_type > state_stack_type
State stack type.
static const signed char yydefgoto_[]
static const int yyerrcode_
const_iterator begin() const
const_iterator end() const
void pop(unsigned int n=1)
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
location_stack_type yylocation_stack_
The location stack.
static const unsigned int yyuser_token_number_max_
static const signed char yypact_[]
For a state, the index in yytable_ of its portion.
static bool yy_pact_value_is_default_(int yyvalue)
unsigned char token_number_type
Internal symbol numbers.
static const int yyterror_
static const int yyempty_
semantic_stack_type yysemantic_stack_
The semantic value stack.