Beispiel #1
0
        public override void DoUnify(DataType var, Substitution substitution)
        {
            if (Name != var.Name || Arguments.Count != var.Arguments.Count)
            {
                throw TypeException.Create(this.Perform(substitution), var.Perform(substitution));
            }

            for (var i = 0; i < Arguments.Count; ++i)
            {
                Arguments[i].Perform(substitution).Unify(var.Arguments[i].Perform(substitution), substitution);
            }
        }
Beispiel #2
0
        public void TestTypeException()
        {
            TypeException exception = null;

            try
            {
                Helper.ParseLine("Q 1 2 3 4");
            }catch (TypeException ex)
            {
                exception = ex;
            }
            Assert.AreEqual(typeof(TypeException), exception.GetType());
        }
Beispiel #3
0
 public MyProgramException(string message, TypeException type)
     : base(message)
 {
     this.Type = type;
 }
Beispiel #4
0
 public virtual void DoUnify(Type that, Substitution substitution)
 {
     throw TypeException.Create(Perform(substitution), that.Perform(substitution));
 }