torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
torc::LutParser Class Reference

A Bison parser. More...

#include <LutParser.hpp>

+ Collaboration diagram for torc::LutParser:

Data Structures

struct  token
 Tokens. More...
 

Public Types

typedef YYSTYPE semantic_type
 Symbol semantic values. More...
 
typedef location location_type
 Symbol locations. More...
 
typedef token::yytokentype token_type
 Token type. More...
 
typedef int debug_level_type
 Type for debugging levels. More...
 

Public Member Functions

 LutParser (class Assembler &lut_yyarg)
 Build a parser object. More...
 
virtual ~LutParser ()
 
virtual int parse ()
 
std::ostream & debug_stream () const
 The current debugging stream. More...
 
void set_debug_stream (std::ostream &)
 Set the current debugging stream. More...
 
debug_level_type debug_level () const
 The current debugging level. More...
 
void set_debug_level (debug_level_type l)
 Set the current debugging level. More...
 

Private Types

typedef int state_type
 State numbers. More...
 
typedef stack< state_typestate_stack_type
 State stack type. More...
 
typedef stack< semantic_typesemantic_stack_type
 Semantic value stack type. More...
 
typedef stack< location_typelocation_stack_type
 location stack type. More...
 
typedef unsigned char token_number_type
 Internal symbol numbers. More...
 

Private Member Functions

virtual void error (const location_type &loc, const std::string &msg)
 
virtual std::string yysyntax_error_ (int yystate, int tok)
 
virtual std::string yytnamerr_ (const char *n)
 Convert the symbol name n to a form suitable for a diagnostic. More...
 
token_number_type yytranslate_ (int t)
 Convert a scanner token number t to a symbol number. More...
 
void yydestruct_ (const char *yymsg, int yytype, semantic_type *yyvaluep, location_type *yylocationp)
 Reclaim the memory associated to a symbol. More...
 
void yypop_ (unsigned int n=1)
 Pop n symbols the three stacks. More...
 

Private Attributes

state_stack_type yystate_stack_
 The state stack. More...
 
semantic_stack_type yysemantic_stack_
 The semantic value stack. More...
 
location_stack_type yylocation_stack_
 The location stack. More...
 
int yydebug_
 
std::ostream * yycdebug_
 
class Assemblerlut
 

Static Private Attributes

static const signed char yypact_ []
 For a state, the index in yytable_ of its portion. More...
 
static const signed char yypact_ninf_ = -5
 
static const unsigned char yydefact_ []
 
static const signed char yypgoto_ []
 
static const signed char yydefgoto_ []
 
static const unsigned char yytable_ []
 
static const signed char yytable_ninf_ = -1
 
static const signed char yycheck_ []
 
static const unsigned char yystos_ []
 For a state, its accessing symbol. More...
 
static const unsigned char yyr1_ []
 For a rule, its LHS. More...
 
static const unsigned char yyr2_ []
 For a rule, its RHS length. More...
 
static const char *const yytname_ []
 For a symbol, its name in clear. More...
 
static const int yyeof_ = 0
 
static const int yylast_ = 22
 
static const int yynnts_ = 7
 
static const int yyempty_ = -2
 
static const int yyfinal_ = 13
 
static const int yyterror_ = 1
 
static const int yyerrcode_ = 256
 
static const int yyntokens_ = 13
 
static const unsigned int yyuser_token_number_max_ = 267
 
static const token_number_type yyundef_token_ = 2
 

Detailed Description

A Bison parser.

Definition at line 144 of file LutParser.hpp.

Member Typedef Documentation

Type for debugging levels.

Definition at line 191 of file LutParser.hpp.

location stack type.

Definition at line 233 of file LutParser.hpp.

Symbol locations.

Definition at line 154 of file LutParser.hpp.

Semantic value stack type.

Definition at line 231 of file LutParser.hpp.

Symbol semantic values.

Definition at line 151 of file LutParser.hpp.

