Esempio n. 1
0
 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);
        }
Esempio n. 3
0
 public BefungePointer(string code)
 {
     _table = new BefungeTable(code);
 }