44 #line 45 "LutParser.cpp"
47 # if defined YYENABLE_NLS && YYENABLE_NLS
50 # define YY_(msgid) dgettext ("bison-runtime", msgid)
54 # define YY_(msgid) msgid
59 #define YYUSE(e) ((void) (e))
63 for (bool yydebugcond_ = yydebug_; yydebugcond_; yydebugcond_ = false) \
69 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
73 *yycdebug_ << Title << ' '; \
74 yy_symbol_print_ ((Type), (Value), (Location)); \
75 *yycdebug_ << std::endl; \
79 # define YY_REDUCE_PRINT(Rule) \
82 yy_reduce_print_ (Rule); \
85 # define YY_STACK_PRINT() \
93 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
94 # define YY_REDUCE_PRINT(Rule)
95 # define YY_STACK_PRINT()
99 #define YYACCEPT goto yyacceptlab
100 #define YYABORT goto yyabortlab
101 #define YYERROR goto yyerrorlab
118 char const *yyp = yystr;
125 goto do_not_strip_quotes;
129 goto do_not_strip_quotes;
138 do_not_strip_quotes: ;
149 yycdebug_ (&std::cerr),
164 LutParser::yy_symbol_value_print_ (
int yytype,
165 const semantic_type* yyvaluep,
const location_type* yylocationp)
178 LutParser::yy_symbol_print_ (
int yytype,
179 const semantic_type* yyvaluep,
const location_type* yylocationp)
183 << *yylocationp <<
": ";
184 yy_symbol_value_print_ (yytype, yyvaluep, yylocationp);
255 int yyerrstatus_ = 0;
271 YYCDEBUG <<
"Starting parse" << std::endl;
275 #line 88 "/Volumes/project/dev/torc/trunk/src/torc/bitstream/assembler/lut/parser.yy"
281 #line 282 "LutParser.cpp"
295 YYCDEBUG <<
"Entering state " << yystate << std::endl;
310 yychar =
yylex (&yylval, &yylloc);
317 yychar = yytoken =
yyeof_;
318 YYCDEBUG <<
"Now at end of input." << std::endl;
397 #line 147 "parser.yy"
402 #line 153 "parser.yy"
407 #line 159 "parser.yy"
412 #line 164 "parser.yy"
417 #line 167 "parser.yy"
422 #line 168 "parser.yy"
428 #line 429 "LutParser.cpp"
443 if (0 <= yystate && yystate <=
yylast_
444 &&
yycheck_[yystate] == yystate_stack_[0])
461 yyerror_range[0] = yylloc;
462 if (yyerrstatus_ == 3)
475 yydestruct_ (
"Error: discarding", yytoken, &yylval, &yylloc);
501 yystate = yystate_stack_[0];
525 if (yystate_stack_.height () == 1)
533 yystate = yystate_stack_[0];
540 yyerror_range[1] = yylloc;
566 yydestruct_ (
"Cleanup: discarding lookahead", yytoken, &yylval, &yylloc);
571 while (yystate_stack_.height () != 1)
595 int yyxbegin = yyn < 0 ? -yyn : 0;
598 int yychecklim =
yylast_ - yyn + 1;
601 for (
int x = yyxbegin; x < yyxend; ++x)
613 res =
"syntax error, unexpected ";
618 for (
int x = yyxbegin; x < yyxend; ++x)
621 res += (!count++) ?
", expecting " :
" or ";
628 res =
YY_(
"syntax error");
639 -4, -5, -5, -2, -4, 5, -1, 3, 4, -5,
640 -5, -5, 1, -5, -4, -4, -4, -5, 3, 4,
650 0, 12, 13, 0, 0, 0, 2, 3, 5, 7,
651 9, 10, 0, 1, 0, 0, 0, 11, 4, 6,
659 -5, -5, 9, 0, 2, 6, 12
666 -1, 5, 6, 7, 8, 9, 10
676 1, 2, 1, 2, 3, 13, 14, 4, 14, 4,
677 16, 17, 15, 12, 18, 11, 0, 19, 0, 0,
685 4, 5, 4, 5, 8, 0, 7, 11, 7, 11,
686 6, 10, 9, 4, 14, 3, -1, 15, -1, -1,
695 0, 4, 5, 8, 11, 14, 15, 16, 17, 18,
696 19, 19, 15, 0, 7, 9, 6, 10, 16, 17,
703 const unsigned short int
704 LutParser::yytoken_number_[] =
706 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
715 0, 13, 14, 15, 15, 16, 16, 17, 17, 18,
723 0, 2, 1, 1, 3, 1, 3, 1, 3, 1,
727 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
733 "\"end of file\"",
"error",
"$undefined",
"\"end of line\"",
"VAR",
734 "LITERAL",
"AND",
"OR",
"NOT",
"XOR",
"RP",
"LP",
"INVALID",
"$accept",
735 "lut_equation",
"expression",
"xor_expression",
"and_expression",
736 "not_expression",
"factor", 0
742 const LutParser::rhs_number_type
743 LutParser::yyrhs_[] =
745 14, 0, -1, 15, -1, 16, -1, 15, 7, 16,
746 -1, 17, -1, 16, 9, 17, -1, 18, -1, 17,
747 6, 18, -1, 19, -1, 8, 19, -1, 11, 15,
754 LutParser::yyprhs_[] =
756 0, 0, 3, 5, 7, 11, 13, 17, 19, 23,
762 LutParser::yyrline_[] =
764 0, 141, 141, 145, 146, 151, 152, 157, 158, 163,
770 LutParser::yystack_print_ ()
781 LutParser::yy_reduce_print_ (
int yyrule)
783 unsigned int yylno = yyrline_[yyrule];
784 int yynrhs =
yyr2_[yyrule];
786 *
yycdebug_ <<
"Reducing stack by rule " << yyrule - 1
787 <<
" (line " << yylno <<
"), ";
789 for (
int yyi = 0; yyi < yynrhs; yyi++)
791 yyrhs_[yyprhs_[yyrule] + yyi],
805 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
806 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
807 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
808 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
809 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
810 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
811 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
812 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
813 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
814 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
815 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
816 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
817 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
818 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
819 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
820 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
821 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
822 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
823 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
824 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
825 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
826 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
827 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
828 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
829 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
830 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
831 5, 6, 7, 8, 9, 10, 11, 12
834 return translate_table[t];
853 #line 178 "parser.yy"
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.
static const signed char yydefgoto_[]
void yypop_(unsigned int n=1)
Pop n symbols the three stacks.
position begin
Beginning of the located region.
YYSTYPE semantic_type
Symbol semantic values.
void yydestruct_(const char *yymsg, int yytype, semantic_type *yyvaluep, location_type *yylocationp)
Reclaim the memory associated to a symbol.
static const int yyntokens_
const_iterator end() const
Bison undocumented.
location_stack_type yylocation_stack_
The location stack.
semantic_stack_type yysemantic_stack_
The semantic value stack.
Present a slice of the top of a stack.
string mStreamName
Name of file or input stream for error messages.
static const signed char yypgoto_[]
static const unsigned char yyr2_[]
For a rule, its RHS length.
int debug_level_type
Type for debugging levels.
Header forwarding LutScanner includes to the LutParser.
const_iterator begin() const
Bison undocumented.
std::ostream & debug_stream() const
The current debugging stream.
static const unsigned char yyr1_[]
For a rule, its LHS.
static const unsigned int yyuser_token_number_max_
static const signed char yytable_ninf_
static const int yyerrcode_
void binaryLutFrameOperation(EOperation inOperation)
Function called from parser when it encounters a bit operator.
#define YYLLOC_DEFAULT(Current, Rhs, N)
void push(const T &t)
Bison undocumented.
static const signed char yypact_[]
For a state, the index in yytable_ of its portion.
static const signed char yypact_ninf_
void pushLutFrame(string inLiteral)
Function called from parser when it encounters a literal.
std::string * filename
File name to which this position refers.
stack< location_type > location_stack_type
location stack type.
LutParser(class Assembler &lut_yyarg)
Build a parser object.
static const int yyempty_
virtual std::string yytnamerr_(const char *n)
Convert the symbol name n to a form suitable for a diagnostic.
static const token_number_type yyundef_token_
static const int yyterror_
#define YY_REDUCE_PRINT(Rule)
static const char *const yytname_[]
For a symbol, its name in clear.
void set_debug_stream(std::ostream &)
Set the current debugging stream.
static const unsigned char yytable_[]
stack< state_type > state_stack_type
State stack type.
static const signed char yycheck_[]
position end
End of the located region.
std::deque< state_type >::const_reverse_iterator const_iterator
static const int yyfinal_
void pop(unsigned int n=1)
Bison undocumented.
void error(const location &l, const string &m)
Lut parse error handling.
virtual std::string yysyntax_error_(int yystate, int tok)
unsigned char token_number_type
Internal symbol numbers.
debug_level_type debug_level() const
The current debugging level.
state_stack_type yystate_stack_
The state stack.
Base class for bitstream assembly.
static const unsigned char yystos_[]
For a state, its accessing symbol.
void set_debug_level(debug_level_type l)
Set the current debugging level.
static const unsigned char yydefact_[]
virtual void error(const location_type &loc, const std::string &msg)
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)