State stack type.

Definition at line 229 of file LutParser.hpp.

typedef int torc::LutParser::state_type
private

State numbers.

Definition at line 227 of file LutParser.hpp.

typedef unsigned char torc::LutParser::token_number_type
private

Internal symbol numbers.

Definition at line 243 of file LutParser.hpp.

Token type.

Definition at line 175 of file LutParser.hpp.

Constructor & Destructor Documentation

torc::LutParser::LutParser ( class Assembler lut_yyarg)

Build a parser object.

Definition at line 147 of file LutParser.cpp.

148  : yydebug_ (false),
149  yycdebug_ (&std::cerr),
150  lut (lut_yyarg)
151  {
152  }
class Assembler & lut
Definition: LutParser.hpp:337
std::ostream * yycdebug_
Definition: LutParser.hpp:333
torc::LutParser::~LutParser ( )
virtual

Definition at line 154 of file LutParser.cpp.

155  {
156  }

Member Function Documentation

LutParser::debug_level_type torc::LutParser::debug_level ( ) const

The current debugging level.

Definition at line 229 of file LutParser.cpp.

230  {
231  return yydebug_;
232  }
std::ostream & torc::LutParser::debug_stream ( ) const

The current debugging stream.

Definition at line 216 of file LutParser.cpp.

217  {
218  return *yycdebug_;
219  }
std::ostream * yycdebug_
Definition: LutParser.hpp:333
void torc::LutParser::error ( const location_type loc,
const std::string &  msg 
)
privatevirtual

Report a syntax error.

Parameters
locwhere the syntax error is found.
msga description of the syntax error.

Definition at line 862 of file LutParser.cpp.

862  {
863  lut.error(l, m);
864 }
class Assembler & lut
Definition: LutParser.hpp:337
void error(const location &l, const string &m)
Lut parse error handling.
Definition: Assembler.cpp:849

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int torc::LutParser::parse ( )
virtual

Parse.

Returns
0 iff parsing succeeded.

Look-ahead and look-ahead in internal form.

Semantic value of the look-ahead.

Location of the look-ahead.

The locations where the error started and ended.

$$.

$.

Definition at line 242 of file LutParser.cpp.

