/****************************************************************************
* U N R E G I S T E R E D C O P Y
*
* You are on day 43 of your 30 day trial period.
*
* This file was produced by an UNREGISTERED COPY of Parser Generator. It is
* for evaluation purposes only. If you continue to use Parser Generator 30
* days after installation then you are required to purchase a license. For
* more information see the online help or go to the Bumble-Bee Software
* homepage at:
*
* http://www.bumblebeesoftware.com
*
* This notice must remain present in the file. It cannot be removed.
****************************************************************************/
/****************************************************************************
* _parser.c
* C source file generated from _parser.y.
*
* Date: 11/28/16
* Time: 17:30:36
*
* AYACC Version: 2.07
****************************************************************************/
#include <yypars.h>
/* namespaces */
#if defined(__cplusplus) && defined(YYSTDCPPLIB)
using namespace std;
#endif
#if defined(__cplusplus) && defined(YYNAMESPACE)
using namespace yl;
#endif
#define YYFASTPARSER
#line 1 ".\\_parser.y"
/****************************************************************************
_parser.y
ParserWizard generated YACC file.
Date: 2016Äê11ÔÂ13ÈÕ
****************************************************************************/
#include "_lexer.h"
#include "PaserTree.h"
#include<assert.h>
_lineno=1;
static TreeNode * savedTree;
static int temp_var;
#line 60 "_parser.c"
/* repeated because of possible precompiled header */
#include <yypars.h>
/* namespaces */
#if defined(__cplusplus) && defined(YYSTDCPPLIB)
using namespace std;
#endif
#if defined(__cplusplus) && defined(YYNAMESPACE)
using namespace yl;
#endif
#define YYFASTPARSER
#include ".\_parser.h"
#ifndef YYSTYPE
#define YYSTYPE int
#endif
#ifndef YYSTACK_SIZE
#define YYSTACK_SIZE 100
#endif
#ifndef YYSTACK_MAX
#define YYSTACK_MAX 0
#endif
/* (state) stack */
#if (YYSTACK_SIZE) != 0
static yystack_t YYNEAR yystack[(YYSTACK_SIZE)];
yystack_t YYFAR *YYNEAR YYDCDECL yysstackptr = yystack;
yystack_t YYFAR *YYNEAR YYDCDECL yystackptr = yystack;
#else
yystack_t YYFAR *YYNEAR YYDCDECL yysstackptr = NULL;
yystack_t YYFAR *YYNEAR YYDCDECL yystackptr = NULL;
#endif
/* attribute stack */
#if (YYSTACK_SIZE) != 0
static YYSTYPE YYNEAR yyattributestack[(YYSTACK_SIZE)];
#ifdef YYPROTOTYPE
void YYFAR *YYNEAR YYDCDECL yysattributestackptr = yyattributestack;
void YYFAR *YYNEAR YYDCDECL yyattributestackptr = yyattributestack;
#else
char YYFAR *YYNEAR YYDCDECL yysattributestackptr = (char YYFAR *) yyattributestack;
char YYFAR *YYNEAR YYDCDECL yyattributestackptr = (char YYFAR *) yyattributestack;
#endif
#else
#ifdef YYPROTOTYPE
void YYFAR *YYNEAR YYDCDECL yysattributestackptr = NULL;
void YYFAR *YYNEAR YYDCDECL yyattributestackptr = NULL;
#else
char YYFAR *YYNEAR YYDCDECL yysattributestackptr = NULL;
char YYFAR *YYNEAR YYDCDECL yyattributestackptr = NULL;
#endif
#endif
int YYNEAR YYDCDECL yysstack_size = (YYSTACK_SIZE);
int YYNEAR YYDCDECL yystack_size = (YYSTACK_SIZE);
int YYNEAR YYDCDECL yystack_max = (YYSTACK_MAX);
/* attributes */
YYSTYPE YYNEAR yyval;
YYSTYPE YYNEAR yylval;
#ifdef YYPROTOTYPE
void YYFAR *YYNEAR YYDCDECL yyvalptr = &yyval;
void YYFAR *YYNEAR YYDCDECL yylvalptr = &yylval;
#else
char YYFAR *YYNEAR YYDCDECL yyvalptr = (char *) &yyval;
char YYFAR *YYNEAR YYDCDECL yylvalptr = (char *) &yylval;
#endif
size_t YYNEAR YYDCDECL yyattribute_size = sizeof(YYSTYPE);
/* yyattribute */
#ifdef YYDEBUG
#ifdef YYPROTOTYPE
static YYSTYPE YYFAR *yyattribute1(int index)
#else
static YYSTYPE YYFAR *yyattribute1(index)
int index;
#endif
{
YYSTYPE YYFAR *p = &((YYSTYPE YYFAR *) yyattributestackptr)[yytop + index];
return p;
}
#define yyattribute(index) (*yyattribute1(index))
#else
#define yyattribute(index) (((YYSTYPE YYFAR *) yyattributestackptr)[yytop + (index)])
#endif
#ifdef YYDEBUG
#ifdef YYPROTOTYPE
static void yyinitdebug(YYSTYPE YYFAR **p, int count)
#else
static void yyinitdebug(p, count)
YYSTYPE YYFAR **p;
int count;
#endif
{
int i;
yyassert(p != NULL);
yyassert(count >= 1);
for (i = 0; i < count; i++) {
p[i] = &((YYSTYPE YYFAR *) yyattributestackptr)[yytop + i - (count - 1)];
}
}
#endif
#ifdef YYPROTOTYPE
void YYCDECL yyparseraction(int action)
#else
void YYCDECL yyparseraction(action)
int action;
#endif
{
switch (action) {
case 0:
{
#ifdef YYDEBUG
YYSTYPE YYFAR *yya[7];
yyinitdebug(yya, 7);
#endif
{
#line 110 ".\\_parser.y"
//cprintf("pro\n");
savedTree = yyattribute(5 - 6);
#line 187 "_parser.c"
}
}
break;
case 1:
{
#ifdef YYDEBUG
YYSTYPE YYFAR *yya[3];
yyinitdebug(yya, 3);
#endif
{
#line 114 ".\\_parser.y"
//scprintf("int\n");
yyval=newStmtNode(StemtOrderK);
yyval->child[0]=yyattribute(1 - 2);
yyval->child[1]=yyattribute(2 - 2);
#line 205 "_parser.c"
}
}
break;
case 2:
{
#ifdef YYDEBUG
YYSTYPE YYFAR *yya[2];
yyinitdebug(yya, 2);
#endif
{
#line 120 ".\\_parser.y"
yyval = yyattribute(1 - 1);
#line 218 "_parser.c"
}
}
break;
case 3:
{
#ifdef YYDEBUG
YYSTYPE YYFAR *yya[1];
yyinitdebug(yya, 1);
#endif
{
#line 121 ".\\_parser.y"
yyval=newStmtNode(EmptyStmtK);
#line 231 "_parser.c"
}
}
break;
case 4:
{
#ifdef YYDEBUG
YYSTYPE YYFAR *yya[2];
yyinitdebug(yya, 2);
#endif
{
#line 124 ".\\_parser.y"
yyval = yyattribute(1 - 1);
#line 244 "_parser.c"
}
}
break;
case 5:
{
#ifdef YYDEBUG
YYSTYPE YYFAR *yya[2];
yyinitdebug(yya, 2);
#endif
{
#line 125 ".\\_parser.y"
yyval = yyattribute(1 - 1);
#line 257 "_parser.c"
}
}
break;
case 6:
{
#ifdef YYDEBUG
YYSTYPE YYFAR *yya[2];
yyinitdebug(yya, 2);
#endif
{
#line 126 ".\\_parser.y"
yyval = yyattribute(1 - 1);
#line 270 "_parser.c"
}
}
break;
case 7:
{
#ifdef YYDEBUG
YYSTYPE YYFAR *yya[2];
yyinitdebug(yya, 2);
#endif
{
#line 127 ".\\_parser.y"
yyval = yyattribute(1 - 1);
#line 283 "_parser.c"
}
}
break;
case 8:
{
#ifdef YYDEBUG
YYSTYPE YYFAR *yya[3];
yyinitdebug(yya, 3);
#endif
{
#line 128 ".\\_parser.y"
yyval = yyattribute(1 - 2);
#line 296 "_parser.c"
}
}
break;
case 9:
{
#ifdef YYDEBUG
YYSTYPE YYFAR *yya[2];
yyinitdebug(yya, 2);
#endif
{
#line 129 ".\\_parser.y"
yyval=yyattribute(1 - 1);
#line 309 "_parser.c"
}
}
break;
case 10:
{
#ifdef YYDEBUG
YYSTYPE YYFAR *yya[3];
yyinitdebug(yya, 3);
#endif
{
#line 130 ".\\_parser.y"
yyval=yyattribute(1 - 2);
#line 322 "_parser.c"
}
}
break;
case 11:
{
#ifdef YYDEBUG
YYSTYPE YYFAR *yya[8];
yyinitdebug(yya, 8);
#endif
{
#line 136 ".\\_parser.y"
//cprintf("if_stmt");
assert(yyattribute(3 - 7)->kind.exp!=EmptyExpK);
yyval = newStmtNode(IfK);
yyval->child[0] = yyattribute(3 - 7);
yyval->child[1] = yyattribute(6 - 7);
#line 340 "_parser.c"
}
}
break;
case 12:
{
#ifdef YYDEBUG
YYSTYPE YYFAR *yya[12];
yyinitdebug(yya, 12);
#endif
{
#line 144 ".\\_parser.y"
assert(yyattribute(3 - 11)->kind.exp!=EmptyExpK);
yyval = newStmtNode(IfK);
yyval->child[0] = yyattribute(3 - 11);
yyval->child[1] = yyattribute(6 - 11);
yyval->child[2] = yyattribute(10 - 11);
#line 359 "_parser.c"
}
}
break;
case 13:
{
#ifdef YYDEBUG