Exemple #1
0
 public void Verify()
 {
     Condition.Verify();
     VarTab.PushScope();
     Statements.ForEach(stmt => stmt.Verify());
     VarTab.PopScope();
 }
Exemple #2
0
        public void Verify()
        {
            var exprType  = Expr.Verify();
            var assgnType = VarTab.Get(Id);

            if (exprType != assgnType)
            {
                throw new ArgumentException(assgnType.ToString());
            }
        }
Exemple #3
0
 public void Verify()
 {
     Condition.Verify();
     VarTab.PushScope();
     IfBlock.ForEach(stmt => stmt.Verify());
     VarTab.PopScope();
     VarTab.PushScope();
     ElseBlock.ForEach(stmt => stmt.Verify());
     VarTab.PopScope();
 }
Exemple #4
0
        public void Verify()
        {
            var exprType = Expr.Verify();

            if (Type != exprType)
            {
                throw new ArgumentException(Type.ToString());
            }

            VarTab.Add(Id, exprType);
        }
Exemple #5
0
        public void Verify()
        {
            FuncState.PushFunc(ReturnType);
            VarTab.PushScope();
            Params.ForEach(par => VarTab.Add(par.Id, par.Type));
            Stmts.ForEach(stmt => stmt.Verify());
            VarTab.PopScope();
            FuncState.PopFunc();

            VarTab.Add(Id, new TypeSpec
            {
                Base = new Function
                {
                    Types      = Params,
                    ReturnType = ReturnType
                }
            });
        }
Exemple #6
0
 public void Verify()
 {
     VarTab.Clear();
     Statements.ForEach(stmt => stmt.Verify());
 }