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 TerminalEdge(TerminalLabel terminal, SourceContext startContext, TerminalMatch match) : base(terminal, startContext, match.MatchEnd) { Match = match; }
protected CompleteEdge(TerminalLabel terminalLabel, SourceContext startContext, SourceContext endContext) : base(startContext, endContext) { Parent = terminalLabel.Terminal; CompleteLabel = terminalLabel; }