243  {
244  /// Look-ahead and look-ahead in internal form.
245  int yychar = yyempty_;
246  int yytoken = 0;
247 
248  /* State. */
249  int yyn;
250  int yylen = 0;
251  int yystate = 0;
252 
253  /* Error handling. */
254  int yynerrs_ = 0;
255  int yyerrstatus_ = 0;
256 
257  /// Semantic value of the look-ahead.
258  semantic_type yylval;
259  /// Location of the look-ahead.
260  location_type yylloc;
261  /// The locations where the error started and ended.
262  location yyerror_range[2];
263 
264  /// $$.
265  semantic_type yyval;
266  /// @$.
267  location_type yyloc;
268 
269  int yyresult;
270 
271  YYCDEBUG << "Starting parse" << std::endl;
272 
273 
274  /* User initialization code. */
275  #line 88 "/Volumes/project/dev/torc/trunk/src/torc/bitstream/assembler/lut/parser.yy"
276 {
277  // initialize the initial location object
278  yylloc.begin.filename = yylloc.end.filename = &lut.mStreamName;
279 }
280  /* Line 555 of yacc.c. */
281 #line 282 "LutParser.cpp"
282  /* Initialize the stacks. The initial state will be pushed in
283  yynewstate, since the latter expects the semantical and the
284  location values to have been already stored, initialize these
285  stacks with a primary value. */
289  yysemantic_stack_.push (yylval);
290  yylocation_stack_.push (yylloc);
291 
292  /* New state. */
293  yynewstate:
294  yystate_stack_.push (yystate);
295  YYCDEBUG << "Entering state " << yystate << std::endl;
296  goto yybackup;
297 
298  /* Backup. */
299  yybackup:
300 
301  /* Try to take a decision without look-ahead. */
302  yyn = yypact_[yystate];
303  if (yyn == yypact_ninf_)
304  goto yydefault;
305 
306  /* Read a look-ahead token. */
307  if (yychar == yyempty_)
308  {
309  YYCDEBUG << "Reading a token: ";
310  yychar = yylex (&yylval, &yylloc);
311  }
312 
313 
314  /* Convert token to internal form. */
315  if (yychar <= yyeof_)
316  {
317  yychar = yytoken = yyeof_;
318  YYCDEBUG << "Now at end of input." << std::endl;
319  }
320  else
321  {
322  yytoken = yytranslate_ (yychar);
323  YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
324  }
325 
326  /* If the proper action on seeing token YYTOKEN is to reduce or to
327  detect an error, take that action. */
328  yyn += yytoken;
329  if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yytoken)
330  goto yydefault;
331 
332  /* Reduce or error. */
333  yyn = yytable_[yyn];
334  if (yyn <= 0)
335  {
336  if (yyn == 0 || yyn == yytable_ninf_)
337  goto yyerrlab;
338  yyn = -yyn;
339  goto yyreduce;
340  }
341 
342  /* Accept? */
343  if (yyn == yyfinal_)
344  goto yyacceptlab;
345 
346  /* Shift the look-ahead token. */
347  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
348 
349  /* Discard the token being shifted unless it is eof. */
350  if (yychar != yyeof_)
351  yychar = yyempty_;
352 
353  yysemantic_stack_.push (yylval);
354  yylocation_stack_.push (yylloc);
355 
356  /* Count tokens shifted since error; after three, turn off error
357  status. */
358  if (yyerrstatus_)
359  --yyerrstatus_;
360 
361  yystate = yyn;
362  goto yynewstate;
363 
364  /*-----------------------------------------------------------.
365  | yydefault -- do the default action for the current state. |
366  `-----------------------------------------------------------*/
367  yydefault:
368  yyn = yydefact_[yystate];
369  if (yyn == 0)
370  goto yyerrlab;
371  goto yyreduce;
372 
373  /*-----------------------------.
374  | yyreduce -- Do a reduction. |
375  `-----------------------------*/
376  yyreduce:
377  yylen = yyr2_[yyn];
378  /* If YYLEN is nonzero, implement the default value of the action:
379  `$$ = $1'. Otherwise, use the top of the stack.
380 
381  Otherwise, the following line sets YYVAL to garbage.
382  This behavior is undocumented and Bison
383  users should not rely upon it. */
384  if (yylen)
385  yyval = yysemantic_stack_[yylen - 1];
386  else
387  yyval = yysemantic_stack_[0];
388 
389  {
390  slice<location_type, location_stack_type> slice (yylocation_stack_, yylen);
391  YYLLOC_DEFAULT (yyloc, slice, yylen);
392  }
393  YY_REDUCE_PRINT (yyn);
394  switch (yyn)
395  {
396  case 4:
397 #line 147 "parser.yy"
398  { (yyval) = (yysemantic_stack_[(3) - (1)]) + " xor " + (yysemantic_stack_[(3) - (3)]); lut.binaryLutFrameOperation(Assembler::eOR); }
399  break;
400 
401  case 6:
402 #line 153 "parser.yy"
403  { (yyval) = (yysemantic_stack_[(3) - (1)]) + " xor " + (yysemantic_stack_[(3) - (3)]); lut.binaryLutFrameOperation(Assembler::eXOR); }
404  break;
405 
406  case 8:
407 #line 159 "parser.yy"
408  { (yyval) = (yysemantic_stack_[(3) - (1)]) + " and " + (yysemantic_stack_[(3) - (3)]); lut.binaryLutFrameOperation(Assembler::eAND); }
409  break;
410 
411  case 10:
412 #line 164 "parser.yy"
413  { (yyval) = "not " + (yysemantic_stack_[(2) - (2)]); lut.binaryLutFrameOperation(Assembler::eNOT); }
414  break;
415 
416  case 11:
417 #line 167 "parser.yy"
418  { (yyval) = (yysemantic_stack_[(3) - (2)]); }
419  break;
420 
421  case 12:
422 #line 168 "parser.yy"
423  { (yyval) = (yysemantic_stack_[(1) - (1)]); lut.pushLutFrame(yylval); }
424  break;
425 
426 
427  /* Line 675 of lalr1.cc. */
428 #line 429 "LutParser.cpp"
429  default: break;
430  }
431  YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc);
432 
433  yypop_ (yylen);
434  yylen = 0;
435  YY_STACK_PRINT ();
436 
437  yysemantic_stack_.push (yyval);
438  yylocation_stack_.push (yyloc);
439 
440  /* Shift the result of the reduction. */
441  yyn = yyr1_[yyn];
442  yystate = yypgoto_[yyn - yyntokens_] + yystate_stack_[0];
443  if (0 <= yystate && yystate <= yylast_
444  && yycheck_[yystate] == yystate_stack_[0])
445  yystate = yytable_[yystate];
446  else
447  yystate = yydefgoto_[yyn - yyntokens_];
448  goto yynewstate;
449 
450  /*------------------------------------.
451  | yyerrlab -- here on detecting error |
452  `------------------------------------*/
453  yyerrlab:
454  /* If not already recovering from an error, report this error. */
455  if (!yyerrstatus_)
456  {
457  ++yynerrs_;
458  error (yylloc, yysyntax_error_ (yystate, yytoken));
459  }
460 
461  yyerror_range[0] = yylloc;
462  if (yyerrstatus_ == 3)
463  {
464  /* If just tried and failed to reuse look-ahead token after an
465  error, discard it. */
466 
467  if (yychar <= yyeof_)
468  {
469  /* Return failure if at end of input. */
470  if (yychar == yyeof_)
471  YYABORT;
472  }
473  else
474  {
475  yydestruct_ ("Error: discarding", yytoken, &yylval, &yylloc);
476  yychar = yyempty_;
477  }
478  }
479 
480  /* Else will try to reuse look-ahead token after shifting the error
481  token. */
482  goto yyerrlab1;
483 
484 
485  /*---------------------------------------------------.
486  | yyerrorlab -- error raised explicitly by YYERROR. |
487  `---------------------------------------------------*/
488  yyerrorlab:
489 
490  /* Pacify compilers like GCC when the user code never invokes
491  YYERROR and the label yyerrorlab therefore never appears in user
492  code. */
493  if (false)
494  goto yyerrorlab;
495 
496  yyerror_range[0] = yylocation_stack_[yylen - 1];
497  /* Do not reclaim the symbols of the rule which action triggered
498  this YYERROR. */
499  yypop_ (yylen);
500  yylen = 0;
501  yystate = yystate_stack_[0];
502  goto yyerrlab1;
503 
504  /*-------------------------------------------------------------.
505  | yyerrlab1 -- common code for both syntax error and YYERROR. |
506  `-------------------------------------------------------------*/
507  yyerrlab1:
508  yyerrstatus_ = 3; /* Each real token shifted decrements this. */
509 
510  for (;;)
511  {
512  yyn = yypact_[yystate];
513  if (yyn != yypact_ninf_)
514  {
515  yyn += yyterror_;
516  if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_)
517  {
518  yyn = yytable_[yyn];
519  if (0 < yyn)
520  break;
521  }
522  }
523 
524  /* Pop the current state because it cannot handle the error token. */
525  if (yystate_stack_.height () == 1)
526  YYABORT;
527 
528  yyerror_range[0] = yylocation_stack_[0];
529  yydestruct_ ("Error: popping",
530  yystos_[yystate],
532  yypop_ ();
533  yystate = yystate_stack_[0];
534  YY_STACK_PRINT ();
535  }
536 
537  if (yyn == yyfinal_)
538  goto yyacceptlab;
539 
540  yyerror_range[1] = yylloc;
541  // Using YYLLOC is tempting, but would change the location of
542  // the look-ahead. YYLOC is available though.
543  YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
544  yysemantic_stack_.push (yylval);
545  yylocation_stack_.push (yyloc);
546 
547  /* Shift the error token. */
548  YY_SYMBOL_PRINT ("Shifting", yystos_[yyn],
550 
551  yystate = yyn;
552  goto yynewstate;
553 
554  /* Accept. */
555  yyacceptlab:
556  yyresult = 0;
557  goto yyreturn;
558 
559  /* Abort. */
560  yyabortlab:
561  yyresult = 1;
562  goto yyreturn;
563 
564  yyreturn:
565  if (yychar != yyeof_ && yychar != yyempty_)
566  yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc);
567 
568  /* Do not reclaim the symbols of the rule which action triggered
569  this YYABORT or YYACCEPT. */
570  yypop_ (yylen);
571  while (yystate_stack_.height () != 1)
572  {
573  yydestruct_ ("Cleanup: popping",
574  yystos_[yystate_stack_[0]],
575  &yysemantic_stack_[0],
576  &yylocation_stack_[0]);
577  yypop_ ();
578  }
579 
580  return yyresult;
581  }
stack< semantic_type > semantic_stack_type
Semantic value stack type.
Definition: LutParser.hpp:231
token_number_type yytranslate_(int t)
Convert a scanner token number t to a symbol number.
Definition: LutParser.cpp:799
#define yylex
Definition: LutParser.cpp:36
static const signed char yydefgoto_[]
Definition: LutParser.hpp:255
#define YYCDEBUG
Definition: LutParser.cpp:62
void yypop_(unsigned int n=1)
Pop n symbols the three stacks.
Definition: LutParser.cpp:208
YYSTYPE semantic_type
Symbol semantic values.
Definition: LutParser.hpp:151
void yydestruct_(const char *yymsg, int yytype, semantic_type *yyvaluep, location_type *yylocationp)
Reclaim the memory associated to a symbol.
Definition: LutParser.cpp:190
static const int yyntokens_
Definition: LutParser.hpp:327
location_stack_type yylocation_stack_
The location stack.
Definition: LutParser.hpp:240
semantic_stack_type yysemantic_stack_
The semantic value stack.
Definition: LutParser.hpp:238
string mStreamName
Name of file or input stream for error messages.
Definition: Assembler.hpp:112
static const signed char yypgoto_[]
Definition: LutParser.hpp:254
static const unsigned char yyr2_[]
For a rule, its RHS length.
Definition: LutParser.hpp:273
static const unsigned char yyr1_[]
For a rule, its LHS.
Definition: LutParser.hpp:271
static const int yyeof_
Definition: LutParser.hpp:319
#define YY_STACK_PRINT()
Definition: LutParser.cpp:95
static const signed char yytable_ninf_
Definition: LutParser.hpp:263
void binaryLutFrameOperation(EOperation inOperation)
Function called from parser when it encounters a bit operator.
Definition: Assembler.cpp:747
#define YYLLOC_DEFAULT(Current, Rhs, N)
Definition: LutParser.hpp:126
void push(const T &t)
Bison undocumented.
static const signed char yypact_[]
For a state, the index in yytable_ of its portion.
Definition: LutParser.hpp:246
static const signed char yypact_ninf_
Definition: LutParser.hpp:247
void pushLutFrame(string inLiteral)
Function called from parser when it encounters a literal.
Definition: Assembler.cpp:803
class Assembler & lut
Definition: LutParser.hpp:337
stack< location_type > location_stack_type
location stack type.
Definition: LutParser.hpp:233
static const int yyempty_
Definition: LutParser.hpp:323
static const int yyterror_
Definition: LutParser.hpp:325
#define YY_REDUCE_PRINT(Rule)
Definition: LutParser.cpp:94
location location_type
Symbol locations.
Definition: LutParser.hpp:154
static const unsigned char yytable_[]
Definition: LutParser.hpp:262
stack< state_type > state_stack_type
State stack type.
Definition: LutParser.hpp:229
static const signed char yycheck_[]
Definition: LutParser.hpp:265
static const int yyfinal_
Definition: LutParser.hpp:324
virtual std::string yysyntax_error_(int yystate, int tok)
Definition: LutParser.cpp:585
state_stack_type yystate_stack_
The state stack.
Definition: LutParser.hpp:236
static const int yylast_
Definition: LutParser.hpp:321
#define YYABORT
Definition: LutParser.cpp:100
static const unsigned char yystos_[]
For a state, its accessing symbol.
Definition: LutParser.hpp:268
static const unsigned char yydefact_[]
Definition: LutParser.hpp:252
virtual void error(const location_type &loc, const std::string &msg)
Definition: LutParser.cpp:862
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
Definition: LutParser.cpp:93

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void torc::LutParser::set_debug_level ( debug_level_type  l)

