Пример #1
0
 public string VisitDict(DictType d)
 {
     //        StringBuilder sb = new StringBuilder();
     //
     //        Integer num = ctr.visit(this);
     //        if (num != null) {
     //            sb.Append("#").append(num);
     //        } else {
     //            ctr.push(this);
     //            sb.Append("{");
     //            sb.Append(keyType.printType(ctr));
     //            sb.Append(" : ");
     //            sb.Append(valueType.printType(ctr));
     //            sb.Append("}");
     //            ctr.pop(this);
     //        }
     //
     //        return sb.toString();
     return("dict");
 }
Пример #2
0
 public override bool Equals(object other)
 {
     if (!(other is DataType dtOther))
     {
         return(false);
     }
     if (typeStack.Contains(this, dtOther))
     {
         return(true);
     }
     else if (other is DictType)
     {
         typeStack.Push(this, dtOther);
         DictType co  = (DictType)other;
         bool     ret = (co.KeyType.Equals(KeyType) &&
                         co.ValueType.Equals(ValueType));
         typeStack.Pop(this, other);
         return(ret);
     }
     else
     {
         return(false);
     }
 }
Пример #3
0
 private DictType Register(DictType dictType)
 {
     dictType.Table.AddSuper(analyzer.Builtins.BaseDict.Table);
     dictType.Table.Path = analyzer.Builtins.BaseDict.Table.Path;
     return(dictType);
 }