Esempio n. 1
0
        public override void CaseATempCastExp(ATempCastExp node)
        {
            //The cast type must be a single identifier
            if (node.GetType() is ALvalueExp)
            {
                ALvalueExp lvalueExp = (ALvalueExp)node.GetType();
                if (lvalueExp.GetLvalue() is AAmbiguousNameLvalue)
                {
                    AAmbiguousNameLvalue ambiguousLvalue = (AAmbiguousNameLvalue)lvalueExp.GetLvalue();
                    if (ambiguousLvalue.GetAmbiguous() is AAName)
                    {
                        AAName simpleName = (AAName)ambiguousLvalue.GetAmbiguous();
                        if (simpleName.GetIdentifier().Count == 1)
                        {
                            ACastExp castExp = new ACastExp(node.GetToken(), new ANamedType(simpleName), node.GetExp());
                            node.ReplaceBy(castExp);
                            castExp.Apply(this);
                            return;
                        }
                    }
                }
            }
            PExp exp = node.GetExp();

            node.ReplaceBy(exp);
            exp.Apply(this);
        }
Esempio n. 2
0
        public InvokeStm(ASyncInvokeExp node)
        {
            Node = node;
            if (node.GetName() is AAmbiguousNameLvalue)
            {
                AAmbiguousNameLvalue ambigious = (AAmbiguousNameLvalue)node.GetName();
                AAName name = (AAName)ambigious.GetAmbiguous();

                /*List<List<Node>>[] targets;
                 * List<ANamespaceDecl> namespaces = new List<ANamespaceDecl>();
                 * /*bool b;
                 * TypeLinking.GetTargets(name, out targets, namespaces, data, null, out b);
                 * for (int i = 0; i < 3; i++)
                 * {
                 *
                 * }*/
                Name = (TIdentifier)name.GetIdentifier()[name.GetIdentifier().Count - 1];
                name.GetIdentifier().RemoveAt(name.GetIdentifier().Count - 1);
                if (name.GetIdentifier().Count == 0)
                {
                    Base = null;
                }
                else
                {
                    Base = name;
                }
            }
            else
            {
                AStructLvalue lvalue = (AStructLvalue)node.GetName();
                Name = lvalue.GetName();
                Base = lvalue.GetReceiver();
            }
        }
Esempio n. 3
0
 public InvokeStm(AAsyncInvokeStm node)
 {
     Node = node;
     if (node.GetName() is AAmbiguousNameLvalue)
     {
         AAmbiguousNameLvalue ambigious = (AAmbiguousNameLvalue)node.GetName();
         AAName name = (AAName)ambigious.GetAmbiguous();
         Name = (TIdentifier)name.GetIdentifier()[name.GetIdentifier().Count - 1];
         name.GetIdentifier().RemoveAt(name.GetIdentifier().Count - 1);
         if (name.GetIdentifier().Count == 0)
         {
             Base = null;
         }
         else
         {
             Base = name;
         }
     }
     else
     {
         AStructLvalue lvalue = (AStructLvalue)node.GetName();
         Name = lvalue.GetName();
         Base = lvalue.GetReceiver();
     }
 }