Set the current debugging level.

Definition at line 235 of file LutParser.cpp.

236  {
237  yydebug_ = l;
238  }

+ Here is the caller graph for this function:

void torc::LutParser::set_debug_stream ( std::ostream &  o)

Set the current debugging stream.

Definition at line 222 of file LutParser.cpp.

223  {
224  yycdebug_ = &o;
225  }
std::ostream * yycdebug_
Definition: LutParser.hpp:333
void torc::LutParser::yydestruct_ ( const char *  yymsg,
int  yytype,
semantic_type yyvaluep,
location_type yylocationp 
)
inlineprivate

Reclaim the memory associated to a symbol.

Parameters
yymsgWhy this token is reclaimed.
yytypeThe symbol type.
yyvaluepIts semantic value.
yylocationpIts location.

Definition at line 190 of file LutParser.cpp.

192  {
193  YYUSE (yylocationp);
194  YYUSE (yymsg);
195  YYUSE (yyvaluep);
196 
197  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
198 
199  switch (yytype)
200  {
201 
202  default:
203  break;
204  }
205  }
#define YYUSE(e)
Definition: LutParser.cpp:59
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
Definition: LutParser.cpp:93

+ Here is the caller graph for this function:

void torc::LutParser::yypop_ ( unsigned int  n = 1)
inlineprivate

