Beispiel #1
0
        public static SymbolString Concat(SymbolString symbolString, TerminalSymbol symbol)
        {
            List <Symbol> symbols = new List <Symbol>(symbolString);

            if (symbol != null)
            {
                symbols.Add(symbol);
            }
            return(new SymbolString(symbols));
        }
Beispiel #2
0
        public LalrItem(GrammarProduction production, int parsingPoint, TerminalSymbol lookahead)
        {
            if (this.ParsingPoint > production.Body.Count || ParsingPoint < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(parsingPoint));
            }

            this.Production   = production;
            this.ParsingPoint = parsingPoint;
            this.Lookahead    = lookahead;
        }