| 1 | /* |
| 2 | * Copyright (C) 1999-2001 Harri Porten ([email protected]) |
| 3 | * Copyright (C) 2001 Peter Kelly ([email protected]) |
| 4 | * Copyright (C) 2003, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 5 | * |
| 6 | * This library is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU Library General Public |
| 8 | * License as published by the Free Software Foundation; either |
| 9 | * version 2 of the License, or (at your option) any later version. |
| 10 | * |
| 11 | * This library is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 | * Library General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU Library General Public License |
| 17 | * along with this library; see the file COPYING.LIB. If not, write to |
| 18 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 19 | * Boston, MA 02110-1301, USA. |
| 20 | * |
| 21 | */ |
| 22 | |
| 23 | #ifndef Parser_h |
| 24 | #define Parser_hcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/parser/Parser.h:24:9`! |
| 25 | |
| 26 | #include "Debugger.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/debugger/Debugger.h`/ |
| 27 | #include "Executable.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Executable.h`/ |
| 28 | #include "JSGlobalObject.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalObject.h`/ |
| 29 | #include "Lexer.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/parser/Lexer.h`/ |
| 30 | #include "Nodes.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/parser/Nodes.h`/ |
| 31 | #include "ParserArena.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/parser/ParserArena.h`/ |
| 32 | #include "SourceProvider.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/parser/SourceProvider.h`/ |
| 33 | #include <wtf/Forward.h>cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Forward.h`/ |
| 34 | #include <wtf/Noncopyable.h>cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Noncopyable.h`/ |
| 35 | #include <wtf/OwnPtr.h>cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/wtf/OwnPtr.h`/ |
| 36 | #include <wtf/RefPtr.h>cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/wtf/RefPtr.h`/ |
| 37 | |
| 38 | namespace JSCcxx . . $ QTJSC/ { |
| 39 | |
| 40 | class FunctionBodyNodecxx . . $ QTJSC/FunctionBodyNode#; |
| 41 | class ProgramNodecxx . . $ QTJSC/ProgramNode#; |
| 42 | class UStringcxx . . $ QTJSC/UString#; |
| 43 | |
| 44 | template <typename T> struct ParserArenaDatacxx . . $ QTJSC/ParserArenaData# : ParserArenaDeletablecxx . . $ QTJSC/ParserArenaDeletable# { T datacxx . . $ QTJSC/ParserArenaData#data.; }; |
| 45 | |
| 46 | class Parsercxx . . $ QTJSC/Parser# : public Noncopyablecxx . . $ Noncopyable# { |
| 47 | public: |
| 48 | template <class ParsedNode> |
| 49 | PassRefPtrcxx . . $ PassRefPtr#<ParsedNode> parsecxx . . $ QTJSC/Parser#parse(db72a35939f809f7).(JSGlobalDatacxx . . $ QTJSC/JSGlobalData#* globalData, Debuggercxx . . $ QTJSC/Debugger#*, ExecStatecxx . . $ QTJSC/ExecState#*, const SourceCodecxx . . $ QTJSC/SourceCode#& source, int* errLine = 0, UStringcxx . . $ QTJSC/UString#* errMsg = 0); |
| 50 | |
| 51 | void didFinishParsingcxx . . $ QTJSC/Parser#didFinishParsing(f0ff909e210786f7).(SourceElementscxx . . $ QTJSC/SourceElements#*, ParserArenaDatacxx . . $ QTJSC/ParserArenaData#<DeclarationStackscxx . . $ QTJSC/DeclarationStacks/::VarStackcxx . . $ QTJSC/DeclarationStacks/VarStack#>*, |
| 52 | ParserArenaDatacxx . . $ QTJSC/ParserArenaData#<DeclarationStackscxx . . $ QTJSC/DeclarationStacks/::FunctionStackcxx . . $ QTJSC/DeclarationStacks/FunctionStack#>*, CodeFeaturescxx . . $ QTJSC/CodeFeatures# features, int lastLine, int numConstants); |
| 53 | |
| 54 | ParserArenacxx . . $ QTJSC/ParserArena#& arenacxx . . $ QTJSC/Parser#arena(227429ff432d858a).() { return m_arena; } |
| 55 | |
| 56 | private: |
| 57 | void parsecxx . . $ QTJSC/Parser#parse(7f2c40dcdf210084).(JSGlobalDatacxx . . $ QTJSC/JSGlobalData#*, int* errLine, UStringcxx . . $ QTJSC/UString#* errMsg); |
| 58 | |
| 59 | ParserArenacxx . . $ QTJSC/ParserArena# m_arenacxx . . $ QTJSC/Parser#m_arena.; |
| 60 | const SourceCodecxx . . $ QTJSC/SourceCode#* m_sourcecxx . . $ QTJSC/Parser#m_source.; |
| 61 | SourceElementscxx . . $ QTJSC/SourceElements#* m_sourceElementscxx . . $ QTJSC/Parser#m_sourceElements.; |
| 62 | ParserArenaDatacxx . . $ QTJSC/ParserArenaData#<DeclarationStackscxx . . $ QTJSC/DeclarationStacks/::VarStackcxx . . $ QTJSC/DeclarationStacks/VarStack#>* m_varDeclarationscxx . . $ QTJSC/Parser#m_varDeclarations.; |
| 63 | ParserArenaDatacxx . . $ QTJSC/ParserArenaData#<DeclarationStackscxx . . $ QTJSC/DeclarationStacks/::FunctionStackcxx . . $ QTJSC/DeclarationStacks/FunctionStack#>* m_funcDeclarationscxx . . $ QTJSC/Parser#m_funcDeclarations.; |
| 64 | CodeFeaturescxx . . $ QTJSC/CodeFeatures# m_featurescxx . . $ QTJSC/Parser#m_features.; |
| 65 | int m_lastLinecxx . . $ QTJSC/Parser#m_lastLine.; |
| 66 | int m_numConstantscxx . . $ QTJSC/Parser#m_numConstants.; |
| 67 | }; |
| 68 | |
| 69 | template <class ParsedNode> |
| 70 | PassRefPtrcxx . . $ PassRefPtr#<ParsedNode> Parsercxx . . $ QTJSC/Parser#::parsecxx . . $ QTJSC/Parser#parse(db72a35939f809f7).(JSGlobalDatacxx . . $ QTJSC/JSGlobalData#* globalData, Debuggercxx . . $ QTJSC/Debugger#* debugger, ExecStatecxx . . $ QTJSC/ExecState#* debuggerExecState, const SourceCodecxx . . $ QTJSC/SourceCode#& source, int* errLine, UStringcxx . . $ QTJSC/UString#* errMsg) |
| 71 | { |
| 72 | m_sourcecxx . . $ QTJSC/Parser#m_source. = &source; |
| 73 | if (ParsedNode::scopeIsFunction) |
| 74 | globalData->lexercxx . . $ QTJSC/JSGlobalData#lexer.->setIsReparsingcxx . . $ QTJSC/Lexer#setIsReparsing(49f6e7a06ebc5aa8).(); |
| 75 | parsecxx . . $ QTJSC/Parser#parse(7f2c40dcdf210084).(globalData, errLine, errMsg); |
| 76 | |
| 77 | RefPtrcxx . . $ RefPtr#<ParsedNode> result; |
| 78 | if (m_sourceElementscxx . . $ QTJSC/Parser#m_sourceElements.) { |
| 79 | result = ParsedNode::create(globalData, |
| 80 | m_sourceElementscxx . . $ QTJSC/Parser#m_sourceElements., |
| 81 | m_varDeclarationscxx . . $ QTJSC/Parser#m_varDeclarations. ? &m_varDeclarationscxx . . $ QTJSC/Parser#m_varDeclarations.->data : 0, |
| 82 | m_funcDeclarationscxx . . $ QTJSC/Parser#m_funcDeclarations. ? &m_funcDeclarationscxx . . $ QTJSC/Parser#m_funcDeclarations.->data : 0, |
| 83 | source, |
| 84 | m_featurescxx . . $ QTJSC/Parser#m_features., |
| 85 | m_numConstantscxx . . $ QTJSC/Parser#m_numConstants.); |
| 86 | result->setLoc(m_sourcecxx . . $ QTJSC/Parser#m_source.->firstLinecxx . . $ QTJSC/SourceCode#firstLine(455f465bc33b4cdf).(), m_lastLinecxx . . $ QTJSC/Parser#m_lastLine.); |
| 87 | } |
| 88 | |
| 89 | m_arena.reset(); |
| 90 | |
| 91 | m_sourcecxx . . $ QTJSC/Parser#m_source. = 0; |
| 92 | m_sourceElementscxx . . $ QTJSC/Parser#m_sourceElements. = 0; |
| 93 | m_varDeclarationscxx . . $ QTJSC/Parser#m_varDeclarations. = 0; |
| 94 | m_funcDeclarationscxx . . $ QTJSC/Parser#m_funcDeclarations. = 0; |
| 95 | |
| 96 | if (debugger && !ParsedNode::scopeIsFunction) |
| 97 | debugger->sourceParsedcxx . . $ QTJSC/Debugger#sourceParsed(b9d3e5b00e66c0ae).(debuggerExecState, source, *errLine, *errMsg); |
| 98 | return result.releasecxx . . $ QTWTF/RefPtr#release(fefcb7d0da452c2c).(); |
| 99 | } |
| 100 | |
| 101 | } // namespace JSC |
| 102 | |
| 103 | #endif // Parser_h |