Example #1
0
 public bool Contains(APortDecl var)
 {
     if (var != null)
     {
         return(mNamedTypes.ContainsKey(var));
     }
     else
     {
         return(false);
     }
 }
Example #2
0
        public void Add(APortDecl port)
        {
            PExp exp = port.GetAdress();

            if (Contains(exp))
            {
                long        adress = GetValueOf(exp);
                Declaration tv     = new Declaration(port, port.GetType(), adress, port.GetName().Text);
                mNamedTypes.Add(port, tv);
                mLookupTable.Add(port.GetName().Text, tv);
            }
            else
            {
                throw new ScopeFailure("Unresolved port address");
            }
        }
Example #3
0
        public override void CaseAPortDecl(APortDecl node)
        {
            // Check: adress is a integer constant
            if (node.GetAdress().GetType() != typeof(AIntConstExp))
            {
                Error.Fatal(ErrorType.InvalidAdress, node.GetName());
            }

            // check: variable initializer is a InitExp
            PExp exp = node.GetInit();

            if (exp != null)
            {
                if (exp.GetType() != typeof(AInitExp))
                {
                    Error.Fatal(ErrorType.InvalidInitializer, node.GetName());
                }
            }
            base.CaseAPortDecl(node);
        }
 public override void OutAPortDecl(APortDecl node)
 {
     // check stuff....
     base.OutAPortDecl(node);
 }
 public override void CaseAPortDecl(APortDecl node)
 {
     mEnv.CurrentScope.Add(node);
     base.CaseAPortDecl(node);
 }