public IDictionary Create(Runtime runtime) { IDictionary table = new SaneHashtable(); foreach(OpArity ot in DEFAULT_ASSIGNMENT_OPERATORS.Values) { table[runtime.GetSymbol(ot.name)] = runtime.NewNumber(ot.arity); } return table; }
public IDictionary Create(Runtime runtime) { IDictionary table = new SaneHashtable(); foreach(OpTable ot in defaultTrinaryOperators) { table[runtime.GetSymbol(ot.name)] = runtime.NewNumber(ot.precedence); } return table; }
public IDictionary Create(Runtime runtime) { IDictionary table = new SaneHashtable(); foreach(OpEntry ot in DEFAULT_INVERTED_OPERATORS.Values) { table[runtime.GetSymbol(ot.name)] = runtime.NewNumber(ot.precedence); } return table; }
public Levels(IokeObject msg, IokeObject context, IokeObject message) { this.runtime = context.runtime; this._context = context; this._message = message; IokeObject opTable = IokeObject.As(msg.FindCell(_message, _context, "OperatorTable"), null); if(opTable == runtime.nul) { opTable = runtime.NewFromOrigin(); opTable.Kind = "Message OperatorTable"; runtime.Message.SetCell("OperatorTable", opTable); opTable.SetCell("precedenceLevelCount", runtime.NewNumber(OP_LEVEL_MAX)); } this.operatorTable = GetOpTable(opTable, "operators", new BinaryOpTableCreator()); this.trinaryOperatorTable = GetOpTable(opTable, "trinaryOperators", new TrinaryOpTableCreator()); this.invertedOperatorTable = GetOpTable(opTable, "invertedOperators", new InvertedOpTableCreator()); this.stack = new SaneList<Level>(); this.Reset(); }