public BefungePointer(BefungeTable table) { _table = table; if (_table.IsEmpty) { throw new ArgumentException("table must be initialized", nameof(table)); } }
public string Interpret(string code) { BefungeTable table = new BefungeTable(code); _table = table; _pointer = new BefungePointer(table); BefungeToken token = null; do { token = _pointer.GetToken(); InterpretToken(token); _pointer.Move(_direction); } while (token.TokenType != BefungeTokenType.EOF); return(output); }
public BefungePointer(string code) { _table = new BefungeTable(code); }