grammar.cpp
来自「konqueror3 embedded版本, KDE环境下的当家浏览器的嵌入式版」· C++ 代码 · 共 1,449 行 · 第 1/5 页
CPP
1,449 行
/* A Bison parser, made by GNU Bison 1.875. *//* Skeleton parser for Yacc-like parsing with Bison, Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc. 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 2, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *//* As a special exception, when this file is copied by Bison into a Bison output file, you may use that output file without restriction. This special exception was added by the Free Software Foundation in version 1.24 of Bison. *//* Written by Richard Stallman by simplifying the original so called ``semantic'' parser. *//* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. *//* Identify Bison output. */#define YYBISON 1/* Skeleton name. */#define YYSKELETON_NAME "yacc.c"/* Pure parsers. */#define YYPURE 0/* Using locations. */#define YYLSP_NEEDED 1/* If NAME_PREFIX is specified substitute the variables and functions names. */#define yyparse kjsyyparse#define yylex kjsyylex#define yyerror kjsyyerror#define yylval kjsyylval#define yychar kjsyychar#define yydebug kjsyydebug#define yynerrs kjsyynerrs#define yylloc kjsyylloc/* Tokens. */#ifndef YYTOKENTYPE# define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { NULLTOKEN = 258, TRUETOKEN = 259, FALSETOKEN = 260, STRING = 261, NUMBER = 262, BREAK = 263, CASE = 264, DEFAULT = 265, FOR = 266, NEW = 267, VAR = 268, CONST = 269, CONTINUE = 270, FUNCTION = 271, RETURN = 272, VOID = 273, DELETE = 274, IF = 275, THIS = 276, DO = 277, WHILE = 278, ELSE = 279, IN = 280, INSTANCEOF = 281, TYPEOF = 282, SWITCH = 283, WITH = 284, RESERVED = 285, THROW = 286, TRY = 287, CATCH = 288, FINALLY = 289, EQEQ = 290, NE = 291, STREQ = 292, STRNEQ = 293, LE = 294, GE = 295, OR = 296, AND = 297, PLUSPLUS = 298, MINUSMINUS = 299, LSHIFT = 300, RSHIFT = 301, URSHIFT = 302, PLUSEQUAL = 303, MINUSEQUAL = 304, MULTEQUAL = 305, DIVEQUAL = 306, LSHIFTEQUAL = 307, RSHIFTEQUAL = 308, URSHIFTEQUAL = 309, ANDEQUAL = 310, MODEQUAL = 311, XOREQUAL = 312, OREQUAL = 313, IDENT = 314, AUTOPLUSPLUS = 315, AUTOMINUSMINUS = 316 };#endif#define NULLTOKEN 258#define TRUETOKEN 259#define FALSETOKEN 260#define STRING 261#define NUMBER 262#define BREAK 263#define CASE 264#define DEFAULT 265#define FOR 266#define NEW 267#define VAR 268#define CONST 269#define CONTINUE 270#define FUNCTION 271#define RETURN 272#define VOID 273#define DELETE 274#define IF 275#define THIS 276#define DO 277#define WHILE 278#define ELSE 279#define IN 280#define INSTANCEOF 281#define TYPEOF 282#define SWITCH 283#define WITH 284#define RESERVED 285#define THROW 286#define TRY 287#define CATCH 288#define FINALLY 289#define EQEQ 290#define NE 291#define STREQ 292#define STRNEQ 293#define LE 294#define GE 295#define OR 296#define AND 297#define PLUSPLUS 298#define MINUSMINUS 299#define LSHIFT 300#define RSHIFT 301#define URSHIFT 302#define PLUSEQUAL 303#define MINUSEQUAL 304#define MULTEQUAL 305#define DIVEQUAL 306#define LSHIFTEQUAL 307#define RSHIFTEQUAL 308#define URSHIFTEQUAL 309#define ANDEQUAL 310#define MODEQUAL 311#define XOREQUAL 312#define OREQUAL 313#define IDENT 314#define AUTOPLUSPLUS 315#define AUTOMINUSMINUS 316/* Copy the first part of user declarations. */#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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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"/* default values for bison */#define YYDEBUG 0#define YYMAXDEPTH 0#define YYERROR_VERBOSE#define DBG(l, s, e) { l->setLoc(s.first_line, e.last_line, Parser::source); } // locationextern int yylex();static int yyerror (const char *);static bool automatic();using namespace KJS;/* Enabling traces. */#ifndef YYDEBUG# define YYDEBUG 0#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)#line 50 "grammar.y"typedef union YYSTYPE { int ival; double dval; UString *ustr; Identifier *ident; Node *node; StatementNode *stat; ParameterNode *param; FunctionBodyNode *body; FuncDeclNode *func; FunctionBodyNode *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;/* Line 191 of yacc.c. */#line 284 "grammar.tab.c"# define yystype YYSTYPE /* obsolescent; will be withdrawn */# define YYSTYPE_IS_DECLARED 1# define YYSTYPE_IS_TRIVIAL 1#endif#if ! defined (YYLTYPE) && ! defined (YYLTYPE_IS_DECLARED)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?