Pop n symbols the three stacks.

Definition at line 208 of file LutParser.cpp.

209  {
210  yystate_stack_.pop (n);
213  }
location_stack_type yylocation_stack_
The location stack.
Definition: LutParser.hpp:240
semantic_stack_type yysemantic_stack_
The semantic value stack.
Definition: LutParser.hpp:238
void pop(unsigned int n=1)
Bison undocumented.
state_stack_type yystate_stack_
The state stack.
Definition: LutParser.hpp:236

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::string torc::LutParser::yysyntax_error_ ( int  yystate,
int  tok 
)
privatevirtual

Generate an error message.

Parameters
statethe state where the error occurred.
tokthe look-ahead token.

Definition at line 585 of file LutParser.cpp.

586  {
587  std::string res;
588  YYUSE (yystate);
589 #if YYERROR_VERBOSE
590  int yyn = yypact_[yystate];
591  if (yypact_ninf_ < yyn && yyn <= yylast_)
592  {
593  /* Start YYX at -YYN if negative to avoid negative indexes in
594  YYCHECK. */
595  int yyxbegin = yyn < 0 ? -yyn : 0;
596 
597  /* Stay within bounds of both yycheck and yytname. */
598  int yychecklim = yylast_ - yyn + 1;
599  int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
600  int count = 0;
601  for (int x = yyxbegin; x < yyxend; ++x)
602  if (yycheck_[x + yyn] == x && x != yyterror_)
603  ++count;
604 
605  // FIXME: This method of building the message is not compatible
606  // with internationalization. It should work like yacc.c does it.
607  // That is, first build a string that looks like this:
608  // "syntax error, unexpected %s or %s or %s"
609  // Then, invoke YY_ on this string.
610  // Finally, use the string as a format to output
611  // yytname_[tok], etc.
612  // Until this gets fixed, this message appears in English only.
613  res = "syntax error, unexpected ";
614  res += yytnamerr_ (yytname_[tok]);
615  if (count < 5)
616  {
617  count = 0;
618  for (int x = yyxbegin; x < yyxend; ++x)
619  if (yycheck_[x + yyn] == x && x != yyterror_)
620  {
621  res += (!count++) ? ", expecting " : " or ";
622  res += yytnamerr_ (yytname_[x]);
623  }
624  }
625  }
626  else
627 #endif
628  res = YY_("syntax error");
629  return res;
630  }
static const int yyntokens_
Definition: LutParser.hpp:327
std::string string
#define YYUSE(e)
Definition: LutParser.cpp:59
static const signed char yypact_[]
For a state, the index in yytable_ of its portion.
Definition: LutParser.hpp:246
static const signed char yypact_ninf_
Definition: LutParser.hpp:247
virtual std::string yytnamerr_(const char *n)
Convert the symbol name n to a form suitable for a diagnostic.
static const int yyterror_
Definition: LutParser.hpp:325
static const char *const yytname_[]
For a symbol, its name in clear.
Definition: LutParser.hpp:277
#define YY_(msgid)
Definition: LutParser.cpp:54
static const signed char yycheck_[]
Definition: LutParser.hpp:265
static const int yylast_
Definition: LutParser.hpp:321

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

virtual std::string torc::LutParser::yytnamerr_ ( const char *  n)
privatevirtual

Convert the symbol name n to a form suitable for a diagnostic.

+ Here is the caller graph for this function:

LutParser::token_number_type torc::LutParser::yytranslate_ ( int  t)
private

Convert a scanner token number t to a symbol number.

Definition at line 799 of file LutParser.cpp.

800  {
801  static
802  const token_number_type
803  translate_table[] =
804  {
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
832  };
833  if ((unsigned int) t <= yyuser_token_number_max_)
834  return translate_table[t];
835  else
836  return yyundef_token_;
837  }
static const unsigned int yyuser_token_number_max_
Definition: LutParser.hpp:328
static const token_number_type yyundef_token_
Definition: LutParser.hpp:329
unsigned char token_number_type
Internal symbol numbers.
Definition: LutParser.hpp:243

+ Here is the caller graph for this function:

Field Documentation

class Assembler& torc::LutParser::lut
private

Definition at line 337 of file LutParser.hpp.

std::ostream* torc::LutParser::yycdebug_
private

Definition at line 333 of file LutParser.hpp.

const signed char torc::LutParser::yycheck_
staticprivate
Initial value:
=
{
4, 5, 4, 5, 8, 0, 7, 11, 7, 11,
6, 10, 9, 4, 14, 3, -1, 15, -1, -1,
-1, -1, 16
}

