Esempio n. 1
0
        private void Scan(TerminalState terminal, IToken token)
        {
            var currentSymbol = terminal.DottedRule.PostDot as Terminal;

            if (token.IsFrom(currentSymbol))
            {
                var dottedRule = terminal.DottedRule.Next;
                if (Chart.Contains(Location + 1, dottedRule, terminal.Origin))
                {
                    return;
                }

                var nextState = EarleyItems.NewState(dottedRule, terminal.Origin);

                if (Chart.Add(Location + 1, nextState))
                {
                    LogScan(Location + 1, nextState, token);
                }
            }
        }
Esempio n. 2
0
 public bool Add(TerminalState item)
 {
     return(this.terminalStates.Add(item));
 }