C# Класс Loyc.LLParserGenerator.LLParserGenerator.GenerateCodeVisitor

Directs code generation using the visitor pattern to visit the predicates in a rule. The process starts with Generate(Rule).
This class is in charge of high-level code generation. It relies on IPGCodeGenHelper for most low-level code generation tasks.
Наследование: Loyc.LLParserGenerator.PredVisitor
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
F Loyc.Syntax.LNodeFactory
LLPG LLParserGenerator

Private Properties

Свойство Тип Описание
AddUserAction void
DeduplicateLabels void
GenerateCodeForAlts void
GenerateExtraMatchingCode WList
GenerateIfElseChain LNode
GenerateTest LNode
GenerateTest LNode
GetAndPredCode LNode
GetContinueStmt LNode
GetExitStmt LNode
Join LNode
NextStopLabel string
SimpleEnoughToRepeat bool

Открытые методы

Метод Описание
Generate ( Rule rule ) : void
GenerateCodeVisitor ( LLParserGenerator llpg ) : System
Visit ( Alts alts ) : void

Visit(Alts) is the most important method in this class. It generates all prediction code, which is the majority of the code in a parser.

Visit ( AndPred andp ) : void
Visit ( Gate pred ) : void
Visit ( Pred pred ) : void
Visit ( RuleRef rref ) : void
Visit ( Seq pred ) : void
Visit ( TerminalPred term ) : void
VisitWithNewTarget ( Pred toBeVisited, WList target ) : void

Защищенные методы

Метод Описание
GeneratePredictionTreeCode ( PredictionTree tree, string>.Pair matchingCode, Symbol &haveLoop ) : LNode
GetPredictionSubtreeCode ( PredictionBranch branch, string>.Pair matchingCode, Symbol &haveLoop ) : LNode

Приватные методы

Метод Описание
AddUserAction ( LNode action ) : void
DeduplicateLabels ( string>.Pair matchingCode ) : void
GenerateCodeForAlts ( Alts alts, int>.Dictionary timesUsed, PredictionTree tree ) : void
GenerateExtraMatchingCode ( string>.Pair matchingCode, int separateCount, Symbol &loopType ) : WList
GenerateIfElseChain ( PredictionTree tree, LNode branchCode, LNode &laVar, MSet switchCases ) : LNode
GenerateTest ( List andPreds, int lookaheadAmt, LNode laVar ) : LNode
GenerateTest ( Set andPreds, int lookaheadAmt, LNode laVar ) : LNode
GetAndPredCode ( AndPred pred, int lookaheadAmt, LNode laVar ) : LNode
GetContinueStmt ( Symbol loopType ) : LNode
GetExitStmt ( Symbol haveLoop ) : LNode
Join ( IEnumerable nodes, Symbol op, LNode @default ) : LNode
NextStopLabel ( ) : string
SimpleEnoughToRepeat ( LNode code ) : bool

Описание методов

Generate() публичный Метод

public Generate ( Rule rule ) : void
rule Rule
Результат void

GenerateCodeVisitor() публичный Метод

public GenerateCodeVisitor ( LLParserGenerator llpg ) : System
llpg LLParserGenerator
Результат System

GeneratePredictionTreeCode() защищенный Метод

protected GeneratePredictionTreeCode ( PredictionTree tree, string>.Pair matchingCode, Symbol &haveLoop ) : LNode
tree PredictionTree
matchingCode string>.Pair
haveLoop Symbol
Результат LNode

GetPredictionSubtreeCode() защищенный Метод

protected GetPredictionSubtreeCode ( PredictionBranch branch, string>.Pair matchingCode, Symbol &haveLoop ) : LNode
branch PredictionBranch
matchingCode string>.Pair
haveLoop Symbol
Результат LNode

Visit() публичный Метод

Visit(Alts) is the most important method in this class. It generates all prediction code, which is the majority of the code in a parser.
public Visit ( Alts alts ) : void
alts Alts
Результат void

Visit() публичный Метод

public Visit ( AndPred andp ) : void
andp AndPred
Результат void

Visit() публичный Метод

public Visit ( Gate pred ) : void
pred Gate
Результат void

Visit() публичный Метод

public Visit ( Pred pred ) : void
pred Pred
Результат void

Visit() публичный Метод

public Visit ( RuleRef rref ) : void
rref RuleRef
Результат void

Visit() публичный Метод

public Visit ( Seq pred ) : void
pred Seq
Результат void

Visit() публичный Метод

public Visit ( TerminalPred term ) : void
term TerminalPred
Результат void

VisitWithNewTarget() публичный Метод

public VisitWithNewTarget ( Pred toBeVisited, WList target ) : void
toBeVisited Pred
target WList
Результат void

Описание свойств

F публичное свойство

public LNodeFactory,Loyc.Syntax F
Результат Loyc.Syntax.LNodeFactory

LLPG публичное свойство

public LLParserGenerator LLPG
Результат LLParserGenerator