Definition at line 265 of file LutParser.hpp.

int torc::LutParser::yydebug_
private

Definition at line 332 of file LutParser.hpp.

const unsigned char torc::LutParser::yydefact_
staticprivate
Initial value:
=
{
0, 12, 13, 0, 0, 0, 2, 3, 5, 7,
9, 10, 0, 1, 0, 0, 0, 11, 4, 6,
8
}

For a state, default rule to reduce. Unlessyytable_ specifies something else to do. Zero means the default is an error.

Definition at line 252 of file LutParser.hpp.

const signed char torc::LutParser::yydefgoto_
staticprivate
Initial value:
=
{
-1, 5, 6, 7, 8, 9, 10
}

Definition at line 255 of file LutParser.hpp.

const int torc::LutParser::yyempty_ = -2
staticprivate

Definition at line 323 of file LutParser.hpp.

const int torc::LutParser::yyeof_ = 0
staticprivate

Definition at line 319 of file LutParser.hpp.

const int torc::LutParser::yyerrcode_ = 256
staticprivate

Definition at line 326 of file LutParser.hpp.

const int torc::LutParser::yyfinal_ = 13
staticprivate

Definition at line 324 of file LutParser.hpp.

const int torc::LutParser::yylast_ = 22
staticprivate

Definition at line 321 of file LutParser.hpp.

