📄 bison.c
字号:
#define tTRIM 396#define tLTRIM 397#define tRTRIM 398#define tINSTR 399#define tRINSTR 400#define tSYSTEM 401#define tSYSTEM2 402#define tPEEK 403#define tPEEK2 404#define tPOKE 405#define tDATE 406#define tTIME 407#define tTOKEN 408#define tTOKENALT 409#define tSPLIT 410#define tSPLITALT 411#define tGLOB 412#define UMINUS 413/* Copy the first part of user declarations. *//* YABASIC --- a simple Basic Interpreter written by Marc-Oliver Ihm 1995-2005 homepage: www.yabasic.de BISON part This file is part of yabasic and may be copied only under the terms of either the Artistic License or the GNU General Public License (GPL), both of which can be found at www.yabasic.de*/#ifndef YABASIC_INCLUDED#include "yabasic.h" /* definitions of yabasic */#endif#ifdef WINDOWS#include <malloc.h>#else#ifdef HAVE_MALLOC_H#include <malloc.h>#else#include <stdlib.h>#endif#endif#if HAVE_ALLOCA_H#ifndef WINDOWS#include <alloca.h>#endif#endifvoid __yy_bcopy (char *, char *, int); /* prototype missing */int tileol; /* true, read should go to eon of line */int yylineno = 1; /* line number; counts fresh in every new file */int main_lineno = 1; /* line number of main */int function_type = ftNONE; /* contains function type while parsing function */char *current_function = NULL; /* name of currently parsed function */int exported = FALSE; /* true, if function is exported */int yylex (void);extern struct libfile_name *current_libfile; /* defined in main.c: name of currently parsed file */int missing_endif = 0;int missing_endif_line = 0;int missing_endsub = 0;int missing_endsub_line = 0;int missing_next = 0;int missing_next_line = 0;int missing_wend = 0;int missing_wend_line = 0;int missing_until = 0;int missing_until_line = 0;int missing_loop = 0;int missing_loop_line = 0;int in_loop = 0;voidreport_missing (int severity, char *text){ if (missing_loop || missing_endif || missing_next || missing_until || missing_wend) { error (severity, text); string[0] = '\0'; if (missing_endif) sprintf (string, "if statement starting at line %d has seen no 'endif' yet", missing_endif_line); else if (missing_next) sprintf (string, "for-loop starting at line %d has seen no 'next' yet", missing_next_line); else if (missing_wend) sprintf (string, "while-loop starting at line %d has seen no 'wend' yet", missing_wend_line); else if (missing_until) sprintf (string, "repeat-loop starting at line %d has seen no 'until' yet", missing_until_line); else if (missing_loop) sprintf (string, "do-loop starting at line %d has seen no 'loop' yet", missing_wend_line); if (string[0]) error (severity, string); }}/* Enabling traces. */#ifndef YYDEBUG# define YYDEBUG 1#endif/* Enabling verbose error messages. */#ifdef YYERROR_VERBOSE# undef YYERROR_VERBOSE# define YYERROR_VERBOSE 1#else# define YYERROR_VERBOSE 0#endif#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)typedef union YYSTYPE{ double fnum; /* double number */ int inum; /* integer number */ int token; /* token of command */ int sep; /* number of newlines */ char *string; /* quoted string */ char *symbol; /* general symbol */ char *digits; /* string of digits */ char *docu; /* embedded documentation */} YYSTYPE;/* Line 191 of yacc.c. */# define yystype YYSTYPE /* obsolescent; will be withdrawn */# define YYSTYPE_IS_DECLARED 1# define YYSTYPE_IS_TRIVIAL 1#endif/* Copy the second part of user declarations. *//* Line 214 of yacc.c. */#if ! defined (yyoverflow) || YYERROR_VERBOSE/* The parser invokes alloca or malloc; define the necessary symbols. */# if YYSTACK_USE_ALLOCA# define YYSTACK_ALLOC alloca# else# ifndef YYSTACK_USE_ALLOCA# if defined (alloca) || defined (_ALLOCA_H)# define YYSTACK_ALLOC alloca# else# ifdef __GNUC__# define YYSTACK_ALLOC __builtin_alloca# endif# endif# endif# endif# ifdef YYSTACK_ALLOC /* Pacify GCC's `empty if-body' warning. */# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)# else# if defined (__STDC__) || defined (__cplusplus)# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */# define YYSIZE_T size_t# endif# define YYSTACK_ALLOC malloc# define YYSTACK_FREE free# endif#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */#if (! defined (yyoverflow) \ && (! defined (__cplusplus) \ || (YYSTYPE_IS_TRIVIAL)))/* A type that is properly aligned for any stack member. */union yyalloc{ short yyss; YYSTYPE yyvs;};/* The size of the maximum gap between one aligned stack and the next. */# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)/* The size of an array large to enough to hold all stacks, each with N elements. */# define YYSTACK_BYTES(N) \ ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM)/* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */# ifndef YYCOPY# if 1 < __GNUC__# define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From)))# else# define YYCOPY(To, From, Count) \ do \ { \ register YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ while (0)# endif# endif/* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */# define YYSTACK_RELOCATE(Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack, Stack, yysize); \ Stack = &yyptr->Stack; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (0)#endif#if defined (__STDC__) || defined (__cplusplus)typedef signed char yysigned_char;#elsetypedef short yysigned_char;#endif/* YYFINAL -- State number of the termination state. */#define YYFINAL 247/* YYLAST -- Last index in YYTABLE. */#define YYLAST 5167/* YYNTOKENS -- Number of terminals. */#define YYNTOKENS 168/* YYNNTS -- Number of nonterminals. */#define YYNNTS 110/* YYNRULES -- Number of rules. */#define YYNRULES 427/* YYNRULES -- Number of states. */#define YYNSTATES 1002/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */#define YYUNDEFTOK 2#define YYMAXUTOK 413#define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */static const unsigned 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, 167, 2, 2, 2, 2, 163, 164, 160, 159, 166, 158, 2, 161, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 165, 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, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 162};#if YYDEBUG/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */static const unsigned short yyprhs[] = { 0, 0, 3, 6, 8, 9, 10, 16, 17, 19, 22, 24, 27, 29, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 53, 57, 58, 62, 64, 66, 69, 72, 76, 80, 81, 87, 88, 94, 97, 99, 102, 104, 107, 112, 117, 121, 126, 131, 132, 136, 137, 142, 149, 152, 159, 162, 165, 168, 170, 173, 175, 178, 181, 184, 190, 198, 202, 205, 209, 214, 220, 224, 227, 232, 236, 245, 252, 259, 262, 265, 271, 279, 284, 291, 300, 306, 309, 312, 315, 318, 322, 325, 328, 330, 332, 336, 341, 346, 351, 356, 361, 366, 368, 370, 373, 375, 378, 379, 381, 383, 386, 389, 393, 404, 413, 422, 431, 435, 437, 439, 446, 451, 456, 463, 470, 475, 482, 484, 489, 491, 493, 495, 497, 501, 505, 512, 519, 528, 535, 540, 547, 556, 558, 562, 567, 572, 577, 582, 587, 592, 597, 602, 604, 608, 610, 614, 619, 626, 633, 638, 645, 650, 657, 668, 673, 678, 683, 687, 691, 692, 697, 698, 703, 706, 710, 714, 718, 722, 726, 730, 735, 742, 744, 749, 754, 761, 768, 770, 772, 776, 780, 784, 788, 792, 795, 799, 803, 807, 811, 815, 819, 821, 825, 829, 833, 837, 842, 847, 852, 857, 862, 867, 874, 879, 884, 891, 896, 901, 906, 911, 916, 921, 928, 933, 937, 944, 951, 956, 961, 966, 971, 978, 985, 994, 1001, 1010, 1015, 1020, 1025, 1030, 1032, 1036, 1041, 1043, 1047, 1052, 1054, 1058, 1063, 1065, 1069, 1076, 1083, 1090, 1095, 1104, 1111, 1120, 1127,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -