Enhanced C#
Language of your choice: library documentation
Public fields | Properties | Public Member Functions | List of all members
Loyc.LLParserGenerator.LLParserGenerator.KthSet Class Reference

Holds information about the first set or kth set of a single arm of an Alts. More...


Source file:

Remarks

Holds information about the first set or kth set of a single arm of an Alts.

The main information this class holds is (1) a list of Transitions (e.g. for the first set, LA = 0, each Transition represents moving from the beginning of the Alts to another location in the grammar based on a single input terminal), and (2) the Set of all terminals used in any of the transitions.

For example, suppose the grammar is as follows (where "strings" are actually aliases for tokens):

rule For "for" (ident "in" ident | ident '=' Range) };
rule Range literal ".." literal };

If the starting position is right after "for", then ComputeNextSet will generate two Cases, one at ident."in" ident and another at ident.'=' Range. In both cases, the Set is ident, so KthSet.Set will also be ident.

Public fields

int LA = -1
 
List< TransitionCases = new List<Transition>()
 
IPGTerminalSet Set
 
Set< AndPredAndReq
 
KthSet Prev
 
int Alt
 
bool IsNongreedyExit
 

Properties

bool HasAnyAndPreds [get]
 

Public Member Functions

 KthSet (KthSet prev)
 
 KthSet (Pred start, int alt, IPGTerminalSet emptySet, bool isNongreedyExit=false)
 
void UpdateSet (bool addEOF)
 
override string ToString ()
 
KthSet Clone (bool updateSet)