Esempio n. 1
0
/*
** Perform a reduce action and the shift that must immediately
** follow the reduce.
*/
static void aa_reduce(
  aaParser *aapParser,         /* The parser */
  int aaruleno                 /* Number of the rule by which to reduce */
){
  int aagoto;                     /* The next state */
  int aaact;                      /* The next action */
  AAMINORTYPE aagotominor;        /* The LHS of the rule reduced */
  aaStackEntry *aamsp;            /* The top of the parser's stack */
  int aasize;                     /* Amount to pop the stack */
  phannot_ARG_FETCH;
  aamsp = &aapParser->aastack[aapParser->aaidx];
#ifndef NDEBUG
  if( aaTraceFILE && aaruleno>=0 
        && aaruleno<sizeof(aaRuleName)/sizeof(aaRuleName[0]) ){
    fprintf(aaTraceFILE, "%sReduce [%s].\n", aaTracePrompt,
      aaRuleName[aaruleno]);
  }
#endif /* NDEBUG */

  switch( aaruleno ){
  /* Beginning here are the reduction cases.  A typical example
  ** follows:
  **   case 0:
  **  // <lineno> <grammarfile>
  **     { ... }           // User supplied code
  **  // <lineno> <thisfile>
  **     break;
  */
      case 0:
// 205 "parser.lemon"
{
	status->ret = aamsp[0].minor.aa36;
}
// 751 "parser.c"
        break;
      case 1:
      case 14:
      case 15:
// 211 "parser.lemon"
{
	aagotominor.aa36 = aamsp[0].minor.aa36;
}
// 760 "parser.c"
        break;
      case 2:
// 217 "parser.lemon"
{
	aagotominor.aa36 = phannot_ret_zval_list(aamsp[-1].minor.aa36, aamsp[0].minor.aa36);
}
// 767 "parser.c"
        break;
      case 3:
      case 8:
// 221 "parser.lemon"
{
	aagotominor.aa36 = phannot_ret_zval_list(NULL, aamsp[0].minor.aa36);
}
// 775 "parser.c"
        break;
      case 4:
// 228 "parser.lemon"
{
	aagotominor.aa36 = phannot_ret_annotation(aamsp[-3].minor.aa0, aamsp[-1].minor.aa36, status->scanner_state);
  aa_destructor(2,&aamsp[-4].minor);
  aa_destructor(4,&aamsp[-2].minor);
  aa_destructor(5,&aamsp[0].minor);
}
// 785 "parser.c"
        break;
      case 5:
// 232 "parser.lemon"
{
	aagotominor.aa36 = phannot_ret_annotation(aamsp[-2].minor.aa0, NULL, status->scanner_state);
  aa_destructor(2,&aamsp[-3].minor);
  aa_destructor(4,&aamsp[-1].minor);
  aa_destructor(5,&aamsp[0].minor);
}
// 795 "parser.c"
        break;
      case 6:
// 236 "parser.lemon"
{
	aagotominor.aa36 = phannot_ret_annotation(aamsp[0].minor.aa0, NULL, status->scanner_state);
  aa_destructor(2,&aamsp[-1].minor);
}
// 803 "parser.c"
        break;
      case 7:
// 242 "parser.lemon"
{
	aagotominor.aa36 = phannot_ret_zval_list(aamsp[-2].minor.aa36, aamsp[0].minor.aa36);
  aa_destructor(1,&aamsp[-1].minor);
}
// 811 "parser.c"
        break;
      case 9:
// 252 "parser.lemon"
{
	aagotominor.aa36 = phannot_ret_named_item(NULL, aamsp[0].minor.aa36);
}
// 818 "parser.c"
        break;
      case 10:
      case 12:
// 256 "parser.lemon"
{
	aagotominor.aa36 = phannot_ret_named_item(aamsp[-2].minor.aa0, aamsp[0].minor.aa36);
  aa_destructor(7,&aamsp[-1].minor);
}
// 827 "parser.c"
        break;
      case 11:
      case 13:
// 260 "parser.lemon"
{
	aagotominor.aa36 = phannot_ret_named_item(aamsp[-2].minor.aa0, aamsp[0].minor.aa36);
  aa_destructor(8,&aamsp[-1].minor);
}
// 836 "parser.c"
        break;
      case 16:
// 282 "parser.lemon"
{
	aagotominor.aa36 = phannot_ret_literal_zval(PHANNOT_T_IDENTIFIER, aamsp[0].minor.aa0);
}
// 843 "parser.c"
        break;
      case 17:
// 286 "parser.lemon"
{
	aagotominor.aa36 = phannot_ret_literal_zval(PHANNOT_T_INTEGER, aamsp[0].minor.aa0);
}
// 850 "parser.c"
        break;
      case 18:
// 290 "parser.lemon"
{
	aagotominor.aa36 = phannot_ret_literal_zval(PHANNOT_T_STRING, aamsp[0].minor.aa0);
}
// 857 "parser.c"
        break;
      case 19:
// 294 "parser.lemon"
{
	aagotominor.aa36 = phannot_ret_literal_zval(PHANNOT_T_DOUBLE, aamsp[0].minor.aa0);
}
// 864 "parser.c"
        break;
      case 20:
// 298 "parser.lemon"
{
	aagotominor.aa36 = phannot_ret_literal_zval(PHANNOT_T_NULL, NULL);
  aa_destructor(11,&aamsp[0].minor);
}
// 872 "parser.c"
        break;
      case 21:
// 302 "parser.lemon"
{
	aagotominor.aa36 = phannot_ret_literal_zval(PHANNOT_T_FALSE, NULL);
  aa_destructor(12,&aamsp[0].minor);
}
// 880 "parser.c"
        break;
      case 22:
// 306 "parser.lemon"
{
	aagotominor.aa36 = phannot_ret_literal_zval(PHANNOT_T_TRUE, NULL);
  aa_destructor(13,&aamsp[0].minor);
}
// 888 "parser.c"
        break;
      case 23:
// 310 "parser.lemon"
{
	aagotominor.aa36 = phannot_ret_array(aamsp[-1].minor.aa36);
  aa_destructor(14,&aamsp[-2].minor);
  aa_destructor(15,&aamsp[0].minor);
}
// 897 "parser.c"
        break;
      case 24:
// 314 "parser.lemon"
{
	aagotominor.aa36 = phannot_ret_array(aamsp[-1].minor.aa36);
  aa_destructor(16,&aamsp[-2].minor);
  aa_destructor(17,&aamsp[0].minor);
}
// 906 "parser.c"
        break;
  };
  aagoto = aaRuleInfo[aaruleno].lhs;
  aasize = aaRuleInfo[aaruleno].nrhs;
  aapParser->aaidx -= aasize;
  aaact = aa_find_reduce_action(aapParser,aagoto);
  if( aaact < AANSTATE ){
    aa_shift(aapParser,aaact,aagoto,&aagotominor);
  }else if( aaact == AANSTATE + AANRULE + 1 ){
    aa_accept(aapParser);
  }
}
Esempio n. 2
0
/*
** Perform a reduce action and the shift that must immediately
** follow the reduce.
*/
static void jj_reduce(
  jjParser *jjpParser,         /* The parser */
  int jjruleno                 /* Number of the rule by which to reduce */
){
  int jjgoto;                     /* The next state */
  int jjact;                      /* The next action */
  JJMINORTYPE jjgotominor;        /* The LHS of the rule reduced */
  jjStackEntry *jjmsp;            /* The top of the parser's stack */
  int jjsize;                     /* Amount to pop the stack */
  phannot_ARG_FETCH;
  jjmsp = &jjpParser->jjstack[jjpParser->jjidx];
#ifndef NDEBUG
  if( jjTraceFILE && jjruleno>=0 
        && jjruleno<sizeof(jjRuleName)/sizeof(jjRuleName[0]) ){
    fprintf(jjTraceFILE, "%sReduce [%s].\n", jjTracePrompt,
      jjRuleName[jjruleno]);
  }
#endif /* NDEBUG */

  switch( jjruleno ){
  /* Beginning here are the reduction cases.  A typical example
  ** follows:
  **   case 0:
  **  // <lineno> <grammarfile>
  **     { ... }           // User supplied code
  **  // <lineno> <thisfile>
  **     break;
  */
      case 0:
// 231 "parser.lemon"
{
	status->ret = jjmsp[0].minor.jj36;
}
// 759 "parser.c"
        break;
      case 1:
      case 14:
      case 15:
// 237 "parser.lemon"
{
	jjgotominor.jj36 = jjmsp[0].minor.jj36;
}
// 768 "parser.c"
        break;
      case 2:
// 243 "parser.lemon"
{
	jjgotominor.jj36 = phannot_ret_zval_list(jjmsp[-1].minor.jj36, jjmsp[0].minor.jj36);
}
// 775 "parser.c"
        break;
      case 3:
      case 8:
// 247 "parser.lemon"
{
	jjgotominor.jj36 = phannot_ret_zval_list(NULL, jjmsp[0].minor.jj36);
}
// 783 "parser.c"
        break;
      case 4:
// 254 "parser.lemon"
{
	jjgotominor.jj36 = phannot_ret_annotation(jjmsp[-3].minor.jj0, jjmsp[-1].minor.jj36, status->scanner_state);
  jj_destructor(2,&jjmsp[-4].minor);
  jj_destructor(4,&jjmsp[-2].minor);
  jj_destructor(5,&jjmsp[0].minor);
}
// 793 "parser.c"
        break;
      case 5:
// 258 "parser.lemon"
{
	jjgotominor.jj36 = phannot_ret_annotation(jjmsp[-2].minor.jj0, NULL, status->scanner_state);
  jj_destructor(2,&jjmsp[-3].minor);
  jj_destructor(4,&jjmsp[-1].minor);
  jj_destructor(5,&jjmsp[0].minor);
}
// 803 "parser.c"
        break;
      case 6:
// 262 "parser.lemon"
{
	jjgotominor.jj36 = phannot_ret_annotation(jjmsp[0].minor.jj0, NULL, status->scanner_state);
  jj_destructor(2,&jjmsp[-1].minor);
}
// 811 "parser.c"
        break;
      case 7:
// 268 "parser.lemon"
{
	jjgotominor.jj36 = phannot_ret_zval_list(jjmsp[-2].minor.jj36, jjmsp[0].minor.jj36);
  jj_destructor(1,&jjmsp[-1].minor);
}
// 819 "parser.c"
        break;
      case 9:
// 278 "parser.lemon"
{
	jjgotominor.jj36 = phannot_ret_named_item(NULL, jjmsp[0].minor.jj36);
}
// 826 "parser.c"
        break;
      case 10:
      case 12:
// 282 "parser.lemon"
{
	jjgotominor.jj36 = phannot_ret_named_item(jjmsp[-2].minor.jj0, jjmsp[0].minor.jj36);
  jj_destructor(7,&jjmsp[-1].minor);
}
// 835 "parser.c"
        break;
      case 11:
      case 13:
// 286 "parser.lemon"
{
	jjgotominor.jj36 = phannot_ret_named_item(jjmsp[-2].minor.jj0, jjmsp[0].minor.jj36);
  jj_destructor(8,&jjmsp[-1].minor);
}
// 844 "parser.c"
        break;
      case 16:
// 308 "parser.lemon"
{
	jjgotominor.jj36 = phannot_ret_literal_zval(PHANNOT_T_IDENTIFIER, jjmsp[0].minor.jj0);
}
// 851 "parser.c"
        break;
      case 17:
// 312 "parser.lemon"
{
	jjgotominor.jj36 = phannot_ret_literal_zval(PHANNOT_T_INTEGER, jjmsp[0].minor.jj0);
}
// 858 "parser.c"
        break;
      case 18:
// 316 "parser.lemon"
{
	jjgotominor.jj36 = phannot_ret_literal_zval(PHANNOT_T_STRING, jjmsp[0].minor.jj0);
}
// 865 "parser.c"
        break;
      case 19:
// 320 "parser.lemon"
{
	jjgotominor.jj36 = phannot_ret_literal_zval(PHANNOT_T_DOUBLE, jjmsp[0].minor.jj0);
}
// 872 "parser.c"
        break;
      case 20:
// 324 "parser.lemon"
{
	jjgotominor.jj36 = phannot_ret_literal_zval(PHANNOT_T_NULL, NULL);
  jj_destructor(11,&jjmsp[0].minor);
}
// 880 "parser.c"
        break;
      case 21:
// 328 "parser.lemon"
{
	jjgotominor.jj36 = phannot_ret_literal_zval(PHANNOT_T_FALSE, NULL);
  jj_destructor(12,&jjmsp[0].minor);
}
// 888 "parser.c"
        break;
      case 22:
// 332 "parser.lemon"
{
	jjgotominor.jj36 = phannot_ret_literal_zval(PHANNOT_T_TRUE, NULL);
  jj_destructor(13,&jjmsp[0].minor);
}
// 896 "parser.c"
        break;
      case 23:
// 336 "parser.lemon"
{
	jjgotominor.jj36 = phannot_ret_array(jjmsp[-1].minor.jj36);
  jj_destructor(14,&jjmsp[-2].minor);
  jj_destructor(15,&jjmsp[0].minor);
}
// 905 "parser.c"
        break;
      case 24:
// 340 "parser.lemon"
{
	jjgotominor.jj36 = phannot_ret_array(jjmsp[-1].minor.jj36);
  jj_destructor(16,&jjmsp[-2].minor);
  jj_destructor(17,&jjmsp[0].minor);
}
// 914 "parser.c"
        break;
  };
  jjgoto = jjRuleInfo[jjruleno].lhs;
  jjsize = jjRuleInfo[jjruleno].nrhs;
  jjpParser->jjidx -= jjsize;
  jjact = jj_find_reduce_action(jjpParser,jjgoto);
  if( jjact < JJNSTATE ){
    jj_shift(jjpParser,jjact,jjgoto,&jjgotominor);
  }else if( jjact == JJNSTATE + JJNRULE + 1 ){
    jj_accept(jjpParser);
  }
}
Esempio n. 3
0
/*
** Perform a reduce action and the shift that must immediately
** follow the reduce.
*/
static void yy_reduce(
  yyParser *yypParser,         /* The parser */
  int yyruleno                 /* Number of the rule by which to reduce */
){
  int yygoto;                     /* The next state */
  int yyact;                      /* The next action */
  YYMINORTYPE yygotominor;        /* The LHS of the rule reduced */
  yyStackEntry *yymsp;            /* The top of the parser's stack */
  int yysize;                     /* Amount to pop the stack */
  phannot_ARG_FETCH;
  yymsp = &yypParser->yystack[yypParser->yyidx];
#ifndef NDEBUG
  if( yyTraceFILE && yyruleno>=0 
        && yyruleno<sizeof(yyRuleName)/sizeof(yyRuleName[0]) ){
    fprintf(yyTraceFILE, "%sReduce [%s].\n", yyTracePrompt,
      yyRuleName[yyruleno]);
  }
#endif /* NDEBUG */

  switch( yyruleno ){
  /* Beginning here are the reduction cases.  A typical example
  ** follows:
  **   case 0:
  **  #line <lineno> <grammarfile>
  **     { ... }           // User supplied code
  **  #line <lineno> <thisfile>
  **     break;
  */
      case 0:
#line 86 "parser.php5.lemon"
{
	status->ret = yymsp[0].minor.yy36;
}
#line 632 "parser.php5.c"
        break;
      case 1:
      case 14:
      case 15:
#line 94 "parser.php5.lemon"
{
	yygotominor.yy36 = yymsp[0].minor.yy36;
}
#line 641 "parser.php5.c"
        break;
      case 2:
#line 102 "parser.php5.lemon"
{
	yygotominor.yy36 = phannot_ret_zval_list(yymsp[-1].minor.yy36, yymsp[0].minor.yy36);
}
#line 648 "parser.php5.c"
        break;
      case 3:
      case 8:
#line 106 "parser.php5.lemon"
{
	yygotominor.yy36 = phannot_ret_zval_list(NULL, yymsp[0].minor.yy36);
}
#line 656 "parser.php5.c"
        break;
      case 4:
#line 114 "parser.php5.lemon"
{
	yygotominor.yy36 = phannot_ret_annotation(yymsp[-3].minor.yy0, yymsp[-1].minor.yy36, status->scanner_state);
  yy_destructor(2,&yymsp[-4].minor);
  yy_destructor(4,&yymsp[-2].minor);
  yy_destructor(5,&yymsp[0].minor);
}
#line 666 "parser.php5.c"
        break;
      case 5:
#line 118 "parser.php5.lemon"
{
	yygotominor.yy36 = phannot_ret_annotation(yymsp[-2].minor.yy0, NULL, status->scanner_state);
  yy_destructor(2,&yymsp[-3].minor);
  yy_destructor(4,&yymsp[-1].minor);
  yy_destructor(5,&yymsp[0].minor);
}
#line 676 "parser.php5.c"
        break;
      case 6:
#line 122 "parser.php5.lemon"
{
	yygotominor.yy36 = phannot_ret_annotation(yymsp[0].minor.yy0, NULL, status->scanner_state);
  yy_destructor(2,&yymsp[-1].minor);
}
#line 684 "parser.php5.c"
        break;
      case 7:
#line 130 "parser.php5.lemon"
{
	yygotominor.yy36 = phannot_ret_zval_list(yymsp[-2].minor.yy36, yymsp[0].minor.yy36);
  yy_destructor(1,&yymsp[-1].minor);
}
#line 692 "parser.php5.c"
        break;
      case 9:
#line 142 "parser.php5.lemon"
{
	yygotominor.yy36 = phannot_ret_named_item(NULL, yymsp[0].minor.yy36);
}
#line 699 "parser.php5.c"
        break;
      case 10:
      case 12:
#line 146 "parser.php5.lemon"
{
	yygotominor.yy36 = phannot_ret_named_item(yymsp[-2].minor.yy0, yymsp[0].minor.yy36);
  yy_destructor(7,&yymsp[-1].minor);
}
#line 708 "parser.php5.c"
        break;
      case 11:
      case 13:
#line 150 "parser.php5.lemon"
{
	yygotominor.yy36 = phannot_ret_named_item(yymsp[-2].minor.yy0, yymsp[0].minor.yy36);
  yy_destructor(8,&yymsp[-1].minor);
}
#line 717 "parser.php5.c"
        break;
      case 16:
#line 174 "parser.php5.lemon"
{
	yygotominor.yy36 = phannot_ret_literal_zval(PHANNOT_T_IDENTIFIER, yymsp[0].minor.yy0);
}
#line 724 "parser.php5.c"
        break;
      case 17:
#line 178 "parser.php5.lemon"
{
	yygotominor.yy36 = phannot_ret_literal_zval(PHANNOT_T_INTEGER, yymsp[0].minor.yy0);
}
#line 731 "parser.php5.c"
        break;
      case 18:
#line 182 "parser.php5.lemon"
{
	yygotominor.yy36 = phannot_ret_literal_zval(PHANNOT_T_STRING, yymsp[0].minor.yy0);
}
#line 738 "parser.php5.c"
        break;
      case 19:
#line 186 "parser.php5.lemon"
{
	yygotominor.yy36 = phannot_ret_literal_zval(PHANNOT_T_DOUBLE, yymsp[0].minor.yy0);
}
#line 745 "parser.php5.c"
        break;
      case 20:
#line 190 "parser.php5.lemon"
{
	yygotominor.yy36 = phannot_ret_literal_zval(PHANNOT_T_NULL, NULL);
  yy_destructor(11,&yymsp[0].minor);
}
#line 753 "parser.php5.c"
        break;
      case 21:
#line 194 "parser.php5.lemon"
{
	yygotominor.yy36 = phannot_ret_literal_zval(PHANNOT_T_FALSE, NULL);
  yy_destructor(12,&yymsp[0].minor);
}
#line 761 "parser.php5.c"
        break;
      case 22:
#line 198 "parser.php5.lemon"
{
	yygotominor.yy36 = phannot_ret_literal_zval(PHANNOT_T_TRUE, NULL);
  yy_destructor(13,&yymsp[0].minor);
}
#line 769 "parser.php5.c"
        break;
      case 23:
#line 202 "parser.php5.lemon"
{
	yygotominor.yy36 = phannot_ret_array(yymsp[-1].minor.yy36);
  yy_destructor(14,&yymsp[-2].minor);
  yy_destructor(15,&yymsp[0].minor);
}
#line 778 "parser.php5.c"
        break;
      case 24:
#line 206 "parser.php5.lemon"
{
	yygotominor.yy36 = phannot_ret_array(yymsp[-1].minor.yy36);
  yy_destructor(16,&yymsp[-2].minor);
  yy_destructor(17,&yymsp[0].minor);
}
#line 787 "parser.php5.c"
        break;
  };
  yygoto = yyRuleInfo[yyruleno].lhs;
  yysize = yyRuleInfo[yyruleno].nrhs;
  yypParser->yyidx -= yysize;
  yyact = yy_find_reduce_action(yypParser,yygoto);
  if( yyact < YYNSTATE ){
    yy_shift(yypParser,yyact,yygoto,&yygotominor);
  }else if( yyact == YYNSTATE + YYNRULE + 1 ){
    yy_accept(yypParser);
  }
}