webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
Classes | Public Member Functions | List of all members
JSC::Parser< LexerType > Class Template Reference

#include <Parser.h>

Public Member Functions

 Parser (VM *, const SourceCode &, JSParserBuiltinMode, JSParserStrictMode, JSParserScriptMode, SourceParseMode, SuperBinding, ConstructorKind defaultConstructorKind=ConstructorKind::None, DerivedContextType=DerivedContextType::None, bool isEvalContext=false, EvalContextType=EvalContextType::None, DebuggerParseData *=nullptr)
 
 ~Parser ()
 
template<class ParsedNode >
std::unique_ptr< ParsedNode > parse (ParserError &, const Identifier &, SourceParseMode)
 
JSTextPosition positionBeforeLastNewline () const
 
JSTokenLocation locationBeforeLastToken () const
 
 Parser (VM *, const SourceCode &, JSParserBuiltinMode, JSParserStrictMode, JSParserScriptMode, SourceParseMode, SuperBinding, ConstructorKind defaultConstructorKind=ConstructorKind::None, DerivedContextType=DerivedContextType::None, bool isEvalContext=false, EvalContextType=EvalContextType::None, DebuggerParseData *=nullptr)
 
 ~Parser ()
 
template<class ParsedNode >
std::unique_ptr< ParsedNode > parse (ParserError &, const Identifier &, SourceParseMode)
 
JSTextPosition positionBeforeLastNewline () const
 
JSTokenLocation locationBeforeLastToken () const
 
template<typename... Args>
void logError (bool shouldPrintToken, Args &&... args)
 
template<class TreeBuilder >
TreeDestructuringPattern createBindingPattern (TreeBuilder &context, DestructuringKind kind, ExportType exportType, const Identifier &name, JSToken token, AssignmentContext bindingContext, const Identifier **duplicateIdentifier)
 
template<class TreeBuilder >
TreeDestructuringPattern tryParseDestructuringPatternExpression (TreeBuilder &context, AssignmentContext bindingContext)
 
template<class TreeBuilder >
TreeDestructuringPattern parseBindingOrAssignmentElement (TreeBuilder &context, DestructuringKind kind, ExportType exportType, const Identifier **duplicateIdentifier, bool *hasDestructuringPattern, AssignmentContext bindingContext, int depth)
 
template<class TreeBuilder >
TreeDestructuringPattern parseAssignmentElement (TreeBuilder &context, DestructuringKind kind, ExportType exportType, const Identifier **duplicateIdentifier, bool *hasDestructuringPattern, AssignmentContext bindingContext, int depth)
 
template<class TreeBuilder >
TreeDestructuringPattern parseDestructuringPattern (TreeBuilder &context, DestructuringKind kind, ExportType exportType, const Identifier **duplicateIdentifier, bool *hasDestructuringPattern, AssignmentContext bindingContext, int depth)
 
template<class TreeBuilder >
TreeExpression parseDefaultValueForDestructuringPattern (TreeBuilder &context)
 
template<class TreeBuilder >
bool maybeParseAsyncFunctionDeclarationStatement (TreeBuilder &context, TreeStatement &result, bool parentAllowsFunctionDeclarationAsStatement)
 
template<class TreeBuilder >
bool parseFormalParameters (TreeBuilder &context, TreeFormalParameterList list, bool isArrowFunction, unsigned &parameterCount, unsigned &functionLength)
 
template<class TreeBuilder >
TreeFunctionBody parseFunctionBody (TreeBuilder &context, SyntaxChecker &syntaxChecker, const JSTokenLocation &startLocation, int startColumn, int functionKeywordStart, int functionNameStart, int parametersStart, ConstructorKind constructorKind, SuperBinding superBinding, FunctionBodyType bodyType, unsigned parameterCount, unsigned functionLength, SourceParseMode parseMode)
 
template<class TreeBuilder , class FunctionInfoType >
TreeBuilder::FormalParameterList parseFunctionParameters (TreeBuilder &context, SourceParseMode mode, FunctionInfoType &functionInfo)
 
template<class TreeBuilder >
TreeBuilder::FormalParameterList createGeneratorParameters (TreeBuilder &context, unsigned &parameterCount)
 
template<class TreeBuilder >
bool parseFunctionInfo (TreeBuilder &context, FunctionNameRequirements requirements, SourceParseMode mode, bool nameIsInContainingScope, ConstructorKind constructorKind, SuperBinding expectedSuperBinding, int functionKeywordStart, ParserFunctionInfo< TreeBuilder > &functionInfo, FunctionDefinitionType functionDefinitionType)
 
template<class TreeBuilder >
TreeClassExpression parseClass (TreeBuilder &context, FunctionNameRequirements requirements, ParserClassInfo< TreeBuilder > &info)
 
template<class TreeBuilder >
TreeExpression parseAwaitExpression (TreeBuilder &context)
 
template<class TreeBuilder >
TreeExpression parseConditionalExpression (TreeBuilder &context)
 
template<class TreeBuilder >
TreeExpression parseBinaryExpression (TreeBuilder &context)
 
template<class TreeBuilder >
bool shouldCheckPropertyForUnderscoreProtoDuplicate (TreeBuilder &context, const TreeProperty &property)
 
template<class TreeBuilder >
TreeExpression parseObjectLiteral (TreeBuilder &context)
 
template<class TreeBuilder >
TreeExpression parseStrictObjectLiteral (TreeBuilder &context)
 
template<class TreeBuilder >
TreeExpression parseArrayLiteral (TreeBuilder &context)
 
template<class TreeBuilder >
TreeClassExpression parseClassExpression (TreeBuilder &context)
 
template<class TreeBuilder >
TreeExpression parseFunctionExpression (TreeBuilder &context)
 
template<class TreeBuilder >
TreeExpression parseAsyncFunctionExpression (TreeBuilder &context)
 
template<class TreeBuilder >
TreeBuilder::TemplateString parseTemplateString (TreeBuilder &context, bool isTemplateHead, typename LexerType::RawStringsBuildMode rawStringsBuildMode, bool &elementIsTail)
 
template<class TreeBuilder >
TreeBuilder::TemplateLiteral parseTemplateLiteral (TreeBuilder &context, typename LexerType::RawStringsBuildMode rawStringsBuildMode)
 
template<class TreeBuilder >
TreeExpression createResolveAndUseVariable (TreeBuilder &context, const Identifier *ident, bool isEval, const JSTextPosition &start, const JSTokenLocation &location)
 
template<class TreeBuilder >
TreeExpression parsePrimaryExpression (TreeBuilder &context)
 
template<class TreeBuilder >
TreeArguments parseArguments (TreeBuilder &context)
 
template<class TreeBuilder >
TreeExpression parseArgument (TreeBuilder &context, ArgumentType &type)
 
template<class TreeBuilder >
TreeExpression parseUnaryExpression (TreeBuilder &context)
 

Constructor & Destructor Documentation

◆ Parser() [1/2]

template<typename LexerType >
JSC::Parser< LexerType >::Parser ( VM vm,
const SourceCode source,
JSParserBuiltinMode  builtinMode,
JSParserStrictMode  strictMode,
JSParserScriptMode  scriptMode,
SourceParseMode  parseMode,
SuperBinding  superBinding,
ConstructorKind  defaultConstructorKind = ConstructorKind::None,
DerivedContextType  derivedContextType = DerivedContextType::None,
bool  isEvalContext = false,
EvalContextType  evalContextType = EvalContextType::None,
DebuggerParseData debuggerParseData = nullptr 
)

◆ ~Parser() [1/2]

template<typename LexerType >
JSC::Parser< LexerType >::~Parser ( )

◆ Parser() [2/2]

template<typename LexerType>
JSC::Parser< LexerType >::Parser ( VM ,
const SourceCode ,
JSParserBuiltinMode  ,
JSParserStrictMode  ,
JSParserScriptMode  ,
SourceParseMode  ,
SuperBinding  ,
ConstructorKind  defaultConstructorKind = ConstructorKind::None,
DerivedContextType  = DerivedContextType::None,
bool  isEvalContext = false,
EvalContextType  = EvalContextType::None,
DebuggerParseData = nullptr 
)

◆ ~Parser() [2/2]

template<typename LexerType>
JSC::Parser< LexerType >::~Parser ( )

Member Function Documentation

◆ createBindingPattern()

template<typename LexerType>
template<class TreeBuilder >
TreeDestructuringPattern JSC::Parser< LexerType >::createBindingPattern ( TreeBuilder &  context,
DestructuringKind  kind,
ExportType  exportType,
const Identifier name,
JSToken  token,
AssignmentContext  bindingContext,
const Identifier **  duplicateIdentifier 
)

◆ createGeneratorParameters()

template<typename LexerType>
template<class TreeBuilder >
TreeBuilder::FormalParameterList JSC::Parser< LexerType >::createGeneratorParameters ( TreeBuilder &  context,
unsigned &  parameterCount 
)

◆ createResolveAndUseVariable()

template<typename LexerType>
template<class TreeBuilder >
TreeExpression JSC::Parser< LexerType >::createResolveAndUseVariable ( TreeBuilder &  context,
const Identifier ident,
bool  isEval,
const JSTextPosition start,
const JSTokenLocation location 
)

◆ locationBeforeLastToken() [1/2]

template<typename LexerType>
JSTokenLocation JSC::Parser< LexerType >::locationBeforeLastToken ( ) const
inline

◆ locationBeforeLastToken() [2/2]

template<typename LexerType>
JSTokenLocation JSC::Parser< LexerType >::locationBeforeLastToken ( ) const
inline

◆ logError()

template<typename LexerType>
template<typename... Args>
void JSC::Parser< LexerType >::logError ( bool  shouldPrintToken,
Args &&...  args 
)

◆ maybeParseAsyncFunctionDeclarationStatement()

template<typename LexerType>
template<class TreeBuilder >
bool JSC::Parser< LexerType >::maybeParseAsyncFunctionDeclarationStatement ( TreeBuilder &  context,
TreeStatement result,
bool  parentAllowsFunctionDeclarationAsStatement 
)

◆ parse() [1/2]

template<typename LexerType>
template<class ParsedNode >
std::unique_ptr<ParsedNode> JSC::Parser< LexerType >::parse ( ParserError ,
const Identifier ,
SourceParseMode   
)

◆ parse() [2/2]

template<typename LexerType >
template<class ParsedNode >
std::unique_ptr< ParsedNode > JSC::Parser< LexerType >::parse ( ParserError error,
const Identifier calleeName,
SourceParseMode  parseMode 
)

◆ parseArgument()

template<typename LexerType>
template<class TreeBuilder >
TreeExpression JSC::Parser< LexerType >::parseArgument ( TreeBuilder &  context,
ArgumentType type 
)

◆ parseArguments()

template<typename LexerType>
template<class TreeBuilder >
TreeArguments JSC::Parser< LexerType >::parseArguments ( TreeBuilder &  context)

◆ parseArrayLiteral()

template<typename LexerType>
template<class TreeBuilder >
TreeExpression JSC::Parser< LexerType >::parseArrayLiteral ( TreeBuilder &  context)

◆ parseAssignmentElement()

template<typename LexerType>
template<class TreeBuilder >
TreeDestructuringPattern JSC::Parser< LexerType >::parseAssignmentElement ( TreeBuilder &  context,
DestructuringKind  kind,
ExportType  exportType,
const Identifier **  duplicateIdentifier,
bool *  hasDestructuringPattern,
AssignmentContext  bindingContext,
int  depth 
)

◆ parseAsyncFunctionExpression()

template<typename LexerType>
template<class TreeBuilder >
TreeExpression JSC::Parser< LexerType >::parseAsyncFunctionExpression ( TreeBuilder &  context)

◆ parseAwaitExpression()

template<typename LexerType>
template<class TreeBuilder >
TreeExpression JSC::Parser< LexerType >::parseAwaitExpression ( TreeBuilder &  context)

◆ parseBinaryExpression()

template<typename LexerType>
template<class TreeBuilder >
TreeExpression JSC::Parser< LexerType >::parseBinaryExpression ( TreeBuilder &  context)

◆ parseBindingOrAssignmentElement()

template<typename LexerType>
template<class TreeBuilder >
TreeDestructuringPattern JSC::Parser< LexerType >::parseBindingOrAssignmentElement ( TreeBuilder &  context,
DestructuringKind  kind,
ExportType  exportType,
const Identifier **  duplicateIdentifier,
bool *  hasDestructuringPattern,
AssignmentContext  bindingContext,
int  depth 
)

◆ parseClass()

template<typename LexerType>
template<class TreeBuilder >
TreeClassExpression JSC::Parser< LexerType >::parseClass ( TreeBuilder &  context,
FunctionNameRequirements  requirements,
ParserClassInfo< TreeBuilder > &  info 
)

◆ parseClassExpression()

template<typename LexerType>
template<class TreeBuilder >
TreeClassExpression JSC::Parser< LexerType >::parseClassExpression ( TreeBuilder &  context)

◆ parseConditionalExpression()

template<typename LexerType>
template<class TreeBuilder >
TreeExpression JSC::Parser< LexerType >::parseConditionalExpression ( TreeBuilder &  context)

◆ parseDefaultValueForDestructuringPattern()

template<typename LexerType>
template<class TreeBuilder >
TreeExpression JSC::Parser< LexerType >::parseDefaultValueForDestructuringPattern ( TreeBuilder &  context)

◆ parseDestructuringPattern()

template<typename LexerType>
template<class TreeBuilder >
TreeDestructuringPattern JSC::Parser< LexerType >::parseDestructuringPattern ( TreeBuilder &  context,
DestructuringKind  kind,
ExportType  exportType,
const Identifier **  duplicateIdentifier,
bool *  hasDestructuringPattern,
AssignmentContext  bindingContext,
int  depth 
)

◆ parseFormalParameters()

template<typename LexerType>
template<class TreeBuilder >
bool JSC::Parser< LexerType >::parseFormalParameters ( TreeBuilder &  context,
TreeFormalParameterList  list,
bool  isArrowFunction,
unsigned &  parameterCount,
unsigned &  functionLength 
)

◆ parseFunctionBody()

template<typename LexerType>
template<class TreeBuilder >
TreeFunctionBody JSC::Parser< LexerType >::parseFunctionBody ( TreeBuilder &  context,
SyntaxChecker syntaxChecker,
const JSTokenLocation startLocation,
int  startColumn,
int  functionKeywordStart,
int  functionNameStart,
int  parametersStart,
ConstructorKind  constructorKind,
SuperBinding  superBinding,
FunctionBodyType  bodyType,
unsigned  parameterCount,
unsigned  functionLength,
SourceParseMode  parseMode 
)

◆ parseFunctionExpression()

template<typename LexerType>
template<class TreeBuilder >
TreeExpression JSC::Parser< LexerType >::parseFunctionExpression ( TreeBuilder &  context)

◆ parseFunctionInfo()

template<typename LexerType>
template<class TreeBuilder >
bool JSC::Parser< LexerType >::parseFunctionInfo ( TreeBuilder &  context,
FunctionNameRequirements  requirements,
SourceParseMode  mode,
bool  nameIsInContainingScope,
ConstructorKind  constructorKind,
SuperBinding  expectedSuperBinding,
int  functionKeywordStart,
ParserFunctionInfo< TreeBuilder > &  functionInfo,
FunctionDefinitionType  functionDefinitionType 
)

◆ parseFunctionParameters()

template<typename LexerType>
template<class TreeBuilder , class FunctionInfoType >
TreeBuilder::FormalParameterList JSC::Parser< LexerType >::parseFunctionParameters ( TreeBuilder &  context,
SourceParseMode  mode,
FunctionInfoType &  functionInfo 
)

◆ parseObjectLiteral()

template<typename LexerType>
template<class TreeBuilder >
TreeExpression JSC::Parser< LexerType >::parseObjectLiteral ( TreeBuilder &  context)

◆ parsePrimaryExpression()

template<typename LexerType>
template<class TreeBuilder >
TreeExpression JSC::Parser< LexerType >::parsePrimaryExpression ( TreeBuilder &  context)

◆ parseStrictObjectLiteral()

template<typename LexerType>
template<class TreeBuilder >
TreeExpression JSC::Parser< LexerType >::parseStrictObjectLiteral ( TreeBuilder &  context)

◆ parseTemplateLiteral()

template<typename LexerType>
template<class TreeBuilder >
TreeBuilder::TemplateLiteral JSC::Parser< LexerType >::parseTemplateLiteral ( TreeBuilder &  context,
typename LexerType::RawStringsBuildMode  rawStringsBuildMode 
)

◆ parseTemplateString()

template<typename LexerType>
template<class TreeBuilder >
TreeBuilder::TemplateString JSC::Parser< LexerType >::parseTemplateString ( TreeBuilder &  context,
bool  isTemplateHead,
typename LexerType::RawStringsBuildMode  rawStringsBuildMode,
bool &  elementIsTail 
)

◆ parseUnaryExpression()

template<typename LexerType>
template<class TreeBuilder >
TreeExpression JSC::Parser< LexerType >::parseUnaryExpression ( TreeBuilder &  context)

◆ positionBeforeLastNewline() [1/2]

template<typename LexerType>
JSTextPosition JSC::Parser< LexerType >::positionBeforeLastNewline ( ) const
inline

◆ positionBeforeLastNewline() [2/2]

template<typename LexerType>
JSTextPosition JSC::Parser< LexerType >::positionBeforeLastNewline ( ) const
inline

◆ shouldCheckPropertyForUnderscoreProtoDuplicate()

template<typename LexerType>
template<class TreeBuilder >
bool JSC::Parser< LexerType >::shouldCheckPropertyForUnderscoreProtoDuplicate ( TreeBuilder &  context,
const TreeProperty property 
)

◆ tryParseDestructuringPatternExpression()

template<typename LexerType>
template<class TreeBuilder >
TreeDestructuringPattern JSC::Parser< LexerType >::tryParseDestructuringPatternExpression ( TreeBuilder &  context,
AssignmentContext  bindingContext 
)

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