location_stack_type torc::LutParser::yylocation_stack_
private

The location stack.

Definition at line 240 of file LutParser.hpp.

const int torc::LutParser::yynnts_ = 7
staticprivate

Definition at line 322 of file LutParser.hpp.

const int torc::LutParser::yyntokens_ = 13
staticprivate

Definition at line 327 of file LutParser.hpp.

const signed char torc::LutParser::yypact_
staticprivate
Initial value:
=
{
-4, -5, -5, -2, -4, 5, -1, 3, 4, -5,
-5, -5, 1, -5, -4, -4, -4, -5, 3, 4,
-5
}

For a state, the index in yytable_ of its portion.

Definition at line 246 of file LutParser.hpp.

const signed char torc::LutParser::yypact_ninf_ = -5
staticprivate

Definition at line 247 of file LutParser.hpp.

const signed char torc::LutParser::yypgoto_
staticprivate
Initial value:
=
{
-5, -5, 9, 0, 2, 6, 12
}

Definition at line 254 of file LutParser.hpp.

const unsigned char torc::LutParser::yyr1_
staticprivate
Initial value:
=
{
0, 13, 14, 15, 15, 16, 16, 17, 17, 18,
18, 19, 19, 19
}

For a rule, its LHS.

Definition at line 271 of file LutParser.hpp.

const unsigned char torc::LutParser::yyr2_
staticprivate
Initial value:
=
{
0, 2, 1, 1, 3, 1, 3, 1, 3, 1,
2, 3, 1, 1
}

For a rule, its RHS length.

Definition at line 273 of file LutParser.hpp.

semantic_stack_type torc::LutParser::yysemantic_stack_
private

The semantic value stack.

Definition at line 238 of file LutParser.hpp.

state_stack_type torc::LutParser::yystate_stack_
private

The state stack.

Definition at line 236 of file LutParser.hpp.

const unsigned char torc::LutParser::yystos_
staticprivate
Initial value:
=
{
0, 4, 5, 8, 11, 14, 15, 16, 17, 18,
19, 19, 15, 0, 7, 9, 6, 10, 16, 17,
18
}

For a state, its accessing symbol.

Definition at line 268 of file LutParser.hpp.

const unsigned char torc::LutParser::yytable_
staticprivate
Initial value:
=
{
1, 2, 1, 2, 3, 13, 14, 4, 14, 4,
16, 17, 15, 12, 18, 11, 0, 19, 0, 0,
0, 0, 20
}

What to do in a state. yytable_[yypact_[s]]: what to do in state s.

  • if positive, shift that token.
  • if negative, reduce the rule which number is the opposite.
  • if zero, do what YYDEFACT says.

Definition at line 262 of file LutParser.hpp.

const signed char torc::LutParser::yytable_ninf_ = -1
staticprivate

Definition at line 263 of file LutParser.hpp.

const int torc::LutParser::yyterror_ = 1
staticprivate

Definition at line 325 of file LutParser.hpp.

const char* const torc::LutParser::yytname_[]
staticprivate

For a symbol, its name in clear.

Definition at line 277 of file LutParser.hpp.

const LutParser::token_number_type torc::LutParser::yyundef_token_ = 2
staticprivate

Definition at line 329 of file LutParser.hpp.

const unsigned int torc::LutParser::yyuser_token_number_max_ = 267
staticprivate

Definition at line 328 of file LutParser.hpp.


The documentation for this class was generated from the following files: