v8  3.25.30(node0.11.13)
V8 is Google's open source JavaScript engine
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ParserBase< Traits > Class Template Reference

#include <preparser.h>

Inheritance diagram for ParserBase< Traits >:
Collaboration diagram for ParserBase< Traits >:

Data Structures

class  BASE_EMBEDDED
 
class  ObjectLiteralChecker
 

Public Types

typedef Traits::Type::Expression ExpressionT
 
typedef Traits::Type::Identifier IdentifierT
 

Public Member Functions

 ParserBase (Scanner *scanner, uintptr_t stack_limit, v8::Extension *extension, ParserRecorder *log, typename Traits::Type::Zone *zone, typename Traits::Type::Parser this_object)
 
bool allow_lazy () const
 
bool allow_natives_syntax () const
 
bool allow_generators () const
 
bool allow_for_of () const
 
bool allow_modules () const
 
bool allow_harmony_scoping () const
 
bool allow_harmony_numeric_literals () const
 
void set_allow_lazy (bool allow)
 
void set_allow_natives_syntax (bool allow)
 
void set_allow_generators (bool allow)
 
void set_allow_for_of (bool allow)
 
void set_allow_modules (bool allow)
 
void set_allow_harmony_scoping (bool allow)
 
void set_allow_harmony_numeric_literals (bool allow)
 

Protected Types

enum  AllowEvalOrArgumentsAsIdentifier { kAllowEvalOrArguments, kDontAllowEvalOrArguments }
 
enum  Mode { PARSE_LAZILY, PARSE_EAGERLY }
 
enum  PropertyKind {
  kNone = 0, kGetterProperty = 1, kSetterProperty = 2, kValueProperty = 7,
  kValueFlag = 4
}
 

Protected Member Functions

Scannerscanner () const
 
int position ()
 
int peek_position ()
 
bool stack_overflow () const
 
void set_stack_overflow ()
 
Mode mode () const
 
Traits::Type::Zone * zone () const
 
 INLINE (Token::Value peek())
 
 INLINE (Token::Value Next())
 
void Consume (Token::Value token)
 
bool Check (Token::Value token)
 
void Expect (Token::Value token, bool *ok)
 
void ExpectSemicolon (bool *ok)
 
bool peek_any_identifier ()
 
bool CheckContextualKeyword (Vector< const char > keyword)
 
void ExpectContextualKeyword (Vector< const char > keyword, bool *ok)
 
void CheckOctalLiteral (int beg_pos, int end_pos, bool *ok)
 
Traits::Type::Factory * factory ()
 
StrictMode strict_mode ()
 
bool is_generator () const
 
void ReportMessage (const char *message, Vector< const char * > args, bool is_reference_error=false)
 
void ReportMessageAt (Scanner::Location location, const char *message, bool is_reference_error=false)
 
void ReportUnexpectedToken (Token::Value token)
 
IdentifierT ParseIdentifier (AllowEvalOrArgumentsAsIdentifier, bool *ok)
 
IdentifierT ParseIdentifierOrStrictReservedWord (bool *is_strict_reserved, bool *ok)
 
IdentifierT ParseIdentifierName (bool *ok)
 
IdentifierT ParseIdentifierNameOrGetOrSet (bool *is_get, bool *is_set, bool *ok)
 
ExpressionT ParseRegExpLiteral (bool seen_equal, bool *ok)
 
ExpressionT ParsePrimaryExpression (bool *ok)
 
ExpressionT ParseExpression (bool accept_IN, bool *ok)
 
ExpressionT ParseArrayLiteral (bool *ok)
 
ExpressionT ParseObjectLiteral (bool *ok)
 
Traits::Type::ExpressionList ParseArguments (bool *ok)
 
ExpressionT ParseAssignmentExpression (bool accept_IN, bool *ok)
 
ExpressionT ParseYieldExpression (bool *ok)
 
ExpressionT ParseConditionalExpression (bool accept_IN, bool *ok)
 
ExpressionT ParseBinaryExpression (int prec, bool accept_IN, bool *ok)
 
ExpressionT ParseUnaryExpression (bool *ok)
 
ExpressionT ParsePostfixExpression (bool *ok)
 
ExpressionT ParseLeftHandSideExpression (bool *ok)
 
ExpressionT ParseMemberWithNewPrefixesExpression (bool *ok)
 
ExpressionT ParseMemberExpression (bool *ok)
 
ExpressionT ParseMemberExpressionContinuation (ExpressionT expression, bool *ok)
 

Static Protected Member Functions

static int Precedence (Token::Value token, bool accept_IN)
 

Protected Attributes

bool parenthesized_function_
 
Traits::Type::Scope * scope_
 
FunctionState * function_state_
 
v8::Extensionextension_
 
FuncNameInferrerfni_
 
ParserRecorderlog_
 
Mode mode_
 

Detailed Description

template<typename Traits>
class v8::internal::ParserBase< Traits >

Definition at line 82 of file preparser.h.

