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

Performs prediction analysis using the visitor pattern to visit the predicates in a rule. The process starts with Analyze(Rule).
This class primarily does prediction analysis. It generates prediction trees, placed in the Alts.PredictionTree field, which GenerateCodeVisitor then uses to generate code. It relies on the //#region "Prediction analysis" in LLParserGenerator for the lowest-level analysis tasks.
Наследование: Loyc.LLParserGenerator.RecursivePredVisitor
Показать файл Открыть проект

Private Properties

Свойство Тип Описание
AddElseCases void
AutoAddBranchForAndPred void
ComputeAssertionTree PredictionTreeOrAlt
ComputeAssertionTree2 PredictionTreeOrAlt
ComputeNestedPredictionTree PredictionTreeOrAlt
ComputeSetForNextBranch IPGTerminalSet
CountAlt void
NarrowDownToOneCase IPGTerminalSet
NarrowDownToSet KthSet
NarrowDownToSet void
RemoveFalsifiedCases void
SimplifyPredictionTree PredictionTreeOrAlt

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

Метод Описание
Analyze ( Rule rule ) : void
PredictionAnalysisVisitor ( LLParserGenerator llpg ) : System
Visit ( Alts alts ) : void
Visit ( AndPred pred ) : void
Visit ( Gate pred ) : void

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

Метод Описание
ComputePredictionTree ( KthSet kthSets ) : PredictionTree

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

Метод Описание
AddElseCases ( Alts alts, PredictionTree tree ) : void

Extends each level of the prediction tree so that it has total coverage. For example, a typicaly prediction tree might have branches for 'a'..'z' and '0..'9'; this method will add coverage for all other possible inputs. It does this either by adding an error branch, or by extending the set handled by the default branch of each level.

AutoAddBranchForAndPred ( InternalList &children, AndPred andPred, List alts, Set matched, MSet falsified ) : void
ComputeAssertionTree ( List alts ) : PredictionTreeOrAlt
ComputeAssertionTree2 ( List alts, Set matched ) : PredictionTreeOrAlt
ComputeNestedPredictionTree ( List prevSets ) : PredictionTreeOrAlt
ComputeSetForNextBranch ( KthSet kthSets, List thisBranch, IPGTerminalSet covered ) : IPGTerminalSet
CountAlt ( int alt, int>.Dictionary timesUsed ) : void
NarrowDownToOneCase ( IPGTerminalSet normalSet, List cases ) : IPGTerminalSet
NarrowDownToSet ( KthSet kthSet, IPGTerminalSet set ) : KthSet
NarrowDownToSet ( List thisBranch, IPGTerminalSet set ) : void
RemoveFalsifiedCases ( List alts, MSet falsified ) : void
SimplifyPredictionTree ( PredictionTree tree ) : PredictionTreeOrAlt

Recursively merges adjacent duplicate cases in prediction trees. The tree is modified in-place, but in case a tree collapses to a single alternative, the return value indicates which single alternative.

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

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

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

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

protected ComputePredictionTree ( KthSet kthSets ) : PredictionTree
kthSets KthSet
Результат PredictionTree

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

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

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

public Visit ( Alts alts ) : void
alts Alts
Результат void

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

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

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

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