#define YY_MyParser_h_included
/* A Bison++ parser, made from pcode.y */
/* with Bison++ version bison++ Version 1.21-8, adapted from GNU bison by coetmeur@icdc.fr
*/
#line 1 "M:\\kbase\\src\\release\\2A\\debug\\gnuwin32\\bin\\bison.cc"
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
/* Skeleton output parser for bison,
Copyright (C) 1984, 1989, 1990 Bob Corbett and Richard Stallman
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/* HEADER SECTION */
#if defined( _MSDOS ) || defined(MSDOS) || defined(__MSDOS__)
#define __MSDOS_AND_ALIKE
#endif
#if defined(_WINDOWS) && defined(_MSC_VER)
#define __HAVE_NO_ALLOCA
#define __MSDOS_AND_ALIKE
#endif
#ifndef alloca
#if defined( __GNUC__)
#define alloca __builtin_alloca
#elif (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi)
#include <alloca.h>
#elif defined (__MSDOS_AND_ALIKE)
#include <malloc.h>
#ifndef __TURBOC__
/* MS C runtime lib */
#define alloca _alloca
#endif
#elif defined(_AIX)
#include <malloc.h>
#pragma alloca
#elif defined(__hpux)
#ifdef __cplusplus
extern "C" {
void *alloca (unsigned int);
};
#else /* not __cplusplus */
void *alloca ();
#endif /* not __cplusplus */
#endif /* not _AIX not MSDOS, or __TURBOC__ or _AIX, not sparc. */
#endif /* alloca not defined. */
#ifdef c_plusplus
#ifndef __cplusplus
#define __cplusplus
#endif
#endif
#ifdef __cplusplus
#ifndef YY_USE_CLASS
#define YY_USE_CLASS
#endif
#else
#ifndef __STDC__
#define const
#endif
#endif
#include <stdio.h>
#define YYBISON 1
/* #line 73 "M:\\kbase\\src\\release\\2A\\debug\\gnuwin32\\bin\\bison.cc" */
#line 85 "parser.cpp"
#define YY_MyParser_LSP_NEEDED
#define YY_MyParser_ERROR_BODY =0
#define YY_MyParser_LEX_BODY =0
#line 7 "pcode.y"
// ------------------------------------
// dBase for Linux (c) 2012 Jens Kallup
// All Rights Reserved.
// ------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <stdarg.h>
#include <signal.h>
#include <iostream>
#include <fstream>
#line 23 "pcode.y"
using namespace std;
#define run_parse(x) (run_parse_mode == (x))
#define false 0
#define true 1
extern int run_parse_mode;
extern char *strlwr(char *c);
extern FILE* yyin;
extern int lineno;
#ifdef _PARSER_
FILE *file_header = NULL;
FILE *file_main = NULL;
char temp_str[2048];
char temp_object[2048];
char class_temp[2048];
char *tmp_id;
char *class_object;
char *class_methode_code;
char *class_name;
char *class_type;
char *class_local;
char *class_datalink;
char *class_element;
int no_expr = 0;
int last_token = 0;
int twisted = 0;
//typedef unsigned short bool;
bool has_object = false;
bool in_methode = false;
bool in_main_function = false;
bool compiler_flag = true;
#endif
int check_list(char *name);
void print_code(char* str, ... );
extern int errors;
#line 72 "pcode.y"
typedef union {
int type;
float val;
char* id;
char* text;
int trfa;
} yy_MyParser_stype;
#define YY_MyParser_STYPE yy_MyParser_stype
#line 73 "M:\\kbase\\src\\release\\2A\\debug\\gnuwin32\\bin\\bison.cc"
/* %{ and %header{ and %union, during decl */
#define YY_MyParser_BISON 1
#ifndef YY_MyParser_COMPATIBILITY
#ifndef YY_USE_CLASS
#define YY_MyParser_COMPATIBILITY 1
#else
#define YY_MyParser_COMPATIBILITY 0
#endif
#endif
#if YY_MyParser_COMPATIBILITY != 0
/* backward compatibility */
#ifdef YYLTYPE
#ifndef YY_MyParser_LTYPE
#define YY_MyParser_LTYPE YYLTYPE
#endif
#endif
#ifdef YYSTYPE
#ifndef YY_MyParser_STYPE
#define YY_MyParser_STYPE YYSTYPE
#endif
#endif
#ifdef YYDEBUG
#ifndef YY_MyParser_DEBUG
#define YY_MyParser_DEBUG YYDEBUG
#endif
#endif
#ifdef YY_MyParser_STYPE
#ifndef yystype
#define yystype YY_MyParser_STYPE
#endif
#endif
/* use goto to be compatible */
#ifndef YY_MyParser_USE_GOTO
#define YY_MyParser_USE_GOTO 1
#endif
#endif
/* use no goto to be clean in C++ */
#ifndef YY_MyParser_USE_GOTO
#define YY_MyParser_USE_GOTO 0
#endif
#ifndef YY_MyParser_PURE
/* #line 117 "M:\\kbase\\src\\release\\2A\\debug\\gnuwin32\\bin\\bison.cc" */
#line 210 "parser.cpp"
#line 117 "M:\\kbase\\src\\release\\2A\\debug\\gnuwin32\\bin\\bison.cc"
/* YY_MyParser_PURE */
#endif
/* section apres lecture def, avant lecture grammaire S2 */
/* #line 121 "M:\\kbase\\src\\release\\2A\\debug\\gnuwin32\\bin\\bison.cc" */
#line 219 "parser.cpp"
#line 121 "M:\\kbase\\src\\release\\2A\\debug\\gnuwin32\\bin\\bison.cc"
/* prefix */
#ifndef YY_MyParser_DEBUG
/* #line 123 "M:\\kbase\\src\\release\\2A\\debug\\gnuwin32\\bin\\bison.cc" */
#line 226 "parser.cpp"
#line 123 "M:\\kbase\\src\\release\\2A\\debug\\gnuwin32\\bin\\bison.cc"
/* YY_MyParser_DEBUG */
#endif
#ifndef YY_MyParser_LSP_NEEDED
/* #line 128 "M:\\kbase\\src\\release\\2A\\debug\\gnuwin32\\bin\\bison.cc" */
#line 236 "parser.cpp"
#line 128 "M:\\kbase\\src\\release\\2A\\debug\\gnuwin32\\bin\\bison.cc"
/* YY_MyParser_LSP_NEEDED*/
#endif
/* DEFAULT LTYPE*/
#ifdef YY_MyParser_LSP_NEEDED
#ifndef YY_MyParser_LTYPE
typedef
struct yyltype
{
int timestamp;
int first_line;
int first_column;
int last_line;
int last_column;
char *text;
}
yyltype;
#define YY_MyParser_LTYPE yyltype
#endif
#endif
/* DEFAULT STYPE*/
/* We used to use `unsigned long' as YY_MyParser_STYPE on MSDOS,
but it seems better to be consistent.
Most programs should declare their own type anyway. */
#ifndef YY_MyParser_STYPE
#define YY_MyParser_STYPE int
#endif
/* DEFAULT MISCELANEOUS */
#ifndef YY_MyParser_PARSE
#define YY_MyParser_PARSE yyparse
#endif
#ifndef YY_MyParser_LEX
#define YY_MyParser_LEX yylex
#endif
#ifndef YY_MyParser_LVAL
#define YY_MyParser_LVAL yylval
#endif
#ifndef YY_MyParser_LLOC
#define YY_MyParser_LLOC yylloc
#endif
#ifndef YY_MyParser_CHAR
#define YY_MyParser_CHAR yychar
#endif
#ifndef YY_MyParser_NERRS
#define YY_MyParser_NERRS yynerrs
#endif
#ifndef YY_MyParser_DEBUG_FLAG
#define YY_MyParser_DEBUG_FLAG yydebug
#endif
#ifndef YY_MyParser_ERROR
#define YY_MyParser_ERROR yyerror
#endif
#ifndef YY_MyParser_PARSE_PARAM
#ifndef __STDC__
#ifndef __cplusplus
#ifndef YY_USE_CLASS
#define YY_MyParser_PARSE_PARAM
#ifndef YY_MyParser_PARSE_PARAM_DEF
#define YY_MyParser_PARSE_PARAM_DEF
#endif
#endif
#endif
#endif
#ifndef YY_MyParser_PARSE_PARAM
#define YY_MyParser_PARSE_PARAM void
#endif
#endif
#if YY_MyParser_COMPATIBILITY != 0
/* backward compatibility */
#ifdef YY_MyParser_LTYPE
#ifndef YYLTYPE
#define YYLTYPE YY_MyParser_LTYPE
#else
/* WARNING obsolete !!! user defined YYLTYPE not reported into generated header */
#endif
#endif
#ifndef YYSTYPE
#define YYSTYPE YY_MyParser_STYPE
#else
/* WARNING obsolete !!! user defined YYSTYPE not reported into generated header */
#endif
#ifdef YY_MyParser_PURE
#ifndef YYPURE
#define YYPURE YY_MyParser_PURE
#endif
#endif
#ifdef YY_MyParser_DEBUG
#ifndef YYDEBUG
#define YYDEBUG YY_MyParser_DEBUG
#endif
#endif
#ifndef YY_MyParser_ERROR_VERBOSE
#ifdef YYERROR_VERBOSE
#define YY_MyParser_ERROR_VERBOSE YYERROR_VERBOSE
#endif
#endif
#ifndef YY_MyParser_LSP_NEEDED
#ifdef YYLSP_NEEDED
#define YY_MyParser_LSP_NEEDED YYLSP_NEEDED
#endif
#endif
#endif
#ifndef YY_USE_CLASS
/* TOKEN C */
/* #line 236 "M:\\kbase\\src\\release\\2A\\debug\\gnuwin32\\bin\\bison.cc" */
#line 349 "parser.cpp"
#define _NUM_ 258
#define _ID_ 259
#define _ASSIGN_ 260
#define _PLUS_ 261
#define _MINUS_ 262
#define _DIV_ 263
#define _MUL_ 264
#define _MOD_ 265
#define _POW_ 266
#define _OBR_ 267
#define _CBR_ 268
#define _NEW_ 269
#define _CLASS_ 270
#define _OF_ 271
#define _ENDCLASS_ 272
#define _WITH_ 273
#define _ENDWITH_ 274
#define _LOCAL_ 275
#define _COMMA_ 276
#define _POINT_ 277
#define _STRING_ 278
#define _FUNCTION_ 279
#define _RETURN_ 280
#define _DBPOINT_ 281
#define _MSGBOX_ 282
#define _EQUAL_ 283
#define _PARAMETER_ 284
#define _IF_ 285
#define _ELSE_ 286
#define _ENDIF_ 287
#define _NOT_ 288
#define _TRUE_ 289
#define _FALSE_ 290
#define _OBR2_ 291
#define _CBR2_ 292
#line 236 "M:\\kbase\\src\\release\\2A\\debug\\gnuwin32\\bin\\bison.cc"
/* #defines tokens */
#else
/* CLASS */
#ifndef YY_MyParser_CLASS
#define YY_MyParser_CLASS MyParser
#endif
#ifndef YY_MyParser_INHERIT
#define YY_MyParser_INHERIT
#endif
#ifndef YY_MyParser_MEMBERS
#define YY_MyParser_MEMBERS
#endif
#ifndef YY_MyParser_LEX_BODY
#define YY_MyParser_LEX_BODY
#endif
#ifndef YY_MyParser_ERROR_BODY
#define YY_MyParser_ERROR_BODY
#endif
#ifndef YY_MyParser_CONSTRUCTOR_PARAM
#define YY_MyParser_CONSTRUCTOR_PARAM
#endif
#ifndef YY_MyParser_CONSTRUCTOR_CODE
#define YY_MyParser_CONSTRUCTOR_CODE
#endif
#ifndef YY_MyParser_CONSTRUCTOR_INIT
#define YY_MyParser_CONSTRUCTOR_INIT
#endif
/* choose between enum and const */
#ifndef YY_MyParser_USE_CONST_TOKEN
#define YY_MyParser_USE_CONST_TOKEN 0
/* yes enum is more compatible with flex, */
/* so by default we use it */
#endif
#if YY_MyParser_USE_CONST_TOKEN != 0
#ifndef YY_MyParser_ENUM_TOKEN
#define YY_MyParser_ENUM_TOKEN yy_MyParser_enum_token
#endif
#endif
class YY_MyParser_CLASS YY_MyParser_INHERIT
{
public:
#if YY_MyParser_USE_CONST_TOKEN != 0
/* static const int token ... */
/* #line 280 "M:\\kbase\\src\\release\\2A\\debug\\gnuwin32\\bin\\bison.cc" */
#line 434 "parser.cpp"
static const int _NUM_;
static const int _ID_;
static const int _ASSIGN_;
static const int _PLUS_;
static const int _MINUS_;
static const int _DIV_;
static const int _MUL_;
static const int _MOD_;
static const int _POW_;
static const int _OBR_;
static const int _CBR_;
static const int _NEW_;
static const int _CLASS_;
static const int _OF_;
static const int _ENDCLASS_;
static const int _WITH_;
static const int _ENDWITH_;
static const int _LOCAL_;
static const int _COMMA_;
static const int _POINT_;
static const int _STRING_;
static const int _FUNCTION_;
static const int _RETURN_;
static const int _DBPOINT_;
static const int _MSGBOX_;
static const int _EQUAL_;
static const int _PARAMETER_;
static const int _IF_;
static const int _ELSE_;
static const int _ENDIF_;
static const int _NOT_;
static const int _TRUE_;
static const int _FALSE_;
static const int _OBR2_;
static const int _CBR2_;
#line 280 "M:\\kbase\\src\\release\\2A\\debug\\gnuwin32\\bin\\bison.cc"
/* decl const */
#else
enum YY_MyParser_ENUM_TOKEN { YY_MyParser_NULL_TOKEN=0
/* #line 283 "M:\\kbase\\src\\release\\2A\\debug\\gnuwin32\\bin\\bison.cc" */
#line 478 "parser.cpp"
,_NUM_=258
,_ID_=259
,_ASSIGN_=260
,_PLUS_=261
,_MINUS_=262
,_DIV_=263
,_MUL_=264
,_MOD_=265
,_POW_=266
,_OBR_=267
,_CBR_=268
,_NEW_=269
,_CLASS_=270
,_OF_=271
,_ENDCLASS_=272
,_WITH_=273
,_ENDWITH_=274
,_LOCAL_=275
,_COMMA_=276
,_POINT_=277
,_STRING_=278
,_FUNCTION_=279
,_RETURN_=280
,_DBPOINT_=281
,_MSGBOX_=282
,_EQUAL_=283
,_PARAMETER_=284
,_IF_=285
,_ELSE_=286
,_ENDIF_=287
,_NOT_=288
,_TRUE_=289
,_FALSE_=290
,_OBR2_=291
,_CBR2_=292
#line 283 "M:\\kbase\\src\\release\\2A\\debug\\gnuwin32\\bin\\bison.cc"
/* enum token */
}; /* end of enum declaration */
#endif
public:
int YY_MyParser_PARSE (YY_MyParser_PARSE_PARAM);
virtual void YY_MyParser_ERROR(char *msg) YY_MyParser_ERROR_BODY;
#ifdef YY_MyParser_PURE
#ifdef YY_MyParser_LSP_NEEDED
virtual int YY_MyParser_LEX (YY_MyParser_STYPE *YY_MyParser_LVAL,YY_MyParser_LTYPE *YY_MyParser_LLOC) YY_MyParser_LEX_BODY;
#else
virtual int YY_MyParser_LEX (YY_MyParser_STYPE *YY_MyParser_LVAL) YY_MyParser_LEX_BODY;
#endif
#else
virtual int YY_MyParser_LEX() YY_MyParser_LEX_BODY;
YY_MyParser_STYPE YY_MyParser_LVAL;
#ifdef YY_MyParser_LSP_NEEDED
YY_MyParser_LTYPE YY_MyParser_LLOC;
#endif
int YY_MyParser_NERRS;
int YY_MyParser_CHAR;
#endif
#if YY_MyParser_DEBUG != 0
int YY_MyParser_DEBUG_FLAG; /* nonzero means print parse trace */
#endif
public:
YY_MyParser_CLASS(YY_MyParser_CONSTRUCTOR_PARAM);
public:
YY_MyParser_MEMBERS
};
/* other declare folow */
#if YY_MyParser_USE_CONST_TOKEN != 0
/* #line 314 "M:\\kbase\\src\\release\\2A\\debug\\gnuwin32\\bin\\bison.cc" */
#line 550 "parser.cpp"
const int YY_MyParser_CLASS::_NUM_=258;
const int YY_MyParser_CLASS::_ID_=259;
const int YY_MyParser_CLASS::_ASSIGN_=260;
const int YY_MyParser_CLASS::_PLUS_=261;
const int YY_MyParser_CLASS::_MINUS_=262;
const int YY_MyParser_CLASS::_DIV_=263;
const int YY_MyParser_CLASS::_MUL_=264;
const int YY_MyParser_CLASS::_MOD_=265;
const int YY_MyParser_CLASS::_POW_=266;
const int YY_MyParser_CLASS::_OBR_=267;
const int YY_MyParser_CLASS::_CBR_=268;
const int YY_MyParser_CLASS::_NEW_=269;
const int YY_MyParser_CLASS::_CLASS_=270;
const int YY_MyParser_CLASS::_OF_=271;
const int YY_MyParser_CLASS::_ENDCLASS_=272;
const int YY_MyParser_CLASS::_WITH_=273;
const int YY_MyParser_CLASS::_ENDWITH_=274;
const int YY_MyParser_CLASS::_LOCAL_=275;
const int YY_MyParser_CLASS::_COMMA_=276;
const int YY_MyParser_CLASS::_POINT_=277;
const int YY_MyParser_CLASS::_STRING_=278;
const int YY_MyParser_CLASS::_FUNCTION_=279;
const int YY_MyParser_CLASS::_RETURN_=280;
const int YY_MyParser_CLASS::_DBPOINT_=281;
const int YY_MyParser_CLASS::_MSGBOX_=282;
const int YY_MyParser_CLASS::_EQUAL_=283;
const int YY_MyParser_CLASS::_PARAMETER_=284;
const int YY_MyParser_CLASS::_IF_=285;
const int YY_MyParser_CLASS::_ELSE_=286;
const int YY_MyParser_CLASS::_ENDIF_=287;
const int YY_MyParser_CLASS::_NOT_=288;
const int YY_MyParser_CLASS::_TRUE_=289;
const int YY_MyParser_CLASS::_FALSE_=290;
const int YY_MyParser_CLASS::_OBR2_=291;
const int YY_MyParser_CLASS::_CBR2_=292;
#line 314 "M:\\kbase\\src\\release\\2A\\debug\\gnuwin32\\bin\\bison.cc"
/* const YY_MyParser_CLASS::token */
#endif
/*apres const */
YY_MyParser_CLASS::YY_MyParser_CLASS(YY_MyParser_CONSTRUCTOR_PARAM) YY_MyParser_CONSTRUCTOR_INIT
{
#if YY_MyParser_DEBUG != 0
YY_MyParser_DEBUG_FLAG=0;
#endif
YY_MyParser_CONSTRUCTOR_CODE;
};
#endif
/* #line 325 "M:\\kbase\\src\\release\\2A\\debug\\gnuwin32\\bin\\bison.cc" */
#line 602 "parser.cpp"
#define YYFINAL 262
#define YYFLAG 32768
#define YYNTBASE 38
#define YYTRANSLATE(x) ((unsigned)(x) <= 292 ? yytranslate[x] : 114)
static const char yytranslate[] = { 0,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 1, 2, 3, 4, 5,
6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
36, 37
};
#if YY_MyParser_DEBUG != 0
static const short yyprhs[] = { 0,
0, 1, 5, 6, 9, 12, 14, 15, 17, 19,
21, 23, 25, 27, 30, 32, 36, 37, 41, 47,
48, 57, 58, 63, 64, 71, 72, 74, 77, 78,
84, 85, 90, 91, 92, 100, 106, 113, 114, 118,
120, 121, 126, 132, 133, 141, 151, 160, 168, 169,
172, 176, 179, 183, 184, 185, 194, 195, 196, 206,
209, 210, 211, 212, 223, 224, 231, 235, 241, 249,
259, 271, 272, 273, 288, 289, 297, 298, 306, 307,
308, 315, 316, 322, 323, 329, 331, 333, 335, 337,
341, 342, 347, 348, 354, 355, 361, 362, 368, 369,
375, 376, 382, 384, 385, 390, 391, 396, 397, 402,
403, 408, 409, 414, 415, 420, 422, 424, 426, 427,
432, 433, 438, 439, 444, 445, 450, 451, 456, 457,
462, 463, 468, 470, 472, 474, 475
};
static const short yyrhs[] = { -1,
39, 44, 40, 0, 0, 41, 42, 0, 42, 43,
0, 43, 0, 0, 89, 0, 60, 0, 46, 0,
59, 0, 61, 0, 65, 0, 29, 45, 0, 4,
0, 45, 21, 45, 0, 0, 30, 47, 48, 0,
96, 28, 105, 42, 32, 0, 0, 96, 28, 105,
42, 31, 49, 42, 32, 0, 0, 4, 28, 50,
55, 0, 0, 12, 52, 4, 13, 51, 53, 0,
0, 33, 0, 42, 32, 0, 0, 42, 31, 54,
42, 32, 0, 0, 96, 56, 42, 32, 0, 0,
0, 96, 57, 42, 31, 58, 42, 32, 0, 4,
22, 4, 12, 13, 0, 4, 5, 14, 4, 12,
13, 0, 0, 20, 62, 63, 0, 4, 0, 0,
63, 21, 64, 63, 0, 15, 4, 16, 4, 17,
0, 0, 15, 4, 16, 4, 66, 70, 17, 0,
4, 22, 4, 5, 14, 4, 12, 4, 13, 0,
78, 5, 14, 4, 12, 78, 13, 19, 0, 78,
5, 14, 4, 12, 78, 13, 0, 0, 12, 13,
0, 12, 69, 13, 0, 4, 4, 0, 69, 21,
69, 0, 0, 0, 18, 12, 4, 13, 71, 79,
19, 70, 0, 0, 0, 18, 12, 78, 13, 72,
79, 19, 73, 70, 0, 67, 70, 0, 0, 0,
0, 24, 4, 68, 74, 77, 25, 75, 105, 76,
70, 0, 0, 27, 12, 23, 21, 23, 13, 0,
4, 22, 4, 0, 4, 22, 4, 22, 4, 0,
4, 22, 4, 22, 4, 22, 4, 0, 4, 22,
4, 22, 4, 22, 4, 22, 4, 0, 4, 22,
4, 22, 4, 22, 4, 22, 4, 22, 4, 0,
0, 0, 4, 5, 4, 22, 4, 22, 4, 22,
4, 36, 23, 37, 80, 79, 0, 0, 4, 5,
15, 26, 4, 81, 79, 0, 0, 4, 5, 4,
22, 4, 82, 79, 0, 0, 0, 4, 5, 83,
96, 84, 79, 0, 0, 4, 5, 87, 85, 79,
0, 0, 4, 5, 88, 86, 79, 0, 4, 0,
35, 0, 34, 0, 23, 0, 88, 6, 88, 0,
0, 4, 5, 90, 96, 0, 0, 4, 6, 5,
91, 96, 0, 0, 4, 7, 5, 92, 96, 0,
0, 4, 8, 5, 93, 96, 0, 0, 4, 9,
5, 94, 96, 0, 0, 4, 11, 5, 95, 96,
0, 4, 0, 0, 103, 6, 97, 96, 0, 0,
103, 7, 98, 96, 0, 0, 103, 9, 99, 96,
0, 0, 103, 8, 100, 96, 0, 0, 103, 10,
101, 96, 0, 0, 103, 11, 102, 96, 0, 103,
0, 3, 0, 4, 0, 0, 12, 104, 96, 13,
0, 0, 112, 6, 106, 105, 0, 0, 112, 7,
107, 105, 0, 0, 112, 9, 108, 105, 0, 0,
112, 8, 109, 105, 0, 0, 112, 10, 110, 105,
0, 0, 112, 11, 111, 105, 0, 112, 0, 3,
0, 4, 0, 0, 12, 113, 105, 13, 0
};
#endif
#if YY_MyParser_DEBUG != 0
static const short yyrline[] = { 0,
93, 101, 104, 171, 189, 190, 193, 194, 195, 196,
197, 198, 199, 203, 207, 213, 216, 217, 219, 220,
220, 221, 222, 222, 231, 233, 234, 237, 238, 238,
241, 241, 242, 242, 242, 246, 257, 270, 278, 287,
288, 289, 292, 293, 365, 375, 489, 490, 580, 581,
582, 586, 596, 606, 607, 622, 623, 628, 669, 669,
670, 678, 681, 689, 692, 693, 704, 707, 711, 716,
722, 732, 733, 750, 750, 795, 795, 811, 811, 831,
840, 840, 861, 861, 879, 882, 889, 890, 894, 900,
915, 915, 916, 916, 917, 917, 918, 918, 919, 919,
920, 920, 921, 924, 925, 925, 926, 926, 927, 927,
928, 928, 929, 929, 930, 930, 933, 934, 935, 935,
939, 940, 940, 941, 941, 942, 942, 943, 943, 944,
944, 945, 945, 948, 950, 951, 951
};
static const char * const yytname[] = { "$","error","$illegal.","_NUM_","_ID_",
"_ASSIGN_","_PLUS_","_MINUS_","_DIV_","_MUL_","_MOD_","_POW_","_OBR_","_CBR_",
"_NEW_","_CLASS_","_OF_","_ENDCLASS_","_WITH_","_ENDWITH_","_LOCAL_","_COMMA_",
"_POINT_","_STRING_","_FUNCTION_","_RETURN_","_DBPOINT_","_MSGBOX_","_EQUAL_",
"_PARAMETER_","_IF_","_ELSE_","_ENDIF_","_NOT_","_TRUE_","_FALSE_","_OBR2_",
"_CBR2_","program","@1","program_stmts","@2","stmt_seq","stmt","parameter_stmt",
"stack_parameter_list","if_stmt","@3","if_stmt2","@4","@5","@6","if_not_stmt",
"if_bool_stmt","@7","if_stmt2_equal","@8","@9","@10","local_show","id_stmt",
"local_stmt","@11","local_stmts","@12","class_stmt","@13","object_stmt","function_parameters",
"function_parameters2","class_stmts","@14","@15","@16","@17","@18","@19","function_stmts",
"with_objects","with_stmts","@20","@21","@22","@23","@24","@25","@26","false_true_expr",
"string_expr","num_id_stmt","@27","@28","@29","@30","@31","@32","expr2","@33",
"@34","@35","@36","@37","@38","expr3","@39","expr1","@40","@41","@42","@43",
"@44","@45","expr4","@46",""
};
#endif
static const short yyr1[] = { 0,
39, 38, 41, 40, 42, 42, 43, 43, 43, 43,
43, 43, 43, 44, 45, 45, 47, 46, 48, 49,
48, 50, 48, 51, 48, 52, 52, 53, 54, 53,
56, 55, 57, 58, 55, 59, 60, 62, 61, 63,
64, 63, 65, 66, 65, 67, 67, 67, 68, 68,
68, 69, 69, 70, 71, 70, 72, 73, 70, 70,
74, 75, 76, 70, 77, 77, 78, 78, 78, 78,
78, 79, 80, 79, 81, 79, 82, 79, 83, 84,
79, 85, 79, 86, 79, 87, 87, 87, 88, 88,
90, 89, 91, 89, 92, 89, 93, 89, 94, 89,
95, 89, 89, 97, 96, 98, 96, 99, 96, 100,
96, 101, 96, 102, 96, 96, 103, 103, 104, 103,
106, 105, 107, 105, 108, 105, 109, 105, 110, 105,
111, 105, 105, 112, 112, 113, 112
};
static const short yyr2[] = { 0,
0, 3, 0, 2, 2, 1, 0, 1, 1, 1,
1, 1, 1, 2, 1, 3, 0, 3, 5, 0,
8, 0, 4, 0, 6, 0, 1, 2, 0, 5,
0, 4, 0, 0, 7, 5, 6, 0, 3, 1,
0, 4, 5, 0, 7, 9, 8, 7, 0, 2,
3, 2, 3, 0, 0, 8, 0, 0, 9, 2,
0, 0, 0, 10, 0, 6, 3, 5, 7, 9,
11, 0, 0, 14, 0, 7, 0, 7, 0, 0,
6, 0, 5, 0, 5, 1, 1, 1, 1, 3,
0, 4, 0, 5, 0, 5, 0, 5, 0, 5,
0, 5, 1, 0, 4, 0, 4, 0, 4, 0,
4, 0, 4, 0, 4, 1, 1, 1, 0, 4,
0, 4, 0, 4, 0, 4, 0, 4, 0, 4,
0, 4, 1, 1, 1, 0, 4
};
static const short yydefact[] = { 1,
0, 0, 3, 15, 14, 2, 7, 0, 103, 0,
38, 17, 4, 6, 10, 11, 9, 12, 13, 8,
16, 91, 0, 0, 0, 0, 0, 0, 0, 0,
0, 5, 0, 0, 93, 95, 97, 99, 101, 0,
0, 40, 39, 117, 118, 119, 18, 0, 116, 0,
118, 119, 92, 0, 0, 0, 0, 0, 0, 44,
41, 22, 27, 0, 0, 0, 104, 106, 110, 108,
112, 114, 0, 94, 96, 98, 100, 102, 36, 43,
54, 0, 0, 0, 0, 134, 135, 136, 7, 133,
0, 0, 0, 0, 0, 0, 37, 0, 0, 0,
54, 0, 0, 42, 23, 31, 24, 120, 0, 0,
121, 123, 127, 125, 129, 131, 105, 107, 111, 109,
113, 115, 0, 0, 49, 60, 45, 0, 7, 7,
7, 0, 20, 19, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 61, 0, 0, 0, 0, 25,
137, 7, 122, 124, 128, 126, 130, 132, 0, 0,
55, 0, 57, 0, 50, 0, 65, 0, 32, 34,
29, 28, 0, 0, 68, 72, 67, 72, 52, 51,
0, 0, 0, 0, 7, 7, 21, 0, 0, 0,
0, 0, 53, 0, 62, 0, 0, 0, 0, 0,
69, 79, 54, 58, 0, 0, 48, 35, 30, 0,
0, 86, 0, 89, 88, 87, 0, 82, 84, 56,
54, 0, 63, 47, 46, 70, 0, 0, 80, 72,
0, 72, 59, 0, 54, 0, 77, 75, 72, 83,
90, 85, 66, 64, 71, 0, 72, 72, 81, 0,
78, 76, 0, 0, 0, 0, 73, 72, 74, 0,
0, 0
};
static const short yydefgoto[] = { 260,
1, 6, 7, 13, 14, 3, 5, 15, 31, 47,
152, 83, 131, 64, 150, 186, 105, 129, 130, 185,
16, 17, 18, 30, 43, 82, 19, 81, 101, 145,
166, 102, 176, 178, 221, 167, 206, 235, 183, 103,
191, 258, 248, 247, 217, 239, 230, 232, 218, 219,
20, 34, 54, 55, 56, 57, 58, 48, 91, 92,
94, 93, 95, 96, 49, 65, 89, 135, 136, 138,
137, 139, 140, 90, 109
};
static const short yypact[] = {-32768,
-2, 25,-32768,-32768, 27,-32768, 126, 25, 104, 43,
-32768,-32768, 126,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
27, 35, 46, 47, 48, 49, 67, 72, 55, 73,
1,-32768, 80, 7,-32768,-32768,-32768,-32768,-32768, 74,
83,-32768, 68,-32768, 60, 12,-32768, 79, 143, 106,
-32768,-32768,-32768, 7, 7, 7, 7, 7, 107, 105,
-32768,-32768,-32768, 117, 7, 14,-32768,-32768,-32768,-32768,
-32768,-32768, 111,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
51, 73, 7, 125, 134,-32768,-32768,-32768, 126, 155,
7, 7, 7, 7, 7, 7,-32768, 103, 145, 135,
51, 138, 153, 68,-32768, 128,-32768,-32768, 14, 63,
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
-32768,-32768, 163, 164, 157,-32768,-32768, 156, 126, 126,
126, 158,-32768,-32768, 14, 14, 14, 14, 14, 14,
9, -7, 159, 66,-32768, 169, 76, 26, 70,-32768,
-32768, 126,-32768,-32768,-32768,-32768,-32768,-32768, 160, 171,
-32768, 172,-32768, 173,-32768, 127, 151, 167,-32768,-32768,
-32768,-32768, 99, 176, 161, 177, 165, 177,-32768,-32768,
178, 179, 168, 184, 126, 126,-32768, 180, 185, 189,
181, 182, 174, 175,-32768, 183, 186, 112, 113, 192,
187, 5, 51,-32768, 190, 14, 188,-32768,-32768, 191,
193, 194, 195,-32768,-32768,-32768, 7,-32768, 196,-32768,
51, 197,-32768,-32768,-32768, 200, 199, 202,-32768, 177,
201, 177,-32768, 204, 51, 206, 203,-32768, 177,-32768,
196,-32768,-32768,-32768,-32768, 208, 177, 177,-32768, 205,
-32768,-32768, 209, 154, 207, 198,-32768, 177,-32768, 214,
215,-32768
};
static const short yypgoto[] = {-32768,
-32768,-32768,-32768, -87, -13,-32768, 210,-32768,-32768,-32768,
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
-32768,-32768,-32768,-32768, 137,-32768,-32768,-32768,-32768,-32768,
42, -98,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -116,
-166,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -23,
-32768,-32768,-32768,-32768,-32768,-32768,-32768, -33,-32768,-32768,
-32768,-32768,-32768,-32768,-32768,-32768, -102,-32768,-32768,-32768,
-32768,-32768,-32768,-32768,-32768
};
#define YYLAST 235
static const short yytable[] = { 32,
53, 110, 126, 44, 45, 161, 132, 143, 212, 44,
51, 192, 46, 159, 162, -26, 86, 87, 52, 213,
74, 75, 76, 77, 78, 88, 2, 214, 4, 9,
160, 85, 153, 154, 155, 156, 157, 158, 215, 216,
10, 147, 148, 149, 63, 11, 29, 8, 33, 106,
35, 36, 37, 38, 98, 12, 170, 117, 118, 119,
120, 121, 122, 240, 173, 242, 9, 197, 99, 164,
41, 39, 249, 9, 100, 40, 42, 10, 165, 9,
251, 252, 11, 50, 10, 59, 60, 62, 61, 11,
10, 259, 12, 133, 134, 11, 32, 198, 199, 12,
171, 172, 9, 223, 220, 12, 66, 169, 22, 23,
24, 25, 26, 10, 27, 9, 9, 73, 11, 79,
84, 80, 233, 97, 123, 28, 10, 10, 12, 9,
187, 11, 11, 32, 32, 32, 244, 107, 125, 180,
10, 12, 12, 208, 209, 11, 108, 181, 67, 68,
69, 70, 71, 72, 127, 12, 124, 128, -33, 32,
111, 112, 113, 114, 115, 116, 141, 142, 144, 146,
151, 163, 168, 174, 175, 177, 179, 182, 184, 188,
190, 164, 189, 229, 32, 32, 160, 196, 201, 255,
194, 200, 195, 202, 181, 210, 226, 205, 207, 203,
204, 231, 237, 225, 162, 238, 224, 241, 211, 245,
222, 250, 254, 261, 262, 227, 243, 21, 104, 234,
228, 236, 193, 214, 246, 0, 253, 0, 0, 256,
0, 0, 0, 0, 257
};
static const short yycheck[] = { 13,
34, 89, 101, 3, 4, 13, 109, 124, 4, 3,
4, 178, 12, 5, 22, 4, 3, 4, 12, 15,
54, 55, 56, 57, 58, 12, 29, 23, 4, 4,
22, 65, 135, 136, 137, 138, 139, 140, 34, 35,
15, 129, 130, 131, 33, 20, 4, 21, 14, 83,
5, 5, 5, 5, 4, 30, 31, 91, 92, 93,
94, 95, 96, 230, 152, 232, 4, 184, 18, 4,
16, 5, 239, 4, 24, 4, 4, 15, 13, 4,
247, 248, 20, 4, 15, 12, 4, 28, 21, 20,
15, 258, 30, 31, 32, 20, 110, 185, 186, 30,
31, 32, 4, 206, 203, 30, 28, 32, 5, 6,
7, 8, 9, 15, 11, 4, 4, 12, 20, 13,
4, 17, 221, 13, 22, 22, 15, 15, 30, 4,
32, 20, 20, 147, 148, 149, 235, 13, 4, 13,
15, 30, 30, 32, 32, 20, 13, 21, 6, 7,
8, 9, 10, 11, 17, 30, 12, 5, 31, 173,
6, 7, 8, 9, 10, 11, 4, 4, 12, 14,
13, 13, 4, 14, 4, 4, 4, 27, 12, 4,
4, 4, 22, 217, 198, 199, 22, 4, 4, 36,
12, 12, 25, 5, 21, 4, 4, 23, 13, 19,
19, 6, 4, 13, 22, 4, 19, 231, 22, 4,
21, 4, 4, 0, 0, 22, 13, 8, 82, 23,
26, 22, 181, 23, 22, -1, 22, -1, -1, 23,
-1, -1, -1, -1, 37
};
#line 325 "M:\\kbase\\src\\release\\2A\\debug\\gnuwin32\\bin\\bison.cc"
/* fattrs + tables */
/* parser code folow */
/* This is the parser code that is written into each bison parser
when the %semantic_parser declaration is not specified in the grammar.
It was written by Richard Stallman by simplifying the hairy parser
used when %semantic_parser is specified. */
/* Note: dollar marks section change
the next is replaced by the list of actions, each action
as one case of the switch. */
#if YY_MyParser_USE_GOTO != 0
/*
SUPRESSION OF GOTO : on some C++ compiler (sun c++)
the goto is strictly forbidden if any constructor/destructor
is used in the whole function (very stupid isn't it ?)
so goto are to be replaced with a 'while/switch/case construct'
here are the macro to keep some apparent compatibility
*/
#define YYGOTO(lb) {yy_gotostate=lb;continue;}
#define YYBEGINGOTO enum yy_labels yy_gotostate=yygotostart; \
for(;;) switch(yy_gotostate) { case yygotostart: {
#define YYLABEL(lb) } case lb: {
#define YYENDGOTO } }
#define YYBEGINDECLARELABEL enum yy_labels {yygotostart
#define YYDECLARELABEL(lb) ,lb
#define YYENDDECLARELABEL };
#else
/* macro to keep goto */
#define YYGOTO(lb) goto lb
#define YYBEGINGOTO
#define YYLABEL(lb) lb:
#define YYENDGOTO
#define YYBEGINDECLARELABEL
#define YYDECLARELABEL(lb)
#define YYENDDECLARELABEL
#endif
/* LABEL DECLARATION */
YYBEGINDECLARELABEL
YYDECLARELABEL(yynewstate)
YYDECLARELABEL(yybackup)
/* YYDECLARELABEL(yyresume) */
YYDECLARELABEL(yydefault)
YYDECLARELABEL(yyreduce)
YYDECLARELABEL(yyerrlab) /* here on detecting error */
YYDECLARELABEL(yyerrlab1) /* here on error raised explicitly by an action */
YYDECLARELABEL(yyerrdefault) /* current state does not do anything special for the error token. */
YYDECLARELABEL(yyerrpop) /* pop the current state because it cannot handle the error token */
YYDECLARELABEL(yyerrhandle)
YYENDDECLARELABEL
/* ALLOCA SIMULATION */
/* __HAVE_NO_ALLOCA */
#ifdef __HAVE_NO_ALLOCA
int __alloca_free_ptr(char *ptr,char *ref)
{if(ptr!=ref) free(ptr);
return 0;}
#define __ALLOCA_alloca(size) malloc(size)
#define __ALLOCA_free(ptr,ref) __alloca_free_ptr((char *)ptr,(char *)ref)
#ifdef YY_MyParser_LSP_NEEDED
#define __ALLOCA_return(num) \
return( __ALLOCA_free(yyss,yyssa)+\
__ALLOCA_free(yyvs,yyvsa)+\
__ALLOCA_free(yyls,yylsa)+\
(num))
#else
#define __ALLOCA_return(num) \
return( __ALLOCA_free(yyss,yyssa)+\
__ALLOCA_free(yyvs,yyvsa)+\
(num))
#endif
#else
#define __ALLOCA_return(num) return(num)
#define __ALLOCA_alloca(size) alloca(size)
#define __ALLOCA_free(ptr,ref)
#endif
/* ENDALLOCA SIMULATION */
#define yyerrok (yyerrstatus = 0)
#define yyclearin (YY_MyParser_CHAR = YYEMPTY)
#define YYEMPTY -2
#define YYEOF 0
#define YYACCEPT __ALLOCA_return(0)
#define YYABORT __ALLOCA_return(1)
#define YYERROR YYGOTO(yyerrlab1)
/* Like YYERROR except do call yyerror.
This remains here temporarily to ease the
transition to the new meaning of YYERROR, for GCC.
Once GCC version 2 has supplanted version 1, this can go. */
#define YYFAIL YYGOTO(yyerrlab)
#define YYRECOVERING() (!!yyerrstatus)
#define YYBACKUP(token, value) \
do \
if (YY_MyParser_CHAR == YYEMPTY && yylen == 1) \
{ YY_MyParser_CHAR = (token), YY_MyParser_LVAL = (value); \
yychar1 = YYTRANSLATE (YY_MyParser_CHAR); \
YYPOPSTACK; \
YYGOTO(yybackup); \
} \
else \
{ YY_MyParser_ERROR ("syntax error: cannot back up"); YYERROR; } \
while (0)
#define YYTERROR 1
#define YYERRCODE 256
#ifndef YY_MyParser_PURE
/* UNPURE */
#define YYLEX YY_MyParser_LEX()
#ifndef YY_USE_CLASS
/* If nonreentrant, and not class , generate the variables here */
int YY_MyParser_CHAR; /* the lookahead symbol */
YY_MyParser_STYPE YY_MyParser_LVAL; /* the semantic value of the */
/* lookahead symbol */
int YY_MyParser_NERRS; /* number of parse errors so far */
#ifdef YY_MyParser_LSP_NEEDED
YY_MyParser_LTYPE YY_MyParser_LLOC; /* location data for the lookahead */
/* symbol */
#endif
#endif
#else
/* PURE */
#ifdef YY_MyParser_LSP_NEEDED
#define YYLEX YY_MyParser_LEX(&YY_MyParser_LVAL, &YY_MyParser_LLOC)
#else
#define YYLEX YY_MyParser_LEX(&YY_MyParser_LVAL)
#endif
#endif
#ifndef YY_USE_CLASS
#if YY_MyParser_DEBUG != 0
int YY_MyParser_DEBUG_FLAG; /* nonzero means print parse trace */
/* Since this is uninitialized, it does not stop multiple parsers
from coexisting. */
#endif
#endif
/* YYINITDEPTH indicates the initial size of the parser's stacks */
#ifndef YYINITDEPTH
#define YYINITDEPTH 200
#endif
/* YYMAXDEPTH is the maximum size the stacks can grow to
(effective only if the built-in stack extension method is used). */
#if YYMAXDEPTH == 0
#undef YYMAXDEPTH
#endif
#ifndef YYMAXDEPTH
#define YYMAXDEPTH 10000
#endif
#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
#define __yy_bcopy(FROM,TO,COUNT) __builtin_memcpy(TO,FROM,COUNT)
#else /* not GNU C or C++ */
/* This is the most reliable way to avoid incompatibilities
in available built-in functions on various systems. */
#ifdef __cplusplus
static void __yy_bcopy (char *from, char *to, int count)
#else
#ifdef __STDC__
static void __yy_bcopy (char *from, char *to, int count)
#else
static void __yy_bcopy (from, to, count)
char *from;
char *to;
int count;
#endif
#endif
{
register char *f = from;
register char *t = to;
register int i = count;
while (i-- > 0)
*t++ = *f++;
}
#endif
int
#ifdef YY_USE_CLASS
YY_MyParser_CLASS::
#endif
YY_MyParser_PARSE(YY_MyParser_PARSE_PARAM)
#ifndef __STDC__
#ifndef __cplusplus
#ifndef YY_USE_CLASS
/* parameter definition without protypes */
YY_MyParser_PARSE_PARAM_DEF
#endif
#endif
#endif
{
register int yystate;
register int yyn;
register short *yyssp;
register YY_MyParser_STYPE *yyvsp;
int yyerrstatus; /* number of tokens to shift before error messages enabled */
int yychar1=0; /* lookahead token as an internal (translated) token number */
short yyssa[YYINITDEPTH]; /* the state stack */
YY_MyParser_STYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
short *yyss = yyssa; /* refer to the stacks thru separate pointers */
YY_MyParser_STYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
#ifdef YY_MyParser_LSP_NEEDED
YY_MyParser_LTYPE yylsa[YYINITDEPTH]; /* the location stack */
YY_MyParser_LTYPE *yyls = yylsa;
YY_MyParser_LTYPE *yylsp;
#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
#else
#define YYPOPSTACK (yyvsp--, yyssp--)
#endif
int yystacksize = YYINITDEPTH;
#ifdef YY_MyParser_PURE
int YY_MyParser_CHAR;
YY_MyParser_STYPE YY_MyParser_LVAL;
int YY_MyParser_NERRS;
#ifdef YY_MyParser_LSP_NEEDED
YY_MyParser_LTYPE YY_MyParser_LLOC;
#endif
#endif
YY_MyParser_STYPE yyval; /* the variable used to return */
/* semantic values from the action */
/* routines */
int yylen;
/* start loop, in which YYGOTO may be used. */
YYBEGINGOTO
#if YY_MyParser_DEBUG != 0
if (YY_MyParser_DEBUG_FLAG)
fprintf(stderr, "Starting parse\n");
#endif
yystate = 0;
yyerrstatus = 0;
YY_MyParser_NERRS = 0;
YY_MyParser_CHAR = YYEMPTY; /* Cause a token to be read. */
/* Initialize stack pointers.
Waste one element of value and location stack
so that they stay on the same level as the state stack.
The wasted elements are never initialized. */
yyssp = yyss - 1;
yyvsp = yyvs;
#ifdef YY_MyParser_LSP_NEEDED
yylsp = yyls;
#endif
/* Push a new state, which is found in yystate . */
/* In all cases, when you get here, the value and location stacks
have just been pushed. so pushing a state here evens the stacks. */
YYLABEL(yynewstate)
*++yyssp = yystate;
if (yyssp >= yyss + yystacksize - 1)
{
/* Give user a chance to reallocate the stack */
/* Use copies of these so that the &'s don't force the real ones into memory. */
YY_MyParser_STYPE *yyvs1 = yyvs;
short *yyss1 = yyss;
#ifdef YY_MyParser_LSP_NEEDED
YY_MyParser_LTYPE *yyls1 = yyls;
#endif
/* Get the current used size of the three stacks, in elements. */
int size = yyssp - yyss + 1;
#ifdef yyoverflow
/* Each stack pointer address is followed by the size of
the data in use in that stack, in bytes. */
#ifdef YY_MyParser_LSP_NEEDED
/* This used to be a conditional around just the two extra args,
but that might be undefined if yyoverflow is a macro. */
yyoverflow("parser stack overflow",
&yyss1, size * sizeof (*yyssp),
&yyvs1, size * sizeof (*yyvsp),
&yyls1, size * sizeof (*yylsp),
&yystacksize);
#else
yyoverflow("parser stack overflow",
&yyss1, size * sizeof (*yyssp),
&yyvs1, size * sizeof (*yyvsp),
&yystacksize);
#endif
yyss = yyss1; yyvs = yyvs1;
#ifdef YY_MyParser_LSP_NEEDED
yyls = yyls1;
#endif
#else /* no yyoverflow */
/* Extend the stack our own way. */
if (yystacksize >= YYMAXDEPTH)
{
YY_MyParser_ERROR("parser stack overflow");
__ALLOCA_return(2);
}
yystacksize *= 2;
if (yystacksize > YYMAXDEPTH)
yystacksize = YYMAXDEPTH;
yyss = (short *) __ALLOCA_alloca (yystacksize * sizeof (*yyssp));
__yy_bcopy ((char *)yyss1, (char *)yyss, size * sizeof (*yyssp));
__ALLOCA_free(yyss1,yyssa);
yyvs = (YY_MyParser_STYPE *) __ALLOCA_alloca (yystacksize * sizeof (*yyvsp));
__yy_bcopy ((char *)yyvs1, (char *)yyvs, size * sizeof (*yyvsp));
__ALLOCA_free(yyvs1,yyvsa);
#ifdef YY_MyParser_LSP_NEEDED
yyls = (YY_MyParser_LTYPE *) __ALLOCA_alloca (yystacksize * sizeof (*yylsp));
__yy_bcopy ((char *)yyls1, (char *)yyls, size * sizeof (*yylsp));
__ALLOCA_free(yyls1,yylsa);
#endif
#endif /* no yyoverflow */
yyssp = yyss + size - 1;
yyvsp = yyvs + size - 1;
#ifdef YY_MyParser_LSP_NEEDED
yylsp = yyls + size - 1;
#endif
#if YY_MyParser_DEBUG != 0
if (YY_MyParser_DEBUG_FLAG)
fprintf(stderr, "Stack size increased to %d\n", yystacksize);
#endif
if (yyssp >= yyss + yystacksize - 1)
YYABORT;
}
#if YY_MyParser_DEBUG != 0
if (YY_MyParser_DEBUG_FLAG)
fprintf(stderr, "Entering state %d\n", yystate);
#endif
YYGOTO(yybackup);
YYLABEL(yybackup)
/* Do appropriate processing given the current state. */
/* Read a lookahead token if we need one and don't already have one. */
/* YYLABEL(yyresume) */
/* First try to decide what to do without reference to lookahead token. */
yyn = yypact[yystate];
if (yyn == YYFLAG)
YYGOTO(yydefault);
/* Not known => get a lookahead token if don't already have one. */
/* yychar is either YYEMPTY or YYEOF
or a valid token in external form. */
if (YY_MyParser_CHAR == YYEMPTY)
{
#if YY_MyParser_DEBUG != 0
if (YY_MyParser_DEBUG_FLAG)
fprintf(stderr, "Reading a token: ");
#endif
YY_MyParser_CHAR = YYLEX;
}
/* Convert token to internal form (in yychar1) for indexing tables with */
if (YY_MyParser_CHAR <= 0) /* This means end of input. */
{
yychar1 = 0;
YY_MyParser_CHAR = YYEOF; /* Don't call YYLEX any more */
#if YY_MyParser_DEBUG != 0
if (YY_MyParser_DEBUG_FLAG)
fprintf(stderr, "Now at end of input.\n");
#endif
}
else
{
yychar1 = YYTRANSLATE(YY_MyParser_CHAR);
#if YY_MyParser_DEBUG != 0
if (YY_MyParser_DEBUG_FLAG)
{
fprintf (stderr, "Next token is %d (%s", YY_MyParser_CHAR, yytname[yychar1]);
/* Give the individual parser a way to print the precise meaning
of a token, for further debugging info. */
#ifdef YYPRINT
YYPRINT (stderr, YY_MyParser_CHAR, YY_MyParser_LVAL);
#endif
fprintf (stderr, ")\n");
}
#endif
}
yyn += yychar1;
if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
YYGOTO(yydefault);
yyn = yytable[yyn];
/* yyn is what to do for this token type in this state.
Negative => reduce, -yyn is rule number.
Positive => shift, yyn is new state.
New state is final state => don't bother to shift,
just return success.
0, or most negative number => error. */
if (yyn < 0)
{
if (yyn == YYFLAG)
YYGOTO(yyerrlab);
yyn = -yyn;
YYGOTO(yyreduce);
}
else if (yyn == 0)
YYGOTO(yyerrlab);
if (yyn == YYFINAL)
YYACCEPT;
/* Shift the lookahead token. */
#if YY_MyParser_DEBUG != 0
if (YY_MyParser_DEBUG_FLAG)
fprintf(stderr, "Shifting token %d (%s), ", YY_MyParser_CHAR, yytname[yychar1]);
#endif
/* Discard the token being shifted unless it is eof. */
if (YY_MyParser_CHAR != YYEOF)
YY_MyParser_CHAR = YYEMPTY;
*++yyvsp = YY_MyParser_LVAL;
#ifdef YY_MyParser_LSP_NEEDED
*++yylsp = YY_MyParser_LLOC;
#endif
/* count tokens shifted since error; after three, turn off error status. */
if (yyerrstatus) yyerrstatus--;
yystate = yyn;
YYGOTO(yynewstate);
/* Do the default action for the current state. */
YYLABEL(yydefault)
yyn = yydefact[yystate];
if (yyn == 0)
YYGOTO(yyerrlab);
/* Do a reduction. yyn is the number of a rule to reduce with. */
YYLABEL(yyreduce)
yylen = yyr2[yyn];
if (yylen > 0)
yyval = yyvsp[1-yylen]; /* implement default value of the action */
#if YY_MyParser_DEBUG != 0
if (YY_MyParser_DEBUG_FLAG)
{
int i;
fprintf (stderr, "Reducing via rule %d (line %d), ",
yyn, yyrline[yyn]);
/* Print the symbols being reduced, and their result. */
for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
fprintf (stderr, "%s ", yytname[yyrhs[i]]);
fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
}
#endif
/* #line 811 "M:\\kbase\\src\\release\\2A\\debug\\gnuwin32\\bin\\bison.cc" */
#line 1413 "parser.cpp"
switch (yyn) {
case 1:
#line 93 "pcode.y"
{
if run_parse(2)
{
print_code("s",
"#define __MAIN_RUN__\n"
"#include \"first.h\"\n\n"
);
}
;
break;}
case 3:
#line 105 "pcode.y"
{
if run_parse(1) {
print_code("s",
"// ---------------------------------\n"
"// kbase 1.0 (c) 2012 by Jens Kallup\n"
"// ---------------------------------\n"
"#ifndef __PROGRAM_HEADER__\n"
"#define __PROGRAM_HEADER__\n\n"
"#include <QApplication>\n"
"#include <QWidget>\n"
"#include <QFrame>\n"
"#include <QString>\n"
"#include <QPushButton>\n"
"#include <QLineEdit>\n"
"#include <QMessageBox>\n"
"#include <QTranslator>\n"
"#include <QVector>\n"
"#include \"session.h\"\n"
"#include \"MyQLineEdit.h\"\n"
"#include \"MyQPushButton.h\"\n"
"\n"
"class MyObjectTypes {\n"
"public:\n"
" int type;\n"
" double value;\n"
" QString str;\n"
" QWidget *widget;\n"
" QVector<MyObjectTypes> next;\n"
"};\n"
"\n"
"#ifdef __MAIN_RUN__\n"
"QVector<MyObjectTypes> param_struct;\n"
"QVector<MyQLineEdit> edit_datasources;\n"
"#else\n"
"extern QVector<MyObjectTypes> param_struct;\n"
"extern QVector<MyQLineEdit> edit_datasources;\n"
"#endif\n"
);
}
else if run_parse(2)
{
in_main_function = true;
print_code("s",
"int main(int argc, char **argv)\n{\n");
print_code(
"s",
"\tQApplication app(argc,argv);\n\n"
"\tQTranslator translator;\n"
"\ttranslator.load(\"qt_de\", \"./translations\");\n"
"\tapp.installTranslator(&translator);\n\n");
//if (!strcmp(class_type,"QWidget"))
{
char buffer[2048*3];
sprintf(buffer,"my_%s *my%s_obj = new my_%s();\n",
class_name,class_name,class_name);
strcat(buffer,"\tmy");
strcat(buffer,class_name);
strcat(buffer,"_obj->my_init_");
strcat(buffer,class_name);
strcat(buffer,"();\n");
print_code("sss","\t",buffer,"\n");
}
}
;
break;}
case 4:
#line 171 "pcode.y"
{
if run_parse(1)
{
print_code("s","#endif\n");
}
else if run_parse(2) {
//char buffer[256];
//sprintf(buffer,"my%s_obj",class_name);
//print_code("sssssss","\t",buffer,"->resize(static_cast<int>(",buffer,"->width), static_cast<int>(",buffer,"->height));\n");
//print_code("sssssss","\t",buffer,"->move(static_cast<int>(",buffer,"->left), static_cast<int>(",buffer,"->top));\n");
//print_code("s","\tresize(static_cast<int>(width), static_cast<int>(height));\n");
//print_code("s","\tmove (static_cast<int>(left) , static_cast<int>(top));\n");
}
;
break;}
case 5:
#line 189 "pcode.y"
{ ;
break;}
case 14:
#line 203 "pcode.y"
{ ;
break;}
case 15:
#line 207 "pcode.y"
{
if run_parse(2)
{
print_code("sss","bool ",yyvsp[0].id,";\n");
}
;
break;}
case 17:
#line 216 "pcode.y"
{ if run_parse(2) print_code("s","\tif ("); ;
break;}
case 19:
#line 219 "pcode.y"
{ if run_parse(2) print_code("s","\t}\n"); ;
break;}
case 20:
#line 220 "pcode.y"
{ if run_parse(2) print_code("s","\t} else {\n"); ;
break;}
case 21:
#line 220 "pcode.y"
{ if run_parse(2) print_code("s","\t}\n"); ;
break;}
case 22:
#line 221 "pcode.y"
{ if run_parse(2) print_code("ss",yyvsp[-1].id," == "); ;
break;}
case 24:
#line 222 "pcode.y"
{
char buffer[2048];
sprintf(buffer,"%s",yyvsp[-1].id);
if run_parse(2)
{
print_code("ss",buffer,")\n\t{\n");
}
;
break;}
case 27:
#line 234 "pcode.y"
{ if run_parse(2) print_code("s","!"); ;
break;}
case 28:
#line 237 "pcode.y"
{ if run_parse(2) print_code("s","\t}\n"); ;
break;}
case 29:
#line 238 "pcode.y"
{ if run_parse(2) print_code("s","\t}\nelse {\n"); ;
break;}
case 30:
#line 238 "pcode.y"
{ if run_parse(2) print_code("s","\t}\n"); ;
break;}
case 31:
#line 241 "pcode.y"
{ if run_parse(2) print_code("s",") {\n"); ;
break;}
case 32:
#line 241 "pcode.y"
{ if run_parse(2) print_code("s","\t}\n"); ;
break;}
case 33:
#line 242 "pcode.y"
{ if run_parse(2) print_code("s",") {\n"); ;
break;}
case 34:
#line 242 "pcode.y"
{ if run_parse(2) print_code("s","\t} else {\n"); ;
break;}
case 35:
#line 242 "pcode.y"
{ if run_parse(2) print_code("s","\t}\n"); ;
break;}
case 36:
#line 247 "pcode.y"
{
if (last_token == _ENDCLASS_)
if run_parse(2)
{
print_code("sssss","\t",yyvsp[-4].id,".widget->",yyvsp[-2].id,"();\n\n");
}
;
break;}
case 37:
#line 258 "pcode.y"
{
if run_parse(2)
{
char buffer[2048];
sprintf(buffer,"my%s_obj",class_name);
print_code("sssss","\t",yyvsp[-5].id,".widget = ",buffer,";\n\n");
}
;
break;}
case 38:
#line 271 "pcode.y"
{
if run_parse(2)
{
print_code("s","\n\tstatic struct MyObjectTypes ");
lineno;
}
;
break;}
case 39:
#line 278 "pcode.y"
{
if run_parse(2)
{
print_code("s",";\n\n");
lineno += 2;
}
;
break;}
case 40:
#line 287 "pcode.y"
{ if run_parse(2) print_code("s",yyvsp[0].id); ;
break;}
case 41:
#line 288 "pcode.y"
{ if run_parse(2) print_code("s",", "); ;
break;}
case 43:
#line 292 "pcode.y"
{ ;
break;}
case 44:
#line 293 "pcode.y"
{
if run_parse(2)
{
if (in_main_function)
{
char buffer[2048];
sprintf(buffer,"my%s_obj",class_name);
print_code("sssssss","\t",buffer,"->resize(static_cast<int>(",buffer,"->width), static_cast<int>(",buffer,"->height));\n");
print_code("sssssss","\t",buffer,"->move (static_cast<int>(",buffer,"->left), static_cast<int>(",buffer,"->top));\n");
print_code("s","\n\treturn app.exec();\n}\n");
in_main_function = false;
}
print_code("sssss",
"\nvoid my_",
strlwr(yyvsp[-2].id),
"::my_init_",
strlwr(yyvsp[-2].id),
"(void)\n{\n"
);
print_code("sss","\tmy_init_",strlwr(yyvsp[0].id),"();\n");
}
else if run_parse(1)
{
strcpy(class_name,strlwr(yyvsp[-2].id));
char buf[2048];
char puf[2048];
if (!strcmp(strlwr(yyvsp[0].id),"form"))
sprintf(puf,"\tvoid my_init_form(void) { };\n");
else sprintf(puf,"");
if (!strcmp(strlwr(yyvsp[0].id),"form")) sprintf(buf,"%s","QWidget"); else
if (!strcmp(strlwr(yyvsp[0].id),"pushbutton")) sprintf(buf,"%s","MyQPushButton"); else
if (!strcmp(strlwr(yyvsp[0].id),"query")) sprintf(buf,"%s","MyQQuery"); else
sprintf(buf,"my_%s",strlwr(yyvsp[0].id));
char buffer2[2048];
sprintf(buffer2,"\tvoid my_init_%s(void);\n",strlwr(yyvsp[-2].id));
print_code("ssssssssss",
"\nclass my_",yyvsp[-2].id," : public ",buf,"\n{\n\tQ_OBJECT\npublic:\n",
buffer2,
puf,
"\tmy_",yyvsp[-2].id,"(void) {\n"
"\t\ttop = 100.00;\n"
"\t\tleft = 100.00;\n"
"\t\twidth = 100.00;\n"
"\t\theight = 100.00;\n"
"\t}\n\t"
"void msgbox(QString tstr, QString mstr)\n"
"\t{\n"
"\t\tQMessageBox* msgBox = new QMessageBox();\n"
"\t\tmsgBox->setWindowTitle(tstr);\n"
"\t\tmsgBox->setText(mstr);\n"
"\t\tmsgBox->exec();\n\t}\n");
strcpy(class_type,buf);
if (!strcmp(yyvsp[0].id,"form"))
{
print_code("s","public:\n");
print_code("s","\tdouble top, left, width, height;\n");
}
}
;
break;}
case 45:
#line 365 "pcode.y"
{
if run_parse(1)
print_code("s","\n};\n"); else
print_code("s","\n}\n");
last_token = _ENDCLASS_;
;
break;}
case 46:
#line 376 "pcode.y"
{
strcpy(class_element,yyvsp[-3].id);
strcpy(class_temp ,yyvsp[-6].id);
strcpy(class_object ,yyvsp[-3].id);
if run_parse(1)
{
char buffer[2038];
sprintf(buffer,"%s",yyvsp[-6].id);
strcpy (class_temp ,yyvsp[-6].id);
compiler_flag = true;
if (!strcmp(strlwr(yyvsp[-3].id),"session"))
{
print_code("sss",
"\tMyQSession *",
yyvsp[-6].id,
";\n");
compiler_flag = false;
}
else if (!strcmp(strlwr(yyvsp[-3].id),"database"))
{
print_code("sss",
"\tMyQDataBase *",
yyvsp[-6].id,
";\n");
compiler_flag = false;
}
// ninit
if (compiler_flag == true)
{
if (!strcmp(strlwr(yyvsp[-3].id),"pushbutton")) print_code("sss","\tMyQPushButton *",yyvsp[-6].id,";\n"); else
if (!strcmp(strlwr(yyvsp[-3].id),"entryfield")) print_code("sss","\tMyQLineEdit *",yyvsp[-6].id,";\n"); else
if (!strcmp(strlwr(yyvsp[-3].id),"query")) print_code("sss","\tMyQQuery *",yyvsp[-6].id,";\n"); else
if (!strcmp(strlwr(yyvsp[-3].id),"container" )) print_code("sss","\tQFrame *",yyvsp[-6].id,";\n");
print_code("ssssssssssssssssssssssssssssssssssssssss",
"\tvoid init_",buffer,"(void)\n\t{\n",
"\t\t",buffer,"_top = 0.00;\n",
"\t\t",buffer,"_left = 0.00;\n",
"\t\t",buffer,"_height = 35.00;\n",
"\t\t",buffer,"_width = 90.00;\n",
"\t\t",buffer,"_visible = true;\n",
"\t\t",buffer,"_text = QString(\"\");\n",
"\t}\n",
"\tQString ",buffer,"_text;\n",
"\tdouble ",buffer,"_top;\n",
"\tdouble ",buffer,"_left;\n",
"\tdouble ",buffer,"_width;\n",
"\tdouble ",buffer,"_height;\n",
"\tbool ",buffer,"_visible;\n"
);
}
}
else if run_parse(2)
{
//if (!strcmp($8,"this"))
{
if (!strcmp(strlwr(yyvsp[-3].id),"session"))
print_code("sss",
"\n\t",
yyvsp[-6].id,
" = new MyQSession();\n"
); else
if (!strcmp(strlwr(yyvsp[-3].id),"database"))
print_code("sss",
"\n\t",
yyvsp[-6].id,
" = new MyQDataBase();\n"
); else
if (!strcmp(strlwr(yyvsp[-3].id),"pushbutton"))
print_code("sssssss",
"\n\t",
yyvsp[-6].id,
" = new MyQPushButton(\"PushButton\",this",
");\n",
"\tinit_",
class_temp,
"();\n"
); else
if (!strcmp(strlwr(yyvsp[-3].id),"entryfield"))
print_code("ssssss",
"\n\t",
yyvsp[-6].id,
" = new MyQLineEdit(this);\n",
"\tinit_",
class_temp,
"();\n"
); else
if (!strcmp(strlwr(yyvsp[-3].id),"query"))
print_code("ssssss",
"\n\t",
yyvsp[-6].id,
" = new MyQQuery(this);\n",
"\tinit_",
class_temp,
"();\n"
); else
if (!strcmp(strlwr(yyvsp[-3].id),"container"))
print_code("ssssssssssss",
"\n\t",yyvsp[-6].id," = new QFrame(this);\n",
"\t" ,yyvsp[-6].id,"->setFrameStyle(QFrame::Box | QFrame::Sunken);\n",
"\t" ,yyvsp[-6].id,"->setLineWidth(2);\n",
"\tinit_",
class_temp,
"();\n"
);
}
}
;
break;}
case 47:
#line 489 "pcode.y"
{ ;
break;}
case 48:
#line 490 "pcode.y"
{
if run_parse(1)
{
if (!strcmp(strlwr(yyvsp[-3].id),"pushbutton")) print_code("sss","\tMyQPushButton *", yyvsp[-6].text, ";\n"); else
if (!strcmp(strlwr(yyvsp[-3].id),"entryfield")) print_code("sss","\tMyQLineEdit *" , yyvsp[-6].text, ";\n"); else
if (!strcmp(strlwr(yyvsp[-3].id),"query")) print_code("sss","\tMyQQuery *" , yyvsp[-6].text, ";\n"); else
if (!strcmp(strlwr(yyvsp[-3].id),"container" )) print_code("sss","\tQFrame *" , yyvsp[-6].text, ";\n");
print_code("ssssssssssssssssssssssssssssssssssssssss",
"\tvoid init_",yyvsp[-6].text,"(void)\n\t{\n",
"\t\t",yyvsp[-6].text,"_top = 0.00;\n",
"\t\t",yyvsp[-6].text,"_left = 0.00;\n",
"\t\t",yyvsp[-6].text,"_height = 35.00;\n",
"\t\t",yyvsp[-6].text,"_width = 90.00;\n",
"\t\t",yyvsp[-6].text,"_visible = true;\n",
"\t\t",yyvsp[-6].text,"_text = QString(\"\");\n",
"\t}\n",
"\tQString ",yyvsp[-6].text,"_text;\n",
"\tdouble " ,yyvsp[-6].text,"_top;\n",
"\tdouble " ,yyvsp[-6].text,"_left;\n",
"\tdouble " ,yyvsp[-6].text,"_width;\n",
"\tdouble " ,yyvsp[-6].text,"_height;\n",
"\tbool " ,yyvsp[-6].text,"_visible;\n"
);
strcpy(class_element,yyvsp[-3].id);
}
else if run_parse(2)
{
//if (!strcmp($8,"this"))
{
char buffer[2048];
sprintf(buffer,"%s",yyvsp[-6].text);
strcpy(class_object,yyvsp[-3].id);
if (!strcmp(strlwr(yyvsp[-3].id),"pushbutton"))
print_code("ssssssss",
"\n\t",
yyvsp[-6].text,
" = new MyQPushButton(\"PushButton\",",
yyvsp[-1].text,
");\n",
"\tinit_",
yyvsp[-6].text,
"();\n"
); else
if (!strcmp(strlwr(yyvsp[-3].id),"entryfield"))
print_code("ssssssss",
"\n\t",
yyvsp[-6].text,
" = new MyQLineEdit(",
yyvsp[-1].text,
");\n",
"\tinit_",
yyvsp[-6].text,
"();\n"
); else
if (!strcmp(strlwr(yyvsp[-3].id),"query"))
print_code("ssssssss",
"\n\t",
yyvsp[-6].text,
" = new MyQQuery(",
yyvsp[-1].text,
");\n",
"\tinit_",
yyvsp[-6].text,
"();\n"
); else
if (!strcmp(strlwr(yyvsp[-3].id),"container"))
print_code("sssssssssss",
"\n\t",
yyvsp[-6].text,
" = new QFrame(",
yyvsp[-1].text,
");\n\t",
yyvsp[-6].text,
"->setFrameStyle(QFrame::Box | QFrame::Sunken);\n\t",
yyvsp[-6].text,
"->setLineWidth(2);\n\tinit_",
yyvsp[-6].text,
"();\n"
);
}
}
;
break;}
case 49:
#line 580 "pcode.y"
{ yyval.text = ""; ;
break;}
case 50:
#line 581 "pcode.y"
{ yyval.text = ""; ;
break;}
case 51:
#line 582 "pcode.y"
{ yyval.text = yyvsp[-1].text; ;
break;}
case 52:
#line 586 "pcode.y"
{
if run_parse(1)
{
if (!strcmp(yyvsp[-1].id,"int"))
yyvsp[-1].id = "double";
strcat(yyval.text," ");
strcat(yyval.text, yyvsp[0].id);
}
;
break;}
case 53:
#line 596 "pcode.y"
{
if run_parse(1)
{
strcat(yyval.text,", ");
strcat(yyval.text,yyvsp[0].text);
}
;
break;}
case 55:
#line 608 "pcode.y"
{
if run_parse(2)
{
if (!strcmp(yyvsp[-1].id,"this"))
{
//strcpy(class_object,$3);
}
else {
char buffer[50];
errors++;
sprintf(buffer,"ID %s unbekannt.",yyvsp[-1].id);
yyerror(buffer);
}
}
;
break;}
case 57:
#line 624 "pcode.y"
{
strcpy(class_temp,yyvsp[-1].text);
has_object = true;
;
break;}
case 58:
#line 629 "pcode.y"
{
has_object = false;
if run_parse(2)
{
char buffer2[256];
sprintf(buffer2,"static_cast<int>(%s",yyvsp[-4].text);
compiler_flag = true;
if (!strcmp(strlwr(class_object),"session" )) compiler_flag = false; else
if (!strcmp(strlwr(class_object),"database")) compiler_flag = false; else
if (!strcmp(strlwr(class_object),"query")) compiler_flag = false;
if (compiler_flag == true)
{
print_code("sssssss","\t",yyvsp[-4].text,"->resize(",buffer2,"_width), ",buffer2,"_height));\n");
print_code("sssssss","\t",yyvsp[-4].text,"->move (",buffer2,"_left) , ",buffer2,"_top));\n\n" );
if (!strcmp(strlwr(class_object),"container")) compiler_flag = false;
if (!strcmp(strlwr(class_object),"query")) compiler_flag = false;
if (compiler_flag == true)
{
print_code("sssss","\t",yyvsp[-4].text,"->setText(",yyvsp[-4].text,"_text);\n");
print_code("sssss","\t",yyvsp[-4].text,"->setDataField(",class_datalink,");\n\n");
}
print_code("sssssss",
"\tif (",
yyvsp[-4].text,
"_visible) ",
yyvsp[-4].text,
"->show();\n\telse ",
yyvsp[-4].text,
"->hide();\n\n"
);
}
}
;
break;}
case 61:
#line 670 "pcode.y"
{
if run_parse(1) {
print_code(
"sssssss",
"\n\tQVector<MyObjectTypes>& my",class_name,"_func_",yyvsp[-1].id,"(",yyvsp[0].text,")\n\t{\n\t"
"\tMyObjectTypes vec;\n"
);
}
;
break;}
case 62:
#line 678 "pcode.y"
{
if run_parse(1)
print_code("s","\t\tvec.value = ");
;
break;}
case 63:
#line 681 "pcode.y"
{
if run_parse(1)
{
print_code("s",";\n\t\tvec.type = 1;\n");
print_code("s","\t\tparam_struct << vec;\n");
print_code("s","\t\treturn param_struct;\n\t}\n");
}
;
break;}
case 66:
#line 693 "pcode.y"
{
if run_parse(1)
{
print_code("sssss",
"\t\tmsgbox(QString(",yyvsp[-3].text,"), QString(",yyvsp[-1].text,"));\n"
);
}
;
break;}
case 67:
#line 704 "pcode.y"
{
strcpy(yyval.text,yyvsp[0].id);
;
break;}
case 68:
#line 707 "pcode.y"
{
strcpy(yyval.text,yyvsp[-2].id); strcat(yyval.text,"_");
strcat(yyval.text,yyvsp[0].id);
;
break;}
case 69:
#line 711 "pcode.y"
{
strcpy(yyval.text,yyvsp[-4].id); strcat(yyval.text,"_");
strcat(yyval.text,yyvsp[-2].id); strcat(yyval.text,"_");
strcat(yyval.text,yyvsp[0].id);
;
break;}
case 70:
#line 716 "pcode.y"
{
strcpy(yyval.text,yyvsp[-6].id); strcat(yyval.text,"_");
strcat(yyval.text,yyvsp[-4].id); strcat(yyval.text,"_");
strcat(yyval.text,yyvsp[-2].id); strcat(yyval.text,"_");
strcat(yyval.text,yyvsp[0].id );
;
break;}
case 71:
#line 722 "pcode.y"
{
strcpy(yyval.text,yyvsp[-8].id); strcat(yyval.text,"_");
strcat(yyval.text,yyvsp[-6].id); strcat(yyval.text,"_");
strcat(yyval.text,yyvsp[-4].id); strcat(yyval.text,"_");
strcat(yyval.text,yyvsp[-2].id); strcat(yyval.text,"_");
strcat(yyval.text,yyvsp[0].id);
;
break;}
case 73:
#line 733 "pcode.y"
{
if run_parse(2)
{
if (!strcmp(strlwr(yyvsp[-11].id),"datalink"))
{
print_code("sssssss",
"\t",
class_temp,
"->setDataLink(",
yyvsp[-7].id,
",",
yyvsp[-1].text,
");\n"
);
}
}
;
break;}
case 75:
#line 750 "pcode.y"
{
if run_parse(1)
{
if (!strcmp(strlwr(yyvsp[-4].id),"onclick"))
print_code("ssssssssss",
"public slots:\n\t",
"void ",class_temp,"_OnClick()\n\t{\n\t\t",
"my",class_name,"_func_",class_temp,"_OnClick();\n\t}\n",
"public:\n"
); else
if (!strcmp(strlwr(yyvsp[-4].id),"ontimer"))
print_code("ssssssssss",
"public slots:\n\t",
"void ",
class_temp,
"_OnTimer()\n\t{\n\t\t",
"my",
class_name,
"_func_",
class_temp,
"_OnTimer();\n\t}\n",
"public:\n"
);
} else
if run_parse(2)
{
// todo: ...
if (!strcmp(strlwr(yyvsp[-4].id),"onclick"))
print_code("sssss",
"\n\tQObject::connect(",
class_temp ,
", SIGNAL(clicked()), this, SLOT(",
class_temp,
"_OnClick()));\n\n"
); else
if (!strcmp(strlwr(yyvsp[-4].id),"ontimer"))
print_code("sssss",
"\n\tQObject::connect(",
class_temp,
"->timer, SIGNAL(timeout()), this, SLOT(",
class_temp,
"_OnTimer()));\n\n"
);
}
;
break;}
case 77:
#line 795 "pcode.y"
{
if run_parse(2)
{
if (!strcmp(strlwr(class_element),"database"))
{
if (!strcmp(strlwr(yyvsp[-4].id),"session"))
print_code("sssss",
"\t",
class_temp,
"->session = ",
yyvsp[0].id,
";\n"
);
}
}
;
break;}
case 79:
#line 811 "pcode.y"
{
if run_parse(2)
{
strcpy(temp_object,"");
if (has_object == true)
{
if (!strcmp(strlwr(class_element),"session"))
{
if (!strcmp(strlwr(yyvsp[-1].id),"timeout"))
print_code("sss","\t",class_temp,"->timeout = static_cast<int>(");
else if (!strcmp(strlwr(yyvsp[-1].id),"port"))
print_code("sss","\t",class_temp,"->port = static_cast<int>(");
}
else
print_code("sssss","\t",class_temp,"_",yyvsp[-1].id," = ");
}
else
print_code("sss" ,"\t",yyvsp[-1].id," = ");
}
;
break;}
case 80:
#line 831 "pcode.y"
{
if run_parse(2)
{
if (!strcmp(strlwr(yyvsp[-3].id),"timeout")) print_code("s",")"); else
if (!strcmp(strlwr(yyvsp[-3].id),"port")) print_code("s",")");
print_code("s",";\n");
}
;
break;}
case 82:
#line 840 "pcode.y"
{
if run_parse(2)
{
if (!strcmp(strlwr(class_element),"session"))
{
if (!strcmp(strlwr(yyvsp[-2].id),"active"))
{
if (yyvsp[0].trfa == 0) print_code("sss","\t",class_temp,"->stop();\n"); else
if (yyvsp[0].trfa == 1) print_code("sss","\t",class_temp,"->start();\n");
}
}
else if (!strcmp(strlwr(class_element),"database"))
{
if (!strcmp(strlwr(yyvsp[-2].id),"active"))
{
if (yyvsp[0].trfa == 0) print_code("sss","\t",class_temp,"->close();\n"); else
if (yyvsp[0].trfa == 1) print_code("sss","\t",class_temp,"->open();\n" );
}
}
}
;
break;}
case 84:
#line 862 "pcode.y"
{
if run_parse(2)
{
if (!strcmp(strlwr(class_element),"session"))
{
if (!strcmp(strlwr(yyvsp[-2].id),"host")) print_code("sssss","\t",class_temp,"->host = QString(",yyvsp[0].text,");\n"); else
if (!strcmp(strlwr(yyvsp[-2].id),"user")) print_code("sssss","\t",class_temp,"->user = QString(",yyvsp[0].text,");\n"); else
if (!strcmp(strlwr(yyvsp[-2].id),"pass")) print_code("sssss","\t",class_temp,"->pass = QString(",yyvsp[0].text,");\n");
}
else if (!strcmp(strlwr(class_element),"database"))
{
if (!strcmp(strlwr(yyvsp[-2].id),"databasename")) print_code("sssss","\t",class_temp,"->databaseName = QString(",yyvsp[0].text,");\n");
}
else
print_code("sssss","\t",class_temp,"_text = QString(",yyvsp[0].text,");\n");
}
;
break;}
case 86:
#line 882 "pcode.y"
{
if run_parse(2)
{
if (!strcmp(strlwr(yyvsp[0].id),"false")) yyval.trfa = 0;
if (!strcmp(strlwr(yyvsp[0].id),"true")) yyval.trfa = 1;
}
;
break;}
case 87:
#line 889 "pcode.y"
{ if run_parse(2) yyval.trfa = 0; ;
break;}
case 88:
#line 890 "pcode.y"
{ if run_parse(2) yyval.trfa = 1; ;
break;}
case 89:
#line 895 "pcode.y"
{
if (!yyval.text)
yyval.text = (char*) malloc(strlen(yyvsp[0].text)+1);
yyval.text = yyvsp[0].text;
;
break;}
case 90:
#line 901 "pcode.y"
{
char *buffer = (char*) malloc(4096);
if (!yyval.text)
yyval.text = (char*) malloc(strlen(yyvsp[-2].text)+strlen(yyvsp[0].text)+5);
strcpy(buffer,yyvsp[-2].text);
strcat(buffer,yyvsp[0].text);
yyval.text = buffer;
;
break;}
case 91:
#line 915 "pcode.y"
{ check_list(yyvsp[-1].id); if run_parse(2) print_code("sss","\t",yyvsp[-1].id," = " ); ;
break;}
case 92:
#line 915 "pcode.y"
{ if run_parse(2) print_code("s",";\n"); ;
break;}
case 93:
#line 916 "pcode.y"
{ check_list(yyvsp[-2].id); if run_parse(2) print_code("sss","\t",yyvsp[-2].id," += "); ;
break;}
case 94:
#line 916 "pcode.y"
{ if run_parse(2) print_code("s",";\n"); ;
break;}
case 95:
#line 917 "pcode.y"
{ check_list(yyvsp[-2].id); if run_parse(2) print_code("sss","\t",yyvsp[-2].id," -= "); ;
break;}
case 96:
#line 917 "pcode.y"
{ if run_parse(2) print_code("s",";\n"); ;
break;}
case 97:
#line 918 "pcode.y"
{ check_list(yyvsp[-2].id); if run_parse(2) print_code("sss","\t",yyvsp[-2].id," /= "); ;
break;}
case 98:
#line 918 "pcode.y"
{ if run_parse(2) print_code("s",";\n"); ;
break;}
case 99:
#line 919 "pcode.y"
{ check_list(yyvsp[-2].id); if run_parse(2) print_code("sss","\t",yyvsp[-2].id," *= "); ;
break;}
case 100:
#line 919 "pcode.y"
{ if run_parse(2) print_code("s",";\n"); ;
break;}
case 101:
#line 920 "pcode.y"
{ check_list(yyvsp[-2].id); if run_parse(2) print_code("sss","\t",yyvsp[-2].id," ^= "); ;
break;}
case 102:
#line 920 "pcode.y"
{ if run_parse(2) print_code("s",";\n"); ;
break;}
case 103:
#line 921 "pcode.y"
{ errors++; ;
break;}
case 104:
#line 924 "pcode.y"
{ if run_parse(2) print_code("s"," + "); ;
break;}
case 106:
#line 925 "pcode.y"
{ if run_parse(2) print_code("s"," - "); ;
break;}
case 108:
#line 926 "pcode.y"
{ if run_parse(2) print_code("s"," * "); ;
break;}
case 110:
#line 927 "pcode.y"
{ if run_parse(2) print_code("s"," / "); ;
break;}
case 112:
#line 928 "pcode.y"
{ if run_parse(2) print_code("s"," % "); ;
break;}
case 114:
#line 929 "pcode.y"
{ if run_parse(2) print_code("s"," ^ "); ;
break;}
case 117:
#line 933 "pcode.y"
{ if run_parse(2) print_code("f",yyvsp[0].val); ;
break;}
case 118:
#line 934 "pcode.y"
{ if run_parse(2) print_code("s",yyvsp[0].id); ;
break;}
case 119:
#line 935 "pcode.y"
{ if run_parse(2) print_code("s","("); ;
break;}
case 120:
#line 935 "pcode.y"
{ if run_parse(2) print_code("s",")"); ;
break;}
case 121:
#line 939 "pcode.y"
{ if run_parse(1) print_code("s"," + "); ;
break;}
case 123:
#line 940 "pcode.y"
{ if run_parse(1) print_code("s"," - "); ;
break;}
case 125:
#line 941 "pcode.y"
{ if run_parse(1) print_code("s"," * "); ;
break;}
case 127:
#line 942 "pcode.y"
{ if run_parse(1) print_code("s"," / "); ;
break;}
case 129:
#line 943 "pcode.y"
{ if run_parse(1) print_code("s"," % "); ;
break;}
case 131:
#line 944 "pcode.y"
{ if run_parse(1) print_code("s"," ^ "); ;
break;}
case 134:
#line 948 "pcode.y"
{ if run_parse(1) print_code("f",yyvsp[0].val);
;
break;}
case 135:
#line 950 "pcode.y"
{ if run_parse(1) print_code("s",yyvsp[0].id); ;
break;}
case 136:
#line 951 "pcode.y"
{ if run_parse(1) print_code("s","("); ;
break;}
case 137:
#line 951 "pcode.y"
{ if run_parse(1) print_code("s",")"); ;
break;}
}
#line 811 "M:\\kbase\\src\\release\\2A\\debug\\gnuwin32\\bin\\bison.cc"
/* the action file gets copied in in place of this dollarsign */
yyvsp -= yylen;
yyssp -= yylen;
#ifdef YY_MyParser_LSP_NEEDED
yylsp -= yylen;
#endif
#if YY_MyParser_DEBUG != 0
if (YY_MyParser_DEBUG_FLAG)
{
short *ssp1 = yyss - 1;
fprintf (stderr, "state stack now");
while (ssp1 != yyssp)
fprintf (stderr, " %d", *++ssp1);
fprintf (stderr, "\n");
}
#endif
*++yyvsp = yyval;
#ifdef YY_MyParser_LSP_NEEDED
yylsp++;
if (yylen == 0)
{
yylsp->first_line = YY_MyParser_LLOC.first_line;
yylsp->first_column = YY_MyParser_LLOC.first_column;
yylsp->last_line = (yylsp-1)->last_line;
yylsp->last_column = (yylsp-1)->last_column;
yylsp->text = 0;
}
else
{
yylsp->last_line = (yylsp+yylen-1)->last_line;
yylsp->last_column = (yylsp+yylen-1)->last_column;
}
#endif
/* Now "shift" the result of the reduction.
Determine what state that goes to,
based on the state we popped back to
and the rule number reduced by. */
yyn = yyr1[yyn];
yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
yystate = yytable[yystate];
else
yystate = yydefgoto[yyn - YYNTBASE];
YYGOTO(yynewstate);
YYLABEL(yyerrlab) /* here on detecting error */
if (! yyerrstatus)
/* If not already recovering from an error, report this error. */
{
++YY_MyParser_NERRS;
#ifdef YY_MyParser_ERROR_VERBOSE
yyn = yypact[yystate];
if (yyn > YYFLAG && yyn < YYLAST)
{
int size = 0;
char *msg;
int x, count;
count = 0;
/* Start X at -yyn if nec to avoid negative indexes in yycheck. */
for (x = (yyn < 0 ? -yyn : 0);
x < (sizeof(yytname) / sizeof(char *)); x++)
if (yycheck[x + yyn] == x)
size += strlen(yytname[x]) + 15, count++;
msg = (char *) malloc(size + 15);
if (msg != 0)
{
strcpy(msg, "parse error");
if (count < 5)
{
count = 0;
for (x = (yyn < 0 ? -yyn : 0);
x < (sizeof(yytname) / sizeof(char *)); x++)
if (yycheck[x + yyn] == x)
{
strcat(msg, count == 0 ? ", expecting `" : " or `");
strcat(msg, yytname[x]);
strcat(msg, "'");
count++;
}
}
YY_MyParser_ERROR(msg);
free(msg);
}
else
YY_MyParser_ERROR ("parse error; also virtual memory exceeded");
}
else
#endif /* YY_MyParser_ERROR_VERBOSE */
YY_MyParser_ERROR("parse error");
}
YYGOTO(yyerrlab1);
YYLABEL(yyerrlab1) /* here on error raised explicitly by an action */
if (yyerrstatus == 3)
{
/* if just tried and failed to reuse lookahead token after an error, discard it. */
/* return failure if at end of input */
if (YY_MyParser_CHAR == YYEOF)
YYABORT;
#if YY_MyParser_DEBUG != 0
if (YY_MyParser_DEBUG_FLAG)
fprintf(stderr, "Discarding token %d (%s).\n", YY_MyParser_CHAR, yytname[yychar1]);
#endif
YY_MyParser_CHAR = YYEMPTY;
}
/* Else will try to reuse lookahead token
after shifting the error token. */
yyerrstatus = 3; /* Each real token shifted decrements this */
YYGOTO(yyerrhandle);
YYLABEL(yyerrdefault) /* current state does not do anything special for the error token. */
#if 0
/* This is wrong; only states that explicitly want error tokens
should shift them. */
yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
if (yyn) YYGOTO(yydefault);
#endif
YYLABEL(yyerrpop) /* pop the current state because it cannot handle the error token */
if (yyssp == yyss) YYABORT;
yyvsp--;
yystate = *--yyssp;
#ifdef YY_MyParser_LSP_NEEDED
yylsp--;
#endif
#if YY_MyParser_DEBUG != 0
if (YY_MyParser_DEBUG_FLAG)
{
short *ssp1 = yyss - 1;
fprintf (stderr, "Error: state stack now");
while (ssp1 != yyssp)
fprintf (stderr, " %d", *++ssp1);
fprintf (stderr, "\n");
}
#endif
YYLABEL(yyerrhandle)
yyn = yypact[yystate];
if (yyn == YYFLAG)
YYGOTO(yyerrdefault);
yyn += YYTERROR;
if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
YYGOTO(yyerrdefault);
yyn = yytable[yyn];
if (yyn < 0)
{
if (yyn == YYFLAG)
YYGOTO(yyerrpop);
yyn = -yyn;
YYGOTO(yyreduce);
}
else if (yyn == 0)
YYGOTO(yyerrpop);
if (yyn == YYFINAL)
YYACCEPT;
#if YY_MyParser_DEBUG != 0
if (YY_MyParser_DEBUG_FLAG)
fprintf(stderr, "Shifting error token, ");
#endif
*++yyvsp = YY_MyParser_LVAL;
#ifdef YY_MyParser_LSP_NEEDED
*++yylsp = YY_MyParser_LLOC;
#endif
yystate = yyn;
YYGOTO(yynewstate);
/* end loop, in which YYGOTO may be used. */
YYENDGOTO
}
/* END */
/* #line 1010 "M:\\kbase\\src\\release\\2A\\debug\\gnuwin32\\bin\\bison.cc" */
#line 2681 "parser.cpp"
#line 954 "pcode.y"
int symbols_count = 0;
char *ptr_symbols[2048];
int check_list(char *name)
{
bool found = false;
int i;
if run_parse(1)
{
if (!symbols_count)
{
ptr_symbols[symbols_count] = (char*)malloc(strlen(name)+1);
strcpy(ptr_symbols[symbols_count],name);
++symbols_count;
}
for (i = 0; i < symbols_count-1; i++)
{
if (!strcmp(ptr_symbols[i],name))
{
found = true;
break;
}
}
if (found == false)
{
++symbols_count;
ptr_symbols[symbols_count] = (char*)malloc(strlen(name)+1);
strcpy(ptr_symbols[symbols_count],name);
print_code("s","#ifdef __MAIN_RUN__\n");
print_code("sss","double ",name," = 0.00;\n");
print_code("s","#endif\n");
}
}
}
void print_code(char* str, ... )
{
va_list vl;
int i;
va_start(vl, str);
// Step through the list.
for( i = 0; str[i] != '\0'; ++i )
{
union Printable_t {
int i;
float f;
char c;
char *s;
} Printable;
// Type to expect ...
switch( str[i] )
{
case 'i':
Printable.i = va_arg( vl, int );
if run_parse(1)
fprintf(file_header,"%i", Printable.i); else
fprintf(file_main ,"%i", Printable.i);
break;
case 'f':
Printable.f = va_arg( vl, double);
if run_parse(1)
fprintf(file_header,"%f", Printable.f); else
fprintf(file_main ,"%f", Printable.f);
break;
case 'c':
Printable.c = va_arg( vl, int );
if run_parse(1)
fprintf(file_header,"%c", Printable.c); else
fprintf(file_main ,"%c", Printable.c);
break;
case 's':
Printable.s = va_arg( vl, char *);
if run_parse(1)
fprintf(file_header,"%s", Printable.s); else
fprintf(file_main ,"%s", Printable.s);
break;
default:
break;
}
}
va_end( vl );
}
void reset_values(void)
{
lineno = 1;
}