Debian Codegraph @

src/3rdparty/javascriptcore/JavaScriptCore/parser/Lexer.h

raw symbols SCIP
1 /*
2 * Copyright (C) 1999-2000 Harri Porten ([email protected])
3 * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
14 *
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19 *
20 */
21
22 #ifndef Lexer_h
23 #define Lexer_hcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/parser/Lexer.h:23:9`!
24
25 #include "Lookup.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Lookup.h`/
26 #include "ParserArena.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/parser/ParserArena.h`/
27 #include "SourceCode.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/parser/SourceCode.h`/
28 #include <wtf/ASCIICType.h>cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/wtf/ASCIICType.h`/
29 #include <wtf/SegmentedVector.h>cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/wtf/SegmentedVector.h`/
30 #include <wtf/Vector.h>cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Vector.h`/
31 #include <wtf/unicode/Unicode.h>cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/wtf/unicode/Unicode.h`/
32
33 namespace JSCcxx . . $ QTJSC/ {
34
35 class RegExpcxx . . $ QTJSC/RegExp#;
36
37 class Lexercxx . . $ QTJSC/Lexer# : public Noncopyablecxx . . $ Noncopyable# {
38 public:
39 // Character manipulation functions.
40 static bool isWhiteSpacecxx . . $ QTJSC/Lexer#isWhiteSpace(83c267b20bac841a).(int character);
41 static bool isLineTerminatorcxx . . $ QTJSC/Lexer#isLineTerminator(83c267b20bac841a).(int character);
42 static unsigned char convertHexcxx . . $ QTJSC/Lexer#convertHex(9b283c7f02910f2b).(int c1, int c2);
43 static UCharcxx . . $ UChar# convertUnicodecxx . . $ QTJSC/Lexer#convertUnicode(9201b605cda5d4e5).(int c1, int c2, int c3, int c4);
44
45 // Functions to set up parsing.
46 void setCodecxx . . $ QTJSC/Lexer#setCode(69629f4309bb4539).(const SourceCodecxx . . $ QTJSC/SourceCode#&, ParserArenacxx . . $ QTJSC/ParserArena#&);
47 void setIsReparsingcxx . . $ QTJSC/Lexer#setIsReparsing(49f6e7a06ebc5aa8).() { m_isReparsingcxx . . $ QTJSC/Lexer#m_isReparsing. = true; }
48
49 // Functions for the parser itself.
50 int lexcxx . . $ QTJSC/Lexer#lex(361d5d7064a2a85d).(void* lvalp, void* llocp);
51 int lineNumbercxx . . $ QTJSC/Lexer#lineNumber(455f465bc33b4cdf).() const { return m_lineNumbercxx . . $ QTJSC/Lexer#m_lineNumber.; }
52 bool prevTerminatorcxx . . $ QTJSC/Lexer#prevTerminator(50ce9a9e25b4a850).() const { return m_terminatorcxx . . $ QTJSC/Lexer#m_terminator.; }
53 SourceCodecxx . . $ QTJSC/SourceCode# sourceCodecxx . . $ QTJSC/Lexer#sourceCode(96d171769b0f0fbc).(int openBrace, int closeBrace, int firstLine);
54 bool scanRegExpcxx . . $ QTJSC/Lexer#scanRegExp(459e00499e8f3668).(const Identifiercxx . . $ QTJSC/Identifier#*& pattern, const Identifiercxx . . $ QTJSC/Identifier#*& flags, UCharcxx . . $ UChar# patternPrefix = 0);
55 bool skipRegExpcxx . . $ QTJSC/Lexer#skipRegExp(c9857a73d68e59ba).();
56
57 // Functions for use after parsing.
58 bool sawErrorcxx . . $ QTJSC/Lexer#sawError(50ce9a9e25b4a850).() const { return m_errorcxx . . $ QTJSC/Lexer#m_error.; }
59 void clearcxx . . $ QTJSC/Lexer#clear(49f6e7a06ebc5aa8).();
60
61 private:
62 friend class JSGlobalDatacxx . . $ QTJSC/JSGlobalData#;
63
64 Lexercxx . . $ QTJSC/Lexer#Lexer(71c44650a83bfd83).(JSGlobalDatacxx . . $ QTJSC/JSGlobalData#*);
65 ~cxx . . $ QTJSC/Lexer#`~Lexer`(49f6e7a06ebc5aa8).Lexercxx . . $ QTJSC/Lexer#();
66
67 void shift1cxx . . $ QTJSC/Lexer#shift1(49f6e7a06ebc5aa8).();
68 void shift2cxx . . $ QTJSC/Lexer#shift2(49f6e7a06ebc5aa8).();
69 void shift3cxx . . $ QTJSC/Lexer#shift3(49f6e7a06ebc5aa8).();
70 void shift4cxx . . $ QTJSC/Lexer#shift4(49f6e7a06ebc5aa8).();
71 void shiftLineTerminatorcxx . . $ QTJSC/Lexer#shiftLineTerminator(49f6e7a06ebc5aa8).();
72
73 void record8cxx . . $ QTJSC/Lexer#record8(d4f767463ce0a6b3).(int);
74 void record16cxx . . $ QTJSC/Lexer#record16(d4f767463ce0a6b3).(int);
75 void record16cxx . . $ QTJSC/Lexer#record16(ed53e3bbd3fa2f69).(UCharcxx . . $ UChar#);
76
77 void copyCodeWithoutBOMscxx . . $ QTJSC/Lexer#copyCodeWithoutBOMs(49f6e7a06ebc5aa8).();
78
79 int currentOffsetcxx . . $ QTJSC/Lexer#currentOffset(455f465bc33b4cdf).() const;
80 const UCharcxx . . $ UChar#* currentCharactercxx . . $ QTJSC/Lexer#currentCharacter(9865edf6270d80f8).() const;
81
82 const Identifiercxx . . $ QTJSC/Identifier#* makeIdentifiercxx . . $ QTJSC/Lexer#makeIdentifier(d48f18586cb793f7).(const UCharcxx . . $ UChar#* characters, size_tcxx . . $ size_t# length);
83
84 bool lastTokenWasRestrKeywordcxx . . $ QTJSC/Lexer#lastTokenWasRestrKeyword(50ce9a9e25b4a850).() const;
85
86 static const size_tcxx . . $ size_t# initialReadBufferCapacitycxx . . $ QTJSC/Lexer#initialReadBufferCapacity. = 32;
87
88 int m_lineNumbercxx . . $ QTJSC/Lexer#m_lineNumber.;
89
90 Vector<char> m_buffer8cxx . . $ QTJSC/Lexer#m_buffer8.;
91 Vector<UChar> m_buffer16cxx . . $ QTJSC/Lexer#m_buffer16.;
92 bool m_terminatorcxx . . $ QTJSC/Lexer#m_terminator.;
93 bool m_delimitedcxx . . $ QTJSC/Lexer#m_delimited.; // encountered delimiter like "'" and "}" on last run
94 int m_lastTokencxx . . $ QTJSC/Lexer#m_lastToken.;
95
96 const SourceCodecxx . . $ QTJSC/SourceCode#* m_sourcecxx . . $ QTJSC/Lexer#m_source.;
97 const UCharcxx . . $ UChar#* m_codecxx . . $ QTJSC/Lexer#m_code.;
98 const UCharcxx . . $ UChar#* m_codeStartcxx . . $ QTJSC/Lexer#m_codeStart.;
99 const UCharcxx . . $ UChar#* m_codeEndcxx . . $ QTJSC/Lexer#m_codeEnd.;
100 bool m_isReparsingcxx . . $ QTJSC/Lexer#m_isReparsing.;
101 bool m_atLineStartcxx . . $ QTJSC/Lexer#m_atLineStart.;
102 bool m_errorcxx . . $ QTJSC/Lexer#m_error.;
103
104 // current and following unicode characters (int to allow for -1 for end-of-file marker)
105 int m_currentcxx . . $ QTJSC/Lexer#m_current.;
106 int m_next1cxx . . $ QTJSC/Lexer#m_next1.;
107 int m_next2cxx . . $ QTJSC/Lexer#m_next2.;
108 int m_next3cxx . . $ QTJSC/Lexer#m_next3.;
109
110 IdentifierArenacxx . . $ QTJSC/IdentifierArena#* m_arenacxx . . $ QTJSC/Lexer#m_arena.;
111
112 JSGlobalDatacxx . . $ QTJSC/JSGlobalData#* m_globalDatacxx . . $ QTJSC/Lexer#m_globalData.;
113
114 const HashTablecxx . . $ QTJSC/HashTable# m_keywordTablecxx . . $ QTJSC/Lexer#m_keywordTable.;
115
116 Vector<UChar> m_codeWithoutBOMscxx . . $ QTJSC/Lexer#m_codeWithoutBOMs.;
117 };
118
119 inline bool Lexercxx . . $ QTJSC/Lexer#::isWhiteSpacecxx . . $ QTJSC/Lexer#isWhiteSpace(83c267b20bac841a).(int ch)
120 {
121 return isASCIIcxx . . $ isASCII(83c267b20bac841a).(ch) ? (ch == ' ' || ch == '\t' || ch == 0xB || ch == 0xC) : WTFcxx . . $ QTWTF/::Unicodecxx . . $ QTWTF/Unicode/::isSeparatorSpacecxx . . $ QTWTF/Unicode/isSeparatorSpace(83c267b20bac841a).(ch);
122 }
123
124 inline bool Lexercxx . . $ QTJSC/Lexer#::isLineTerminatorcxx . . $ QTJSC/Lexer#isLineTerminator(83c267b20bac841a).(int ch)
125 {
126 return ch == '\r' || ch == '\n' || (ch & ~1) == 0x2028;
127 }
128
129 inline unsigned char Lexercxx . . $ QTJSC/Lexer#::convertHexcxx . . $ QTJSC/Lexer#convertHex(9b283c7f02910f2b).(int c1, int c2)
130 {
131 return (toASCIIHexValuecxx . . $ toASCIIHexValue(7864480464b09eea).(c1) << 4) | toASCIIHexValuecxx . . $ toASCIIHexValue(7864480464b09eea).(c2);
132 }
133
134 inline UCharcxx . . $ UChar# Lexercxx . . $ QTJSC/Lexer#::convertUnicodecxx . . $ QTJSC/Lexer#convertUnicode(9201b605cda5d4e5).(int c1, int c2, int c3, int c4)
135 {
136 return (convertHexcxx . . $ QTJSC/Lexer#convertHex(9b283c7f02910f2b).(c1, c2) << 8) | convertHexcxx . . $ QTJSC/Lexer#convertHex(9b283c7f02910f2b).(c3, c4);
137 }
138
139 // A bridge for yacc from the C world to the C++ world.
140 inline int jscyylexcxx . . $ `<built-in>:465:9`!(void* lvalp, void* llocp, void* globalData)
141 {
142 return static_cast<JSGlobalDatacxx . . $ QTJSC/JSGlobalData#*>(globalData)->lexercxx . . $ QTJSC/JSGlobalData#lexer.->lexcxx . . $ QTJSC/Lexer#lex(361d5d7064a2a85d).(lvalp, llocp);
143 }
144
145 } // namespace JSC
146
147 #endif // Lexer_h