v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
v8::internal::torque::Grammar Class Reference

#include <earley-parser.h>

Inheritance diagram for v8::internal::torque::Grammar:
Collaboration diagram for v8::internal::torque::Grammar:

Public Types

using PatternFunction = Lexer::PatternFunction
 

Public Member Functions

 Grammar (Symbol *start)
 
std::optional< ParseResultParse (const std::string &input)
 

Protected Member Functions

SymbolToken (const std::string &s)
 
SymbolPattern (PatternFunction pattern)
 
void SetWhitespace (PatternFunction ws)
 
SymbolNewSymbol (std::initializer_list< Rule > rules={})
 
SymbolSequence (std::vector< Symbol * > symbols)
 
template<class T , class Result = T>
SymbolTryOrDefault (Symbol *s)
 
template<class T >
SymbolNonemptyList (Symbol *element, std::optional< Symbol * > separator={})
 
template<class T >
SymbolList (Symbol *element, std::optional< Symbol * > separator={})
 
template<class T >
SymbolOptional (Symbol *x)
 
SymbolCheckIf (Symbol *x)
 
Lexerlexer ()
 

Static Protected Member Functions

static V8_EXPORT_PRIVATE bool MatchChar (int(*char_class)(int), InputPosition *pos)
 
static V8_EXPORT_PRIVATE bool MatchChar (bool(*char_class)(char), InputPosition *pos)
 
static V8_EXPORT_PRIVATE bool MatchAnyChar (InputPosition *pos)
 
static V8_EXPORT_PRIVATE bool MatchString (const char *s, InputPosition *pos)
 
static std::optional< ParseResultYieldMatchedInput (ParseResultIterator *child_results)
 
template<class T , T value>
static std::optional< ParseResultYieldIntegralConstant (ParseResultIterator *child_results)
 
template<class T >
static std::optional< ParseResultYieldDefaultValue (ParseResultIterator *child_results)
 
template<class From , class To >
static std::optional< ParseResultCastParseResult (ParseResultIterator *child_results)
 
template<class T >
static std::optional< ParseResultMakeSingletonVector (ParseResultIterator *child_results)
 
template<class T >
static std::optional< ParseResultMakeExtendedVector (ParseResultIterator *child_results)
 

Private Attributes

Lexer lexer_
 
std::vector< std::unique_ptr< Symbol > > generated_symbols_
 
Symbolstart_
 

Detailed Description

Definition at line 416 of file earley-parser.h.

Member Typedef Documentation

◆ PatternFunction

Constructor & Destructor Documentation

◆ Grammar()

v8::internal::torque::Grammar::Grammar ( Symbol * start)
inlineexplicit

Definition at line 420 of file earley-parser.h.

Member Function Documentation

◆ CastParseResult()

template<class From , class To >
static std::optional< ParseResult > v8::internal::torque::Grammar::CastParseResult ( ParseResultIterator * child_results)
inlinestaticprotected

Definition at line 476 of file earley-parser.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CheckIf()

Symbol * v8::internal::torque::Grammar::CheckIf ( Symbol * x)
inlineprotected

Definition at line 530 of file earley-parser.h.

Here is the call graph for this function:

◆ lexer()

Lexer & v8::internal::torque::Grammar::lexer ( )
inlineprotected

Definition at line 535 of file earley-parser.h.

Here is the caller graph for this function:

◆ List()

template<class T >
Symbol * v8::internal::torque::Grammar::List ( Symbol * element,
std::optional< Symbol * > separator = {} )
inlineprotected

Definition at line 521 of file earley-parser.h.

◆ MakeExtendedVector()

template<class T >
static std::optional< ParseResult > v8::internal::torque::Grammar::MakeExtendedVector ( ParseResultIterator * child_results)
inlinestaticprotected

Definition at line 500 of file earley-parser.h.

Here is the call graph for this function:

◆ MakeSingletonVector()

template<class T >
static std::optional< ParseResult > v8::internal::torque::Grammar::MakeSingletonVector ( ParseResultIterator * child_results)
inlinestaticprotected

Definition at line 491 of file earley-parser.h.

Here is the call graph for this function:

◆ MatchAnyChar()

bool v8::internal::torque::Grammar::MatchAnyChar ( InputPosition * pos)
staticprotected

Definition at line 315 of file earley-parser.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MatchChar() [1/2]

bool v8::internal::torque::Grammar::MatchChar ( bool(* char_class )(char),
InputPosition * pos )
staticprotected

Definition at line 296 of file earley-parser.cc.

◆ MatchChar() [2/2]

DISABLE_CFI_ICALL bool v8::internal::torque::Grammar::MatchChar ( int(* char_class )(int),
InputPosition * pos )
staticprotected

Definition at line 287 of file earley-parser.cc.

Here is the caller graph for this function:

◆ MatchString()

bool v8::internal::torque::Grammar::MatchString ( const char * s,
InputPosition * pos )
staticprotected

Definition at line 305 of file earley-parser.cc.

Here is the caller graph for this function:

◆ NewSymbol()

Symbol * v8::internal::torque::Grammar::NewSymbol ( std::initializer_list< Rule > rules = {})
inlineprotected

Definition at line 434 of file earley-parser.h.

Here is the caller graph for this function:

◆ NonemptyList()

template<class T >
Symbol * v8::internal::torque::Grammar::NonemptyList ( Symbol * element,
std::optional< Symbol * > separator = {} )
inlineprotected

Definition at line 511 of file earley-parser.h.

◆ Optional()

template<class T >
Symbol * v8::internal::torque::Grammar::Optional ( Symbol * x)
inlineprotected

Definition at line 526 of file earley-parser.h.

Here is the call graph for this function:

◆ Parse()

std::optional< ParseResult > v8::internal::torque::Grammar::Parse ( const std::string & input)
inline

Definition at line 422 of file earley-parser.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Pattern()

Symbol * v8::internal::torque::Grammar::Pattern ( PatternFunction pattern)
inlineprotected

Definition at line 429 of file earley-parser.h.

Here is the call graph for this function:

◆ Sequence()

Symbol * v8::internal::torque::Grammar::Sequence ( std::vector< Symbol * > symbols)
inlineprotected

Definition at line 459 of file earley-parser.h.

Here is the call graph for this function:

◆ SetWhitespace()

void v8::internal::torque::Grammar::SetWhitespace ( PatternFunction ws)
inlineprotected

Definition at line 430 of file earley-parser.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Token()

Symbol * v8::internal::torque::Grammar::Token ( const std::string & s)
inlineprotected

Definition at line 428 of file earley-parser.h.

Here is the call graph for this function:

◆ TryOrDefault()

template<class T , class Result = T>
Symbol * v8::internal::torque::Grammar::TryOrDefault ( Symbol * s)
inlineprotected

Definition at line 485 of file earley-parser.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ YieldDefaultValue()

template<class T >
static std::optional< ParseResult > v8::internal::torque::Grammar::YieldDefaultValue ( ParseResultIterator * child_results)
inlinestaticprotected

Definition at line 470 of file earley-parser.h.

Here is the caller graph for this function:

◆ YieldIntegralConstant()

template<class T , T value>
static std::optional< ParseResult > v8::internal::torque::Grammar::YieldIntegralConstant ( ParseResultIterator * child_results)
inlinestaticprotected

Definition at line 464 of file earley-parser.h.

Here is the caller graph for this function:

◆ YieldMatchedInput()

static std::optional< ParseResult > v8::internal::torque::Grammar::YieldMatchedInput ( ParseResultIterator * child_results)
inlinestaticprotected

Definition at line 452 of file earley-parser.h.

Here is the call graph for this function:

Member Data Documentation

◆ generated_symbols_

std::vector<std::unique_ptr<Symbol> > v8::internal::torque::Grammar::generated_symbols_
private

Definition at line 539 of file earley-parser.h.

◆ lexer_

Lexer v8::internal::torque::Grammar::lexer_
private

Definition at line 538 of file earley-parser.h.

◆ start_

Symbol* v8::internal::torque::Grammar::start_
private

Definition at line 540 of file earley-parser.h.


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