public Program(IDisplay display, IPrinter printer, Reader reader) { Symbol r_s_symbol = new SymbolNonterminal((int)SymbolConstants.SYMBOL_R_S, "R_S"); Argument [] r_s_args = new Argument [0]; this.display = display; this.printer = printer; this.reader = reader; r_s = new Instruction(reader, r_s_symbol, r_s_args); instructions = new Instruction [224]; labels = new ArrayList [(int)LetterLabel.e - 0 + 1]; for (int i = 0; i < labels.Length; i++) { labels [i] = new ArrayList(); } returns = new int [3] { noStep, noStep, noStep }; Clear(); Card.MergeFromDataset += new Card.DatasetImporterDelegate(MergeFromDataset); Card.ReadFromDataset += new Card.DatasetImporterDelegate(ReadFromDataset); Card.WriteToDataset += new Card.DatasetExporterDelegate(WriteToDataset); }
private static GotoAction CreateGotoAction(ActionSubRecord record, SymbolCollection symbols, StateCollection states) { SymbolNonterminal symbol = symbols[record.SymbolIndex] as SymbolNonterminal; State state = states[record.Target]; return(new GotoAction(symbol, state)); }
/// <summary> /// Creates a new goto action. /// </summary> /// <param name="symbol">The symbol that a reduction must be so that /// the goto action will be done.</param> /// <param name="state">The new current state for the LALR parser.</param> public GotoAction(SymbolNonterminal symbol, State state) { this.symbol = symbol; this.state = state; }