Enhanced C#
Language of your choice: library documentation

Documentation moved to ecsharp.net

GitHub doesn't support HTTP redirects, so you'll be redirected in 3 seconds.

 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
Public Member Functions | List of all members
Loyc.LLParserGenerator.LLParserGenerator.GetCanonical Class Reference

Computes the "canonical" interpretation of a position for prediction purposes, so that ConsolidateDuplicatePositions can detect duplicates reliably. Call Do() to use. More...


Source file:
Inheritance diagram for Loyc.LLParserGenerator.LLParserGenerator.GetCanonical:
Loyc.LLParserGenerator.PredVisitor

Remarks

Computes the "canonical" interpretation of a position for prediction purposes, so that ConsolidateDuplicatePositions can detect duplicates reliably. Call Do() to use.

Public Member Functions

GrammarPos Do (GrammarPos input)
 Computes the "canonical" interpretation of a position. More...
 
override void Visit (Seq seq)
 
override void Visit (Gate gate)
 
override void Visit (EndOfRule end)
 
override void VisitOther (Pred pred)
 
- Public Member Functions inherited from Loyc.LLParserGenerator.PredVisitor
void Visit (Pred pred)
 
virtual void Visit (TerminalPred term)
 
virtual void Visit (RuleRef rref)
 
virtual void Visit (Alts alts)
 
virtual void Visit (AndPred and)
 
void VisitChildrenOf (Seq pred)
 
void VisitChildrenOf (AndPred pred)
 
void VisitChildrenOf (Gate pred)
 
void VisitChildrenOf (Alts pred, bool includeError)
 

Member Function Documentation

GrammarPos Loyc.LLParserGenerator.LLParserGenerator.GetCanonical.Do ( GrammarPos  input)
inline

Computes the "canonical" interpretation of a position.

For example, given

rule X @[ 'a' Y 'z' ];
rule Y @[ 'a'..'y' 'b'..'z' ];

The position before the sequence 'a' Y 'z' is equivalent to the position before 'a', so the result points to 'a' rather than to the sequence itself.

The position after 'b'..'z' is equivalent to the position before 'z', if Y was called from X. Therefore, given the position after 'b'..'z' (a pointer to EndOfRule), and return address before 'z', this method returns the position before 'z'.