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
파일 보기 프로젝트 열기: qwertie/ecsharp

공개 프로퍼티들

프로퍼티 타입 설명
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