Esempio n. 1
0
 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;
 }
Esempio n. 2
0
File: Levels.cs Progetto: fronx/ioke
 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;
 }
Esempio n. 3
0
 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;
 }
Esempio n. 4
0
File: Levels.cs Progetto: fronx/ioke
        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();
        }