Member Typedef Documentation

typedef Traits::Type::Expression ExpressionT

Definition at line 85 of file preparser.h.

typedef Traits::Type::Identifier IdentifierT

Definition at line 86 of file preparser.h.

Member Enumeration Documentation

Enumerator
kAllowEvalOrArguments 
kDontAllowEvalOrArguments 

Definition at line 137 of file preparser.h.

enum Mode
protected
Enumerator
PARSE_LAZILY 
PARSE_EAGERLY 

Definition at line 142 of file preparser.h.

enum PropertyKind
protected
Enumerator
kNone 
kGetterProperty 
kSetterProperty 
kValueProperty 
kValueFlag 

Definition at line 439 of file preparser.h.

Constructor & Destructor Documentation

ParserBase ( Scanner scanner,
uintptr_t  stack_limit,
v8::Extension extension,
ParserRecorder log,
typename Traits::Type::Zone *  zone,
typename Traits::Type::Parser  this_object 
)
inline

Definition at line 88 of file preparser.h.

Member Function Documentation

bool allow_for_of ( ) const
inline

Definition at line 115 of file preparser.h.

bool allow_generators ( ) const
inline

Definition at line 114 of file preparser.h.

bool allow_harmony_numeric_literals ( ) const
inline

Definition at line 118 of file preparser.h.

bool allow_harmony_scoping ( ) const
inline

Definition at line 117 of file preparser.h.

bool allow_lazy ( ) const
inline

Definition at line 112 of file preparser.h.

bool allow_modules ( ) const
inline

Definition at line 116 of file preparser.h.

bool allow_natives_syntax ( ) const
inline

Definition at line 113 of file preparser.h.

bool Check ( Token::Value  token)
inlineprotected

Definition at line 288 of file preparser.h.

bool CheckContextualKeyword ( Vector< const char >  keyword)
inlineprotected

Definition at line 329 of file preparser.h.

void CheckOctalLiteral ( int  beg_pos,
int  end_pos,
bool *  ok 
)
inlineprotected

Definition at line 349 of file preparser.h.

void Consume ( Token::Value  token)
inlineprotected
void Expect ( Token::Value  token,
bool *  ok 
)
inlineprotected
void ExpectContextualKeyword ( Vector< const char >  keyword,
bool *  ok 
)
inlineprotected

Definition at line 338 of file preparser.h.

void ExpectSemicolon ( bool *  ok)
inlineprotected

Definition at line 305 of file preparser.h.

Traits::Type::Factory* factory ( )
inlineprotected

Definition at line 366 of file preparser.h.

INLINE ( Token::Value   peek())
inlineprotected

Definition at line 262 of file preparser.h.

INLINE ( Token::Value   Next())
inlineprotected

Definition at line 267 of file preparser.h.

bool is_generator ( ) const
inlineprotected
Mode mode ( ) const
inlineprotected

Definition at line 259 of file preparser.h.

Referenced by ParserBase< Traits >::BASE_EMBEDDED::ParsingModeScope().

Traits::Type::ExpressionList ParseArguments ( bool *  ok)
protected

Definition at line 1645 of file preparser.h.

References CHECK_OK_CUSTOM, COMMA, and Code::kMaxArguments.

ParserBase< Traits >::ExpressionT ParseArrayLiteral ( bool *  ok)
protected

Definition at line 1451 of file preparser.h.

References CHECK_OK, and COMMA.

ParserBase< Traits >::ExpressionT ParseAssignmentExpression ( bool  accept_IN,
bool *  ok 
)
protected
ParserBase< Traits >::ExpressionT ParseBinaryExpression ( int  prec,
bool  accept_IN,
bool *  ok 
)
protected

Definition at line 1791 of file preparser.h.

References ASSERT, CHECK_OK, v8::internal::EQ, Token::IsCompareOp(), and v8::internal::NOT.

ParserBase< Traits >::ExpressionT ParseConditionalExpression ( bool  accept_IN,
bool *  ok 
)
protected

Definition at line 1768 of file preparser.h.

References CHECK_OK.

ParserBase< Traits >::ExpressionT ParseExpression ( bool  accept_IN,
bool *  ok 
)
protected

Definition at line 1433 of file preparser.h.

References CHECK_OK, and COMMA.

ParserBase< Traits >::IdentifierT ParseIdentifier ( AllowEvalOrArgumentsAsIdentifier  allow_eval_or_arguments,
bool *  ok 
)
protected
ParserBase< Traits >::IdentifierT ParseIdentifierName ( bool *  ok)
protected

Definition at line 1276 of file preparser.h.

References Token::IsKeyword().

ParserBase< Traits >::IdentifierT ParseIdentifierNameOrGetOrSet ( bool *  is_get,
bool *  is_set,
bool *  ok 
)
protected

Definition at line 1290 of file preparser.h.

ParserBase< Traits >::IdentifierT ParseIdentifierOrStrictReservedWord ( bool *  is_strict_reserved,
bool *  ok 
)
protected

Definition at line 1257 of file preparser.h.

References v8::internal::YIELD.

ParserBase< Traits >::ExpressionT ParseLeftHandSideExpression ( bool *  ok)
protected

Definition at line 1926 of file preparser.h.

References CHECK_OK, v8::internal::mode(), v8::internal::name, and v8::internal::NULL.

ParserBase< Traits >::ExpressionT ParseMemberExpression ( bool *  ok)
protected
ParserBase< Traits >::ExpressionT ParseMemberExpressionContinuation ( ExpressionT  expression,
bool *  ok 
)
protected

Definition at line 2083 of file preparser.h.

References ASSERT, CHECK_OK, v8::internal::name, and v8::internal::NULL.

ParserBase< Traits >::ExpressionT ParseMemberWithNewPrefixesExpression ( bool *  ok)
protected

Definition at line 1997 of file preparser.h.

References CHECK_OK.

ParserBase< Traits >::ExpressionT ParseObjectLiteral ( bool *  ok)
protected
ParserBase< Traits >::ExpressionT ParsePostfixExpression ( bool *  ok)
protected

Definition at line 1893 of file preparser.h.

References CHECK_OK, Token::IsCountOp(), and v8::internal::STRICT.

ParserBase< Traits >::ExpressionT ParsePrimaryExpression ( bool *  ok)
protected
ParserBase< Traits >::ExpressionT ParseRegExpLiteral ( bool  seen_equal,
bool *  ok 
)
protected

Definition at line 1301 of file preparser.h.

References v8::internal::TENURED.

ParserBase< Traits >::ExpressionT ParseUnaryExpression ( bool *  ok)
protected

Definition at line 1835 of file preparser.h.

References CHECK_OK, Token::IsCountOp(), Token::IsUnaryOp(), and v8::internal::STRICT.

ParserBase< Traits >::ExpressionT ParseYieldExpression ( bool *  ok)
protected

Definition at line 1745 of file preparser.h.

References CHECK_OK, v8::internal::MUL, and v8::internal::YIELD.

bool peek_any_identifier ( )
inlineprotected

Definition at line 321 of file preparser.h.

int peek_position ( )
inlineprotected

Definition at line 256 of file preparser.h.

int position ( )
inlineprotected

Definition at line 255 of file preparser.h.

Referenced by ParserTraits::GetSymbol().

static int Precedence ( Token::Value  token,
bool  accept_IN 
)
inlinestaticprotected

Definition at line 360 of file preparser.h.

void ReportMessage ( const char *  message,
Vector< const char * >  args,
bool  is_reference_error = false 
)
inlineprotected
void ReportMessageAt ( Scanner::Location  location,
const char *  message,
bool  is_reference_error = false 
)
inlineprotected
void set_allow_for_of ( bool  allow)
inline

Definition at line 127 of file preparser.h.

Referenced by PreParserApi::PreParse(), and SetParserFlags().

void set_allow_generators ( bool  allow)
inline

Definition at line 126 of file preparser.h.

Referenced by PreParserApi::PreParse(), and SetParserFlags().

void set_allow_harmony_numeric_literals ( bool  allow)
inline

Definition at line 132 of file preparser.h.

Referenced by PreParserApi::PreParse(), and SetParserFlags().

void set_allow_harmony_scoping ( bool  allow)
inline

Definition at line 129 of file preparser.h.

Referenced by PreParserApi::PreParse(), SetParserFlags(), and TEST().

void set_allow_lazy ( bool  allow)
inline

Definition at line 124 of file preparser.h.

Referenced by Parser::Parse(), PreParserApi::PreParse(), SetParserFlags(), and TEST().

void set_allow_modules ( bool  allow)
inline

Definition at line 128 of file preparser.h.

Referenced by SetParserFlags().

void set_allow_natives_syntax ( bool  allow)
inline

Definition at line 125 of file preparser.h.

Referenced by SetParserFlags(), and TEST().

void set_stack_overflow ( )
inlineprotected

Definition at line 258 of file preparser.h.

bool stack_overflow ( ) const
inlineprotected

Definition at line 257 of file preparser.h.

Referenced by ParserTraits::ReportMessageAt().

StrictMode strict_mode ( )
inlineprotected

Definition at line 370 of file preparser.h.

Traits::Type::Zone* zone ( ) const
inlineprotected

Definition at line 260 of file preparser.h.

Field Documentation

v8::Extension* extension_
protected

Definition at line 490 of file preparser.h.

FunctionState* function_state_
protected
ParserRecorder* log_
protected

Definition at line 492 of file preparser.h.

Referenced by ParserTraits::GetSymbol(), and PreParserTraits::ReportMessageAt().

Mode mode_
protected

Definition at line 493 of file preparser.h.

Referenced by ParserBase< ParserTraits >::mode().

bool parenthesized_function_
protected

Definition at line 486 of file preparser.h.

Traits::Type::Scope* scope_
protected

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