Ejemplo n.º 1
0
        public override void CheckSemantic(ICompilationLog log, CompilationScope scope)
        {
            scope.Add(this);
            scope.Add(Value);

            Type = Value.FactType;
        }
 public override void CheckSemantic(ICompilationLog log, CompilationScope scope)
 {
     Exp.CheckSemantic(log, scope);
     Type = Exp.Type;
     if (Type != typeof(bool))
     {
         log.AddError("The expression must be boolean", Line, Column);
     }
 }
        public override void CheckSemantic(ICompilationLog log, CompilationScope scope)
        {
            base.CheckSemantic(log, scope);

            if (Type != typeof(bool))
            {
                log.AddError("the type is not float", Line, Column);
            }
        }
        public override void CheckSemantic(ICompilationLog log, CompilationScope scope)
        {
            Left.CheckSemantic(log, scope);
            Right.CheckSemantic(log, scope);

            if (Left.Type != Right.Type)
            {
                log.AddError("Expression type mismatch at", Line, Column);
            }
            Type = Left.Type;
        }
Ejemplo n.º 5
0
 public override void CheckSemantic(ICompilationLog log, CompilationScope scope)
 {
     try
     {
         Fact = scope.GetFact(Name);
         Type = Fact.FactType;
     }
     catch (KeyNotFoundException e)
     {
         log.AddError("Fact not defined \"" + Name + "\"", Line, Column);
     }
 }
        public override void CheckSemantic(ICompilationLog log, CompilationScope scope)
        {
            base.CheckSemantic(log, scope);

            switch (Op)
            {
            case RelationalOperator.GreaterEqual:
            case RelationalOperator.LessEqual:
            case RelationalOperator.Greater:
            case RelationalOperator.Less:
                if (Type != typeof(float))
                {
                    log.AddError("the type is not float", Line, Column);
                }
                break;
            }
        }
Ejemplo n.º 7
0
 public override void CheckSemantic(ICompilationLog log, CompilationScope scope)
 {
     Exp.CheckSemantic(log, scope);
     this.Type = Exp.Type;
 }
Ejemplo n.º 8
0
 public override void CheckSemantic(ICompilationLog log, CompilationScope scope)
 {
     Method = scope.GetMethod(Name);
     Type   = typeof(void);
 }
Ejemplo n.º 9
0
 public override void CheckSemantic(ICompilationLog log, CompilationScope scope)
 {
 }
Ejemplo n.º 10
0
 public abstract void CheckSemantic(ICompilationLog log, CompilationScope scope);