webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
Public Types | Public Member Functions | Static Public Member Functions | List of all members
JSC::Lexer< T > Class Template Reference

#include <Lexer.h>

Public Types

enum  RawStringsBuildMode { RawStringsBuildMode::BuildRawStrings, RawStringsBuildMode::DontBuildRawStrings, RawStringsBuildMode::BuildRawStrings, RawStringsBuildMode::DontBuildRawStrings }
 
enum  RawStringsBuildMode { RawStringsBuildMode::BuildRawStrings, RawStringsBuildMode::DontBuildRawStrings, RawStringsBuildMode::BuildRawStrings, RawStringsBuildMode::DontBuildRawStrings }
 

Public Member Functions

 Lexer (VM *, JSParserBuiltinMode, JSParserScriptMode)
 
 ~Lexer ()
 
void setCode (const SourceCode &, ParserArena *)
 
void setIsReparsingFunction ()
 
bool isReparsingFunction () const
 
JSTokenType lex (JSToken *, unsigned, bool strictMode)
 
bool nextTokenIsColon ()
 
int lineNumber () const
 
ALWAYS_INLINE int currentOffset () const
 
ALWAYS_INLINE int currentLineStartOffset () const
 
ALWAYS_INLINE JSTextPosition currentPosition () const
 
JSTextPosition positionBeforeLastNewline () const
 
JSTokenLocation lastTokenLocation () const
 
void setLastLineNumber (int lastLineNumber)
 
int lastLineNumber () const
 
bool prevTerminator () const
 
JSTokenType scanRegExp (JSToken *, UChar patternPrefix=0)
 
JSTokenType scanTemplateString (JSToken *, RawStringsBuildMode)
 
bool sawError () const
 
void setSawError (bool sawError)
 
String getErrorMessage () const
 
void setErrorMessage (const String &errorMessage)
 
String sourceURL () const
 
String sourceMappingURL () const
 
void clear ()
 
void setOffset (int offset, int lineStartOffset)
 
void setLineNumber (int line)
 
void setTerminator (bool terminator)
 
JSTokenType lexExpectIdentifier (JSToken *, unsigned, bool strictMode)
 
ALWAYS_INLINE StringView getToken (const JSToken &token)
 
 Lexer (VM *, JSParserBuiltinMode, JSParserScriptMode)
 
 ~Lexer ()
 
void setCode (const SourceCode &, ParserArena *)
 
void setIsReparsingFunction ()
 
bool isReparsingFunction () const
 
JSTokenType lex (JSToken *, unsigned, bool strictMode)
 
bool nextTokenIsColon ()
 
int lineNumber () const
 
ALWAYS_INLINE int currentOffset () const
 
ALWAYS_INLINE int currentLineStartOffset () const
 
ALWAYS_INLINE JSTextPosition currentPosition () const
 
JSTextPosition positionBeforeLastNewline () const
 
JSTokenLocation lastTokenLocation () const
 
void setLastLineNumber (int lastLineNumber)
 
int lastLineNumber () const
 
bool prevTerminator () const
 
JSTokenType scanRegExp (JSToken *, UChar patternPrefix=0)
 
JSTokenType scanTemplateString (JSToken *, RawStringsBuildMode)
 
bool sawError () const
 
void setSawError (bool sawError)
 
String getErrorMessage () const
 
void setErrorMessage (const String &errorMessage)
 
String sourceURL () const
 
String sourceMappingURL () const
 
void clear ()
 
void setOffset (int offset, int lineStartOffset)
 
void setLineNumber (int line)
 
void setTerminator (bool terminator)
 
JSTokenType lexExpectIdentifier (JSToken *, unsigned, bool strictMode)
 
ALWAYS_INLINE StringView getToken (const JSToken &token)
 
template<>
ALWAYS_INLINE bool isWhiteSpace (LChar ch)
 
template<>
ALWAYS_INLINE bool isWhiteSpace (UChar ch)
 
template<>
ALWAYS_INLINE bool isLineTerminator (LChar ch)
 
template<>
ALWAYS_INLINE bool isLineTerminator (UChar ch)
 
template<int shiftAmount>
ALWAYS_INLINE void internalShift ()
 
template<bool shouldCreateIdentifier>
JSTokenType parseIdentifierSlowCase (JSTokenData *tokenData, unsigned lexerFlags, bool strictMode)
 
template<bool shouldBuildStrings, LexerEscapeParseMode escapeParseMode>
ALWAYS_INLINE auto parseComplexEscape (bool strictMode, T stringQuoteCharacter) -> StringParseResult
 
template<bool shouldBuildStrings>
auto parseStringSlowCase (JSTokenData *tokenData, bool strictMode) -> StringParseResult
 
template<>
ALWAYS_INLINE bool isWhiteSpace (LChar ch)
 
template<>
ALWAYS_INLINE bool isWhiteSpace (UChar ch)
 
template<>
ALWAYS_INLINE bool isLineTerminator (LChar ch)
 
template<>
ALWAYS_INLINE bool isLineTerminator (UChar ch)
 

Static Public Member Functions

static bool isWhiteSpace (T character)
 
static bool isLineTerminator (T character)
 
static unsigned char convertHex (int c1, int c2)
 
static UChar convertUnicode (int c1, int c2, int c3, int c4)
 
static bool isWhiteSpace (T character)
 
static bool isLineTerminator (T character)
 
static unsigned char convertHex (int c1, int c2)
 
static UChar convertUnicode (int c1, int c2, int c3, int c4)
 

Member Enumeration Documentation

◆ RawStringsBuildMode [1/2]

template<typename T >
enum JSC::Lexer::RawStringsBuildMode
strong
Enumerator
BuildRawStrings 
DontBuildRawStrings 
BuildRawStrings 
DontBuildRawStrings 

◆ RawStringsBuildMode [2/2]

template<typename T >
enum JSC::Lexer::RawStringsBuildMode
strong
Enumerator
BuildRawStrings 
DontBuildRawStrings 
BuildRawStrings 
DontBuildRawStrings 

Constructor & Destructor Documentation

◆ Lexer() [1/2]

template<typename T >
JSC::Lexer< T >::Lexer ( VM vm,
JSParserBuiltinMode  builtinMode,
JSParserScriptMode  scriptMode 
)

◆ ~Lexer() [1/2]

template<typename T >
JSC::Lexer< T >::~Lexer ( )

◆ Lexer() [2/2]

template<typename T >
JSC::Lexer< T >::Lexer ( VM ,
JSParserBuiltinMode  ,
JSParserScriptMode   
)

◆ ~Lexer() [2/2]

template<typename T >
JSC::Lexer< T >::~Lexer ( )

Member Function Documentation

◆ clear() [1/2]

template<typename T >
void JSC::Lexer< T >::clear ( )

◆ clear() [2/2]

template<typename T >
void JSC::Lexer< T >::clear ( )

◆ convertHex() [1/2]

template<typename T >
static unsigned char JSC::Lexer< T >::convertHex ( int  c1,
int  c2 
)
static

◆ convertHex() [2/2]

template<typename T >
unsigned char JSC::Lexer< T >::convertHex ( int  c1,
int  c2 
)
inlinestatic

◆ convertUnicode() [1/2]

template<typename T >
UChar JSC::Lexer< T >::convertUnicode ( int  c1,
int  c2,
int  c3,
int  c4 
)
inlinestatic

◆ convertUnicode() [2/2]

template<typename T >
static UChar JSC::Lexer< T >::convertUnicode ( int  c1,
int  c2,
int  c3,
int  c4 
)
static

◆ currentLineStartOffset() [1/2]

template<typename T >
ALWAYS_INLINE int JSC::Lexer< T >::currentLineStartOffset ( ) const
inline

◆ currentLineStartOffset() [2/2]

template<typename T >
ALWAYS_INLINE int JSC::Lexer< T >::currentLineStartOffset ( ) const
inline

◆ currentOffset() [1/2]

template<typename T >
ALWAYS_INLINE int JSC::Lexer< T >::currentOffset ( ) const
inline

◆ currentOffset() [2/2]

template<typename T >
ALWAYS_INLINE int JSC::Lexer< T >::currentOffset ( ) const
inline

◆ currentPosition() [1/2]

template<typename T >
ALWAYS_INLINE JSTextPosition JSC::Lexer< T >::currentPosition ( ) const
inline

◆ currentPosition() [2/2]

template<typename T >
ALWAYS_INLINE JSTextPosition JSC::Lexer< T >::currentPosition ( ) const
inline

◆ getErrorMessage() [1/2]

template<typename T >
String JSC::Lexer< T >::getErrorMessage ( ) const
inline

◆ getErrorMessage() [2/2]

template<typename T >
String JSC::Lexer< T >::getErrorMessage ( ) const
inline

◆ getToken() [1/2]

template<typename T >
ALWAYS_INLINE StringView JSC::Lexer< T >::getToken ( const JSToken token)
inline

◆ getToken() [2/2]

template<typename T >
ALWAYS_INLINE StringView JSC::Lexer< T >::getToken ( const JSToken token)
inline

◆ internalShift()

template<typename T >
template<int shiftAmount>
ALWAYS_INLINE void JSC::Lexer< T >::internalShift ( )

◆ isLineTerminator() [1/6]

template<typename T >
static bool JSC::Lexer< T >::isLineTerminator ( T  character)
static

◆ isLineTerminator() [2/6]

template<typename T >
static bool JSC::Lexer< T >::isLineTerminator ( T  character)
static

◆ isLineTerminator() [3/6]

template<>
ALWAYS_INLINE bool JSC::Lexer< LChar >::isLineTerminator ( LChar  ch)

◆ isLineTerminator() [4/6]

template<>
ALWAYS_INLINE bool JSC::Lexer< LChar >::isLineTerminator ( LChar  ch)

◆ isLineTerminator() [5/6]

template<>
ALWAYS_INLINE bool JSC::Lexer< UChar >::isLineTerminator ( UChar  ch)

◆ isLineTerminator() [6/6]

template<>
ALWAYS_INLINE bool JSC::Lexer< UChar >::isLineTerminator ( UChar  ch)

◆ isReparsingFunction() [1/2]

template<typename T >
bool JSC::Lexer< T >::isReparsingFunction ( ) const
inline

◆ isReparsingFunction() [2/2]

template<typename T >
bool JSC::Lexer< T >::isReparsingFunction ( ) const
inline

◆ isWhiteSpace() [1/6]

template<typename T >
static bool JSC::Lexer< T >::isWhiteSpace ( T  character)
static

◆ isWhiteSpace() [2/6]

template<typename T >
static bool JSC::Lexer< T >::isWhiteSpace ( T  character)
static

◆ isWhiteSpace() [3/6]

template<>
ALWAYS_INLINE bool JSC::Lexer< LChar >::isWhiteSpace ( LChar  ch)

◆ isWhiteSpace() [4/6]

template<>
ALWAYS_INLINE bool JSC::Lexer< LChar >::isWhiteSpace ( LChar  ch)

◆ isWhiteSpace() [5/6]

template<>
ALWAYS_INLINE bool JSC::Lexer< UChar >::isWhiteSpace ( UChar  ch)

◆ isWhiteSpace() [6/6]

template<>
ALWAYS_INLINE bool JSC::Lexer< UChar >::isWhiteSpace ( UChar  ch)

◆ lastLineNumber() [1/2]

template<typename T >
int JSC::Lexer< T >::lastLineNumber ( ) const
inline

◆ lastLineNumber() [2/2]

template<typename T >
int JSC::Lexer< T >::lastLineNumber ( ) const
inline

◆ lastTokenLocation() [1/2]

template<typename T >
JSTokenLocation JSC::Lexer< T >::lastTokenLocation ( ) const
inline

◆ lastTokenLocation() [2/2]

template<typename T >
JSTokenLocation JSC::Lexer< T >::lastTokenLocation ( ) const
inline

◆ lex() [1/2]

template<typename T >
JSTokenType JSC::Lexer< T >::lex ( JSToken ,
unsigned  ,
bool  strictMode 
)

◆ lex() [2/2]

template<typename T >
JSTokenType JSC::Lexer< T >::lex ( JSToken tokenRecord,
unsigned  lexerFlags,
bool  strictMode 
)

◆ lexExpectIdentifier() [1/2]

template<typename T >
JSTokenType JSC::Lexer< T >::lexExpectIdentifier ( JSToken ,
unsigned  ,
bool  strictMode 
)

◆ lexExpectIdentifier() [2/2]

template<typename T >
ALWAYS_INLINE JSTokenType JSC::Lexer< T >::lexExpectIdentifier ( JSToken tokenRecord,
unsigned  lexerFlags,
bool  strictMode 
)

◆ lineNumber() [1/2]

template<typename T >
int JSC::Lexer< T >::lineNumber ( ) const
inline

◆ lineNumber() [2/2]

template<typename T >
int JSC::Lexer< T >::lineNumber ( ) const
inline

◆ nextTokenIsColon() [1/2]

template<typename T >
bool JSC::Lexer< T >::nextTokenIsColon ( )

◆ nextTokenIsColon() [2/2]

template<typename T >
bool JSC::Lexer< T >::nextTokenIsColon ( )

◆ parseComplexEscape()

template<typename T >
template<bool shouldBuildStrings, LexerEscapeParseMode escapeParseMode>
ALWAYS_INLINE auto JSC::Lexer< T >::parseComplexEscape ( bool  strictMode,
T  stringQuoteCharacter 
) -> StringParseResult

◆ parseIdentifierSlowCase()

template<typename T >
template<bool shouldCreateIdentifier>
JSTokenType JSC::Lexer< T >::parseIdentifierSlowCase ( JSTokenData tokenData,
unsigned  lexerFlags,
bool  strictMode 
)

◆ parseStringSlowCase()

template<typename T >
template<bool shouldBuildStrings>
auto JSC::Lexer< T >::parseStringSlowCase ( JSTokenData tokenData,
bool  strictMode 
) -> StringParseResult

◆ positionBeforeLastNewline() [1/2]

template<typename T >
JSTextPosition JSC::Lexer< T >::positionBeforeLastNewline ( ) const
inline

◆ positionBeforeLastNewline() [2/2]

template<typename T >
JSTextPosition JSC::Lexer< T >::positionBeforeLastNewline ( ) const
inline

◆ prevTerminator() [1/2]

template<typename T >
bool JSC::Lexer< T >::prevTerminator ( ) const
inline

◆ prevTerminator() [2/2]

template<typename T >
bool JSC::Lexer< T >::prevTerminator ( ) const
inline

◆ sawError() [1/2]

template<typename T >
bool JSC::Lexer< T >::sawError ( ) const
inline

◆ sawError() [2/2]

template<typename T >
bool JSC::Lexer< T >::sawError ( ) const
inline

◆ scanRegExp() [1/2]

template<typename T >
JSTokenType JSC::Lexer< T >::scanRegExp ( JSToken tokenRecord,
UChar  patternPrefix = 0 
)

◆ scanRegExp() [2/2]

template<typename T >
JSTokenType JSC::Lexer< T >::scanRegExp ( JSToken ,
UChar  patternPrefix = 0 
)

◆ scanTemplateString() [1/2]

template<typename T >
JSTokenType JSC::Lexer< T >::scanTemplateString ( JSToken tokenRecord,
RawStringsBuildMode  rawStringsBuildMode 
)

◆ scanTemplateString() [2/2]

template<typename T >
JSTokenType JSC::Lexer< T >::scanTemplateString ( JSToken ,
RawStringsBuildMode   
)

◆ setCode() [1/2]

template<typename T >
void JSC::Lexer< T >::setCode ( const SourceCode ,
ParserArena  
)

◆ setCode() [2/2]

template<typename T >
void JSC::Lexer< T >::setCode ( const SourceCode source,
ParserArena arena 
)

◆ setErrorMessage() [1/2]

template<typename T >
void JSC::Lexer< T >::setErrorMessage ( const String errorMessage)
inline

◆ setErrorMessage() [2/2]

template<typename T >
void JSC::Lexer< T >::setErrorMessage ( const String errorMessage)
inline

◆ setIsReparsingFunction() [1/2]

template<typename T >
void JSC::Lexer< T >::setIsReparsingFunction ( )
inline

◆ setIsReparsingFunction() [2/2]

template<typename T >
void JSC::Lexer< T >::setIsReparsingFunction ( )
inline

◆ setLastLineNumber() [1/2]

template<typename T >
void JSC::Lexer< T >::setLastLineNumber ( int  lastLineNumber)
inline

◆ setLastLineNumber() [2/2]

template<typename T >
void JSC::Lexer< T >::setLastLineNumber ( int  lastLineNumber)
inline

◆ setLineNumber() [1/2]

template<typename T >
void JSC::Lexer< T >::setLineNumber ( int  line)
inline

◆ setLineNumber() [2/2]

template<typename T >
void JSC::Lexer< T >::setLineNumber ( int  line)
inline

◆ setOffset() [1/2]

template<typename T >
void JSC::Lexer< T >::setOffset ( int  offset,
int  lineStartOffset 
)
inline

◆ setOffset() [2/2]

template<typename T >
void JSC::Lexer< T >::setOffset ( int  offset,
int  lineStartOffset 
)
inline

◆ setSawError() [1/2]

template<typename T >
void JSC::Lexer< T >::setSawError ( bool  sawError)
inline

◆ setSawError() [2/2]

template<typename T >
void JSC::Lexer< T >::setSawError ( bool  sawError)
inline

◆ setTerminator() [1/2]

template<typename T >
void JSC::Lexer< T >::setTerminator ( bool  terminator)
inline

◆ setTerminator() [2/2]

template<typename T >
void JSC::Lexer< T >::setTerminator ( bool  terminator)
inline

◆ sourceMappingURL() [1/2]

template<typename T >
String JSC::Lexer< T >::sourceMappingURL ( ) const
inline

◆ sourceMappingURL() [2/2]

template<typename T >
String JSC::Lexer< T >::sourceMappingURL ( ) const
inline

◆ sourceURL() [1/2]

template<typename T >
String JSC::Lexer< T >::sourceURL ( ) const
inline

◆ sourceURL() [2/2]

template<typename T >
String JSC::Lexer< T >::sourceURL ( ) const
inline

The documentation for this class was generated from the following files: