internal ActiveLabel(GrammarSequence sequence, int index = 0) { _sequence = sequence; _index = index; var sequenceTerms = sequence.Terms; CurrentTerm = sequenceTerms.Skip(index).First(); WillComplete = sequenceTerms.Count() == index + 1; var currentTerminal = CurrentTerm as Terminal; if (currentTerminal != null) { TerminalLabel = new TerminalLabel(currentTerminal, sequence); } if (WillComplete) { CompleteLabel = new CompleteLabel(_sequence); } else { NextInChain = new ActiveLabel(sequence, index + 1); } }
internal CompleteLabel(GrammarSequence sequence) { Sequence = sequence; Parent = sequence.Parent; }
public TerminalLabel(Terminal currentTerminal, GrammarSequence sequence) : base(sequence) { Terminal = currentTerminal; }