41 #line 38 "evalexpr_parser.cpp"
49 #line 46 "evalexpr_parser.cpp"
52 #line 26 "evalexpr_parser.yy"
58 #line 55 "evalexpr_parser.cpp"
62 # if defined __cplusplus && 201103L <= __cplusplus
63 # define YY_NULL nullptr
70 # if defined YYENABLE_NLS && YYENABLE_NLS
73 # define YY_(msgid) dgettext("bison-runtime", msgid)
77 # define YY_(msgid) msgid
81 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
87 # ifndef YYLLOC_DEFAULT
88 # define YYLLOC_DEFAULT(Current, Rhs, N) \
92 (Current).begin = YYRHSLOC(Rhs, 1).begin; \
93 (Current).end = YYRHSLOC(Rhs, N).end; \
97 (Current).begin = (Current).end = YYRHSLOC(Rhs, 0).end; \
105 #define YYUSE(e) ((void)(e))
111 # define YYCDEBUG if (yydebug_) (*yycdebug_)
113 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
117 *yycdebug_ << Title << ' '; \
118 yy_symbol_print_((Type), (Value), (Location)); \
119 *yycdebug_ << std::endl; \
124 # define YY_REDUCE_PRINT(Rule) \
127 yy_reduce_print_(Rule); \
131 # define YY_STACK_PRINT() \
140 # define YYCDEBUG if (false) std::cerr
141 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) YYUSE(Type)
142 # define YY_REDUCE_PRINT(Rule) static_cast<void>(0)
143 # define YY_STACK_PRINT() static_cast<void>(0)
146 #define yyerrok (yyerrstatus_ = 0)
147 #define yyclearin (yychar = yyempty_)
149 #define YYACCEPT goto yyacceptlab
150 #define YYABORT goto yyabortlab
151 #define YYERROR goto yyerrorlab
152 #define YYRECOVERING() (!!yyerrstatus_)
155 #line 4 "evalexpr_parser.yy"
158 #line 151 "evalexpr_parser.cpp"
170 std::string yyr =
"";
171 char const *yyp = yystr;
178 goto do_not_strip_quotes;
182 goto do_not_strip_quotes;
193 do_not_strip_quotes:;
205 yycdebug_(&std::cerr),
229 std::ostream& yyoutput = yyo;
235 #line 40 "evalexpr_parser.yy"
237 yyoutput << ((*yyvaluep).sym);
240 #line 227 "evalexpr_parser.cpp"
245 #line 41 "evalexpr_parser.yy"
247 yyoutput << ((*yyvaluep).val);
250 #line 234 "evalexpr_parser.cpp"
255 #line 41 "evalexpr_parser.yy"
257 yyoutput << ((*yyvaluep).val);
260 #line 241 "evalexpr_parser.cpp"
275 << *yylocationp <<
": ";
296 #line 43 "evalexpr_parser.yy"
298 free(((*yyvaluep).sym));
301 #line 279 "evalexpr_parser.cpp"
376 int yyerrstatus_ = 0;
399 YYCDEBUG <<
"Starting parse" << std::endl;
415 YYCDEBUG <<
"Entering state " << yystate << std::endl;
441 yychar = yytoken =
yyeof_;
442 YYCDEBUG <<
"Now at end of input." << std::endl;
520 #line 49 "evalexpr_parser.yy"
528 #line 51 "evalexpr_parser.yy"
536 #line 52 "evalexpr_parser.yy"
545 #line 53 "evalexpr_parser.yy"
554 #line 54 "evalexpr_parser.yy"
562 #line 55 "evalexpr_parser.yy"
570 #line 56 "evalexpr_parser.yy"
578 #line 57 "evalexpr_parser.yy"
586 #line 58 "evalexpr_parser.yy"
594 #line 59 "evalexpr_parser.yy"
602 #line 60 "evalexpr_parser.yy"
610 #line 61 "evalexpr_parser.yy"
618 #line 562 "evalexpr_parser.cpp"
646 if ((0 <= yystate) && (yystate <=
yylast_) &&
647 (
yycheck_[yystate] == yystate_stack_[0]))
671 yyerror_range[1] = yylloc;
672 if (yyerrstatus_ == 3)
683 yydestruct_(
"Error: discarding", yytoken, &yylval, &yylloc);
710 yystate = yystate_stack_[0];
733 if (yystate_stack_.height() == 1)
741 yystate = yystate_stack_[0];
745 yyerror_range[2] = yylloc;
775 yydestruct_(
"Cleanup: discarding lookahead", yytoken, &yylval,
782 while (1 < yystate_stack_.height())
796 YYCDEBUG <<
"Exception caught: cleaning lookahead and stack"
835 YYERROR_VERBOSE_ARGS_MAXIMUM = 5
838 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
867 yyarg[yycount++] =
yytname_[yytoken];
874 int yyxbegin = yyn < 0 ? -yyn : 0;
876 int yychecklim =
yylast_ - yyn + 1;
878 for (
int yyx = yyxbegin; yyx < yyxend; ++yyx) {
882 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
893 char const *yyformat =
YY_NULL;
896 #define YYCASE_(N, S) \
901 YYCASE_(1,
YY_(
"syntax error, unexpected %s"));
902 YYCASE_(2,
YY_(
"syntax error, unexpected %s, expecting %s"));
903 YYCASE_(3,
YY_(
"syntax error, unexpected %s, expecting %s or %s"));
904 YYCASE_(4,
YY_(
"syntax error, unexpected %s, expecting %s or %s or %s"));
905 YYCASE_(5,
YY_(
"syntax error, unexpected %s, expecting %s or %s or %s or %s"));
911 for (
char const *yyp = yyformat; *yyp; ++yyp) {
912 if ((yyp[0] ==
'%') && (yyp[1] ==
's') && (yyi < yycount))
929 2, -10, -11, 2, 2, 2, 4, 28, 2, 8,
930 8, 10, -11, 2, 2, 2, 2, 2, 19, -11,
940 2, 5, 4, 0, 0, 0, 0, 3, 0, 12,
941 11, 0, 1, 0, 0, 0, 0, 0, 0, 14,
966 9, 10, 11, 8, 12, 18, 1, 2, 3, 4,
967 20, 21, 22, 23, 24, 5, 13, 14, 15, 16,
968 17, 0, 17, 0, 19, 13, 14, 15, 16, 0,
969 0, 17, 0, 25, 13, 14, 15, 16, 15, 16,
977 3, 4, 5, 13, 0, 8, 4, 5, 6, 7,
978 13, 14, 15, 16, 17, 13, 6, 7, 8, 9,
979 12, -1, 12, -1, 14, 6, 7, 8, 9, -1,
980 -1, 12, -1, 14, 6, 7, 8, 9, 8, 9,
989 0, 4, 5, 6, 7, 13, 16, 17, 13, 17,
990 17, 17, 0, 6, 7, 8, 9, 12, 17, 14,
991 17, 17, 17, 17, 17, 14
998 const unsigned short int
1001 0, 256, 257, 258, 259, 260, 45, 43, 42, 47,
1002 261, 262, 94, 40, 41
1010 0, 15, 16, 16, 17, 17, 17, 17, 17, 17,
1018 0, 2, 0, 1, 1, 1, 4, 3, 3, 3,
1028 "$end",
"error",
"$undefined",
"EOL",
"IDENTIFIER",
"NUMBER",
"'-'",
1029 "'+'",
"'*'",
"'/'",
"NEG",
"PLS",
"'^'",
"'('",
"')'",
"$accept",
1038 16, 0, -1, -1, 17, -1, 5, -1, 4, -1,
1039 4, 13, 17, 14, -1, 17, 7, 17, -1, 17,
1040 6, 17, -1, 17, 8, 17, -1, 17, 9, 17,
1041 -1, 7, 17, -1, 6, 17, -1, 17, 12, 17,
1050 0, 0, 3, 4, 6, 8, 10, 15, 19, 23,
1058 0, 48, 48, 49, 51, 52, 53, 54, 55, 56,
1079 unsigned int yylno =
yyrline_[yyrule];
1080 int yynrhs =
yyr2_[yyrule];
1083 *
yycdebug_ <<
"Reducing stack by rule " << yyrule - 1
1084 <<
" (line " << yylno <<
"):" << std::endl;
1086 for (
int yyi = 0; yyi < yynrhs; yyi++) {
1103 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1104 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1105 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1106 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1107 13, 14, 8, 7, 2, 6, 2, 9, 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, 2, 2, 2, 2, 2, 2,
1111 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1112 2, 2, 2, 2, 12, 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, 2, 2, 2, 2,
1127 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1128 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
1133 return translate_table[t];
1152 #line 4 "evalexpr_parser.yy"
1155 #line 1085 "evalexpr_parser.cpp"
1157 #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.