#define MAX_GRAMMAR 601
#define PHRASE_BASE 519
int gram[MAX_GRAMMAR] = {
    4,     1,   513,     1,   581,     1,   517,     5, 17407,    40,   577, 17407,    41,     2,     3, 17407, 
   43,    43,     3, 17407,    45,    45,     1,     2,   519,   522,     6,     6, 17407,    91,   577, 17407, 
   93,   522,     6, 17407,    40,   579, 17407,    41,   523,     4, 17407,    46,   513,   522,     5, 17407, 
   45,    62,   513,   522,     2,   520,   522,     0,     5,     6, 17407,    91,   577, 17407,    93,   522, 
    6, 17407,    40,   579, 17407,    41,   523,     4, 17407,    46,   513,   522,     5, 17407,    45,    62, 
  513,   522,     2,   520,   522,     1,     2,   519,   525,     6,     6, 17407,    91,   577, 17407,    93, 
  525,     6, 17407,    40,   579, 17407,    41,   525,     4, 17407,    46,   513,   525,     5, 17407,    45, 
   62,   513,   525,     2,   520,   525,     0,     3,     2, 17407,   256,     2, 17407,   257,     0,     3, 
    3, 17407,   258,   528,     5, 17407,   259, 17407,   259,   528,     3, 17407,   259,   528,     2,     2, 
17407,   260,     0,     6,     2, 17407,   261,     3,   526, 17407,   262,     2,   526,   527,     2, 17407, 
  263,     2, 17407,   264,     1,   583,     1,     3, 17407,    42,   531,     2,     3, 17407,    42,   531, 
    0,     2,     2, 17407,    43,     2, 17407,    45,     1,     3, 17407,    33,   534,     2,     3, 17407, 
   33,   534,     0,     1,     3, 17407,   126,   536,     2,     3, 17407,   126,   536,     0,     1,     2, 
17407,    38,     2,     3, 17407,    43,    43,     3, 17407,    45,    45,     2,     6, 17407,    40,   529, 
17407,    41,   539,     1,   541,     2,     6, 17407,    40,   529, 17407,    41,   540,     1,   524,     8, 
    2,   532,   539,     2,   533,   539,     2,   535,   539,     2,   530,   544,     3, 17407,   265,   541, 
    3, 17407,   265,   543,     3, 17407,   265,   529,     1,   540,     2,     6, 17407,    40,   529, 17407, 
   41,   542,     1,   543,     3,     2,   538,   543,     2,   530,   544,     1,   521,     1,     2,   537, 
  542,     1,     2,   541,   546,     2,     3,   547,   541,   546,     0,     3,     2, 17407,    42,     2, 
17407,    47,     2, 17407,    37,     1,     2,   545,   549,     2,     3,   550,   545,   549,     0,     2, 
    2, 17407,    43,     2, 17407,    45,     1,     2,   548,   552,     2,     3,   553,   548,   552,     0, 
    2,     3, 17407,    60,    60,     3, 17407,    62,    62,     1,     2,   551,   555,     2,     3,   556, 
  551,   555,     0,     4,     3, 17407,    60,    61,     2, 17407,    60,     3, 17407,    62,    61,     2, 
17407,    62,     1,     2,   554,   558,     2,     3,   559,   554,   558,     0,     2,     3, 17407,    61, 
   61,     3, 17407,    33,    61,     1,     2,   557,   561,     2,     4, 17407,    38,   557,   561,     0, 
    1,     2,   560,   563,     2,     4, 17407,    94,   560,   563,     0,     1,     2,   562,   565,     2, 
    4, 17407,   124,   562,   565,     0,     1,     2,   564,   567,     2,     5, 17407,    38,    38,   564, 
  567,     0,     1,     2,   566,   569,     2,     5, 17407,   124,   124,   566,   569,     0,     1,     2, 
  568,   571,     2,     6, 17407,    63,   577, 17407,    58,   570,     0,     1,     2,   573,   570,     2, 
    2,   543,   574,     0,    11,     2, 17407,    61,     3, 17407,    42,    61,     3, 17407,    47,    61, 
    3, 17407,    37,    61,     3, 17407,    43,    61,     3, 17407,    45,    61,     4, 17407,    60,    60, 
   61,     4, 17407,    62,    62,    61,     3, 17407,    38,    61,     3, 17407,    94,    61,     3, 17407, 
  124,    61,     1,     2,   572,   576,     2,     4, 17407,    44,   572,   576,     0,     1,     1,   575, 
    1,     1,   570,     2,     2,   572,   580,     0,     2,     4, 17407,    44,   572,   580,     0,     4, 
    1,   514,     1,   515,     1,   516,     1,   582,     1,     1,   513,     1,     1,   513,     4,     4, 
  585, 17407,    58,   584,     6, 17407,   266,   578, 17407,    58,   584,     5, 17407,   267, 17407,    58, 
  584,     0,     1,     1,   513,     3,    10,   584, 17407,   268, 17407,    40,   577, 17407,    41, 17407, 
  123,     2, 17407,   125,     4,   584,   577, 17407,    59, 
};

#define MAX_KEYWORD 13
char *keyword[MAX_KEYWORD] = { // Keywords are based at 256
  "signed", "unsigned", "short", "long", 
  "int", "void", "char", "float", 
  "double", "sizeof", "case", "default", 
  "if", 
};

#define MAX_BIP 7
int BIP[MAX_BIP] = { // BIPs precede PHRASEs at 512 upwards
 0,  1,  2,  3,  4,  5,  6, 
};

#define MAX_PHRASE 75
#if defined(DEBUG_PARSER) || defined(EXTENDED_ERROR_REPORTING)
// FOR DEBUGGING ONLY
char *phrasename[MAX_PHRASE] = { // Based at 512 upwards
  "char", "identifier", "integer-constant", "character-constant", 
  "floating-constant", "string", "EOF", "primary-expression", 
  "post-increment-op", "postfix-lvalue-expression", "rest-of-postfix-expression", "non-empty-rest-of-postfix-expression", 
  "postfix-rvalue-expression", "rest-of-postfix-rvalue-expression", "signed", "inttype", 
  "int", "type-specifier", "indirection-unary-ops", "rest-of-indirection-unary-ops", 
  "arithmetic-unary-op", "boolean-unary-ops", "rest-of-boolean-unary-ops", "bitwise-unary-ops", 
  "rest-of-bitwise-unary-ops", "address-operator", "pre-increment-op", "optionally-cast-unary-rvalue-expression", 
  "optionally-cast-postfix-rvalue-expression", "unary-rvalue-expression", "optionally-cast-unary-lvalue-expression", "unary-lvalue-expression", 
  "unary-address-expression", "multiplicative-expression", "rest-of-multiplicative-expression", "mulop", 
  "additive-expression", "rest-of-additive-expression", "plusminus", "shift-expression", 
  "rest-of-shift-expression", "shiftop", "relational-expression", "rest-of-relational-expression", 
  "relop", "equality-expression", "rest-of-equality-expression", "eqop", 
  "bitwise-and-expression", "rest-of-bitwise-and-expression", "exclusive-or-expression", "rest-of-exclusive-or-expression", 
  "inclusive-or-expression", "rest-of-inclusive-or-expression", "logical-and-expression", "rest-of-logical-and-expression", 
  "logical-or-expression", "rest-of-logical-or-expression", "conditional-expression", "rest-of-conditional-expression", 
  "assignment-expression", "opt-lvalue-assign", "assignment-operator", "comma-statement", 
  "rest-of-comma-statement", "expression", "constant-expression", "param-list", 
  "rest-of-param-list", "constant", "enumeration-constant", "typedef-name", 
  "opt-labels", "label", "SS", 
};
#endif /* DEBUG_PARSER */

int phrase_start[MAX_PHRASE-MAX_BIP] = {
    0,    13,    22,    26,    56,    85,    89,   119,   127, 
  142,   147,   166,   171,   177,   184,   189,   195,   200,   206,   210,   219,   229,   239,   266,   276, 
  285,   289,   293,   299,   309,   313,   319,   326,   330,   336,   345,   349,   355,   370,   374,   380, 
  389,   393,   400,   404,   411,   415,   422,   426,   434,   438,   446,   450,   459,   463,   468,   514, 
  518,   525,   528,   531,   536,   543,   552,   555,   558,   578,   581, 
};

#define P_char 512
#define B_char 0

#define P_identifier 513
#define B_identifier 1

#define P_integer_constant 514
#define B_integer_constant 2

#define P_character_constant 515
#define B_character_constant 3

#define P_floating_constant 516
#define B_floating_constant 4

#define P_string 517
#define B_string 5

#define P_EOF 518
#define B_EOF 6

#define P_primary_expression 519
#define P_post_increment_op 520
#define P_postfix_lvalue_expression 521
#define P_rest_of_postfix_expression 522
#define P_non_empty_rest_of_postfix_expression 523
#define P_postfix_rvalue_expression 524
#define P_rest_of_postfix_rvalue_expression 525
#define P_signed 526
#define P_inttype 527
#define P_int 528
#define P_type_specifier 529
#define P_indirection_unary_ops 530
#define P_rest_of_indirection_unary_ops 531
#define P_arithmetic_unary_op 532
#define P_boolean_unary_ops 533
#define P_rest_of_boolean_unary_ops 534
#define P_bitwise_unary_ops 535
#define P_rest_of_bitwise_unary_ops 536
#define P_address_operator 537
#define P_pre_increment_op 538
#define P_optionally_cast_unary_rvalue_expression 539
#define P_optionally_cast_postfix_rvalue_expression 540
#define P_unary_rvalue_expression 541
#define P_optionally_cast_unary_lvalue_expression 542
#define P_unary_lvalue_expression 543
#define P_unary_address_expression 544
#define P_multiplicative_expression 545
#define P_rest_of_multiplicative_expression 546
#define P_mulop 547
#define P_additive_expression 548
#define P_rest_of_additive_expression 549
#define P_plusminus 550
#define P_shift_expression 551
#define P_rest_of_shift_expression 552
#define P_shiftop 553
#define P_relational_expression 554
#define P_rest_of_relational_expression 555
#define P_relop 556
#define P_equality_expression 557
#define P_rest_of_equality_expression 558
#define P_eqop 559
#define P_bitwise_and_expression 560
#define P_rest_of_bitwise_and_expression 561
#define P_exclusive_or_expression 562
#define P_rest_of_exclusive_or_expression 563
#define P_inclusive_or_expression 564
#define P_rest_of_inclusive_or_expression 565
#define P_logical_and_expression 566
#define P_rest_of_logical_and_expression 567
#define P_logical_or_expression 568
#define P_rest_of_logical_or_expression 569
#define P_conditional_expression 570
#define P_rest_of_conditional_expression 571
#define P_assignment_expression 572
#define P_opt_lvalue_assign 573
#define P_assignment_operator 574
#define P_comma_statement 575
#define P_rest_of_comma_statement 576
#define P_expression 577
#define P_constant_expression 578
#define P_param_list 579
#define P_rest_of_param_list 580
#define P_constant 581
#define P_enumeration_constant 582
#define P_typedef_name 583
#define P_opt_labels 584
#define P_label 585
#define P_SS 586
