📄 grammar.cpp
字号:
/* A Bison parser, made from grammar.y by GNU Bison version 1.28 */#define YYBISON 1 /* Identify Bison output. */#define yyparse kjsyyparse#define yylex kjsyylex#define yyerror kjsyyerror#define yylval kjsyylval#define yychar kjsyychar#define yydebug kjsyydebug#define yynerrs kjsyynerrs#define YYLSP_NEEDED#define NULLTOKEN 257#define TRUETOKEN 258#define FALSETOKEN 259#define STRING 260#define NUMBER 261#define BREAK 262#define CASE 263#define DEFAULT 264#define FOR 265#define NEW 266#define VAR 267#define CONTINUE 268#define FUNCTION 269#define RETURN 270#define VOID 271#define DELETE 272#define IF 273#define THIS 274#define DO 275#define WHILE 276#define ELSE 277#define IN 278#define INSTANCEOF 279#define TYPEOF 280#define SWITCH 281#define WITH 282#define RESERVED 283#define THROW 284#define TRY 285#define CATCH 286#define FINALLY 287#define EQEQ 288#define NE 289#define STREQ 290#define STRNEQ 291#define LE 292#define GE 293#define OR 294#define AND 295#define PLUSPLUS 296#define MINUSMINUS 297#define LSHIFT 298#define RSHIFT 299#define URSHIFT 300#define PLUSEQUAL 301#define MINUSEQUAL 302#define MULTEQUAL 303#define DIVEQUAL 304#define LSHIFTEQUAL 305#define RSHIFTEQUAL 306#define URSHIFTEQUAL 307#define ANDEQUAL 308#define MODEQUAL 309#define XOREQUAL 310#define OREQUAL 311#define IDENT 312#define AUTOPLUSPLUS 313#define AUTOMINUSMINUS 314#line 1 "grammar.y"/* * This file is part of the KDE libraries * Copyright (C) 1999-2000 Harri Porten (porten@kde.org) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */#ifdef HAVE_CONFIG_H#include <config.h>#endif#include <string.h>#include <stdlib.h>#include "value.h"#include "object.h"#include "types.h"#include "interpreter.h"#include "nodes.h"#include "lexer.h"#include "internal.h"// Not sure why, but yacc doesn't add this define along with the others.#define yylloc kjsyylloc/* default values for bison */#define YYDEBUG 0#define YYMAXDEPTH 0#if !APPLE_CHANGES#define YYERROR_VERBOSE#endif#define DBG(l, s, e) { l->setLoc(s.first_line, e.last_line, Parser::sid); } // locationextern int kjsyylex();int kjsyyerror(const char *);static bool automatic();using namespace KJS;#line 55 "grammar.y"typedef union { int ival; double dval; UString *ustr; Identifier *ident; Node *node; StatementNode *stat; ParameterNode *param; FunctionBodyNode *body; FuncDeclNode *func; ProgramNode *prog; AssignExprNode *init; SourceElementsNode *srcs; StatListNode *slist; ArgumentsNode *args; ArgumentListNode *alist; VarDeclNode *decl; VarDeclListNode *vlist; CaseBlockNode *cblk; ClauseListNode *clist; CaseClauseNode *ccl; ElementNode *elm; Operator op; PropertyValueNode *plist; PropertyNode *pnode; CatchNode *cnode; FinallyNode *fnode;} YYSTYPE;#ifndef YYLTYPEtypedef struct yyltype { int timestamp; int first_line; int first_column; int last_line; int last_column; char *text; } yyltype;#define YYLTYPE yyltype#endif#include <stdio.h>#ifndef __cplusplus#ifndef __STDC__#define const#endif#endif#define YYFINAL 358#define YYFLAG -32768#define YYNTBASE 85#define YYTRANSLATE(x) ((unsigned)(x) <= 314 ? yytranslate[x] : 149)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, 74, 2, 2, 2, 76, 79, 2, 62, 63, 75, 71, 68, 72, 70, 61, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 69, 84, 77, 83, 78, 82, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 66, 2, 67, 80, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 64, 81, 65, 73, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 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};#if YYDEBUG != 0static const short yyprhs[] = { 0, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 26, 29, 33, 37, 41, 47, 50, 55, 56, 58, 60, 63, 67, 73, 75, 77, 79, 81, 83, 88, 92, 96, 98, 101, 104, 107, 112, 116, 119, 123, 125, 129, 131, 133, 135, 138, 141, 143, 146, 149, 152, 155, 158, 161, 164, 167, 170, 173, 176, 178, 182, 186, 190, 192, 196, 200, 202, 206, 210, 214, 216, 220, 224, 228, 232, 236, 240, 242, 246, 250, 254, 258, 260, 264, 266, 270, 272, 276, 278, 282, 284, 288, 290, 296, 298, 302, 304, 306, 308, 310, 312, 314, 316, 318, 320, 322, 324, 326, 328, 332, 334, 336, 338, 340, 342, 344, 346, 348, 350, 352, 354, 356, 358, 360, 363, 367, 369, 372, 376, 380, 382, 386, 388, 391, 394, 396, 399, 402, 408, 416, 423, 429, 439, 450, 458, 467, 477, 478, 480, 483, 486, 490, 494, 497, 500, 504, 508, 511, 514, 518, 522, 528, 534, 538, 544, 545, 547, 549, 552, 556, 561, 564, 568, 572, 576, 580, 584, 589, 595, 598, 604, 611, 616, 622, 624, 628, 631, 635, 636, 638, 640, 643, 645};static const short yyrhs[] = { 3, 0, 4, 0, 5, 0, 7, 0, 6, 0, 61, 0, 50, 0, 20, 0, 58, 0, 85, 0, 87, 0, 62, 114, 63, 0, 64, 65, 0, 64, 91, 65, 0, 66, 89, 67, 0, 66, 88, 67, 0, 66, 88, 68, 89, 67, 0, 89, 112, 0, 88, 68, 89, 112, 0, 0, 90, 0, 68, 0, 90, 68, 0, 92, 69, 112, 0, 91, 68, 92, 69, 112, 0, 58, 0, 6, 0, 7, 0, 86, 0, 143, 0, 93, 66, 114, 67, 0, 93, 70, 58, 0, 12, 93, 96, 0, 93, 0, 12, 94, 0, 93, 96, 0, 95, 96, 0, 95, 66, 114, 67, 0, 95, 70, 58, 0, 62, 63, 0, 62, 97, 63, 0, 112, 0, 97, 68, 112, 0, 94, 0, 95, 0, 98, 0, 98, 42, 0, 98, 43, 0, 99, 0, 18, 100, 0, 17, 100, 0, 26, 100, 0, 42, 100, 0, 59, 100, 0, 43, 100, 0, 60, 100, 0, 71, 100, 0, 72, 100, 0, 73, 100, 0, 74, 100, 0, 100, 0, 101, 75, 100, 0, 101, 61, 100, 0, 101, 76, 100, 0, 101, 0, 102, 71, 101, 0, 102, 72, 101, 0, 102, 0, 103, 44, 102, 0, 103, 45, 102, 0, 103, 46, 102, 0, 103, 0, 104, 77, 103, 0, 104, 78, 103, 0, 104, 38, 103, 0, 104, 39, 103, 0, 104, 25, 103, 0, 104, 24, 103, 0, 104, 0, 105, 34, 104, 0, 105, 35, 104, 0, 105, 36, 104, 0, 105, 37, 104, 0, 105, 0, 106, 79, 105, 0, 106, 0, 107, 80, 106, 0, 107, 0, 108, 81, 107, 0, 108, 0, 109, 41, 108, 0, 109, 0, 110, 40, 109, 0, 110, 0, 110, 82, 112, 69, 112, 0, 111, 0, 98, 113, 112, 0, 83, 0, 47, 0, 48, 0, 49, 0, 50, 0, 51, 0, 52, 0, 53, 0, 54, 0, 56, 0, 57, 0, 55, 0, 112, 0, 114, 68, 112, 0, 116, 0, 118, 0, 122, 0, 123, 0, 124, 0, 125, 0, 127, 0, 128, 0, 129, 0, 130, 0, 131, 0, 137, 0, 138, 0, 139, 0, 64, 65, 0, 64, 147, 65, 0, 115, 0, 117, 115, 0, 13, 119, 84, 0, 13, 119, 1, 0, 120, 0, 119, 68, 120, 0, 58, 0, 58, 121, 0, 83, 112, 0, 84, 0, 114, 84, 0, 114, 1, 0, 19, 62, 114, 63, 115, 0, 19, 62, 114, 63, 115, 23, 115, 0, 21, 115, 22, 62, 114, 63, 0, 22, 62, 114, 63, 115, 0, 11, 62, 126, 84, 126, 84, 126, 63, 115, 0, 11, 62, 13, 119, 84, 126, 84, 126, 63, 115, 0, 11, 62, 98, 24, 114, 63, 115, 0, 11, 62, 13, 58, 24, 114, 63, 115, 0, 11, 62, 13, 58, 121, 24, 114, 63, 115, 0, 0, 114, 0, 14, 84, 0, 14, 1, 0, 14, 58, 84, 0, 14, 58, 1, 0, 8, 84, 0, 8, 1, 0, 8, 58, 84, 0, 8, 58, 1, 0, 16, 84, 0, 16, 1, 0, 16, 114, 84, 0, 16, 114, 1, 0, 28, 62, 114, 63, 115, 0, 27, 62, 114, 63, 132, 0, 64, 133, 65, 0, 64, 133, 136, 133, 65, 0, 0, 134, 0, 135, 0, 134, 135, 0, 9, 114, 69, 0, 9, 114, 69, 117, 0, 10, 69, 0, 10, 69, 117, 0, 58, 69, 115, 0, 30, 114, 84, 0, 31, 116, 140, 0, 31, 116, 141, 0, 31, 116, 140, 141, 0, 32, 62, 58, 63, 116, 0, 33, 116, 0, 15, 58, 62, 63, 145, 0, 15, 58, 62, 144, 63, 145, 0, 15, 62, 63, 145, 0, 15, 62, 144, 63, 145, 0, 58, 0, 144, 68, 58, 0, 64, 65, 0, 64, 147, 65, 0, 0, 147, 0, 148, 0, 147, 148, 0, 115, 0, 142, 0};#endif#if YYDEBUG != 0static const short yyrline[] = { 0, 169, 171, 172, 173, 174, 175, 178, 184, 186, 187,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -