public static PLvalue Link(AAName name, Node refNode, List<Node> list, SharedData data)
        {
            List<TIdentifier> identifierList = new List<TIdentifier>();
            {
                int count = name.GetIdentifier().Count;
                if (count < list.Count)
                {
                    for (int i = 0; i < list.Count - count; i++)
                    {
                        if (list[i] is AStructDecl)
                            identifierList.Add(((AStructDecl)list[i]).GetName());
                    }

                    for (int i = 0; i < count; i++)
                    {
                        TIdentifier iden = (TIdentifier)name.GetIdentifier()[i];
                        identifierList.Add(iden);
                    }
                }
                else
                    for (int i = count - list.Count; i < count; i++)
                    {
                        TIdentifier iden = (TIdentifier)name.GetIdentifier()[i];
                        identifierList.Add(iden);
                    }
            }
            PLvalue baseLvalue = null;
            Node node = list[0];
            list.RemoveAt(0);
            TIdentifier identifier = identifierList[0];
            identifierList.RemoveAt(0);
            if (node is AALocalDecl)
            {
                AALocalDecl aNode = (AALocalDecl)node;
                if (node.Parent() is AStructDecl)
                {//Struct local
                    //Make it this->var or this.var
                    AStructDecl pStruct = Util.GetAncestor<AStructDecl>(node);
                    if (pStruct.GetClassToken() != null || Util.HasAncestor<AConstructorDecl>(refNode) || Util.HasAncestor<ADeconstructorDecl>(refNode))
                    {//(*this).
                        baseLvalue = new AThisLvalue(new TThis("this"));
                        baseLvalue = new APointerLvalue(new TStar("*"), new ALvalueExp(baseLvalue));
                        baseLvalue = new AStructLvalue(new ALvalueExp(baseLvalue), new ADotDotType(new TDot(".")),
                                                       identifier);
                        data.StructFieldLinks[(AStructLvalue)baseLvalue] = aNode;
                    }
                    else
                    {//struct.
                        baseLvalue = new AStructFieldLvalue(identifier);
                        data.StructMethodFieldLinks[(AStructFieldLvalue)baseLvalue] = aNode;
                    }
                }
                else
                {//Method/constructor/deconstructor local
                    ALocalLvalue replaceNode = new ALocalLvalue(identifier);
                    data.LocalLinks[replaceNode] = aNode;
                    baseLvalue = replaceNode;
                }
            }
            else if (node is APropertyDecl)
            {
                APropertyDecl aNode = (APropertyDecl)node;
                if (Util.HasAncestor<AStructDecl>(node))
                {//Property in current struct
                    AStructDecl pStruct = Util.GetAncestor<AStructDecl>(node);
                    if (pStruct.GetClassToken() != null || Util.HasAncestor<AConstructorDecl>(refNode) || Util.HasAncestor<ADeconstructorDecl>(refNode))
                    {//(*this).
                        baseLvalue = new AThisLvalue(new TThis("this"));
                        baseLvalue = new APointerLvalue(new TStar("*"), new ALvalueExp(baseLvalue));
                        baseLvalue = new AStructLvalue(new ALvalueExp(baseLvalue), new ADotDotType(new TDot(".")),
                                                       identifier);
                        data.StructPropertyLinks[(AStructLvalue)baseLvalue] = aNode;
                    }
                    else
                    {//struct.
                        baseLvalue = new AStructFieldLvalue(identifier);
                        data.StructMethodPropertyLinks[(AStructFieldLvalue)baseLvalue] = aNode;
                    }
                }
                else
                {//Global property
                    baseLvalue = new APropertyLvalue(identifier);
                    data.PropertyLinks[(APropertyLvalue)baseLvalue] = aNode;
                }
            }
            else if (node is AFieldDecl)
            {
                baseLvalue = new AFieldLvalue(identifier);
                data.FieldLinks[(AFieldLvalue)baseLvalue] = (AFieldDecl)node;
            }
            else if (node is AStructDecl)
            {
                AStructDecl targetStruct = (AStructDecl)node;
                node = list[0];
                list.RemoveAt(0);
                identifier = identifierList[0];
                identifierList.RemoveAt(0);

                AStructFieldLvalue lvalue = new AStructFieldLvalue(identifier);
                if (node is AALocalDecl)
                    data.StructMethodFieldLinks[lvalue] = (AALocalDecl)node;
                else
                    data.StructMethodPropertyLinks[lvalue] = (APropertyDecl)node;

                baseLvalue = lvalue;
            }
            while (list.Count > 0)
            {
                node = list[0];
                list.RemoveAt(0);
                identifier = identifierList[0];
                identifierList.RemoveAt(0);

                baseLvalue = new AStructLvalue(new ALvalueExp(baseLvalue), new ADotDotType(new TDot(".")),
                                                identifier);
                if (node is AALocalDecl)
                {//Struct local
                    data.StructFieldLinks[(AStructLvalue) baseLvalue] = (AALocalDecl) node;
                }
                else if (node is APropertyDecl)
                {//Struct property
                    data.StructPropertyLinks[(AStructLvalue) baseLvalue] = (APropertyDecl) node;
                }
                //Don't link array length stuff
            }
            return baseLvalue;
        }
 public override void CaseAAName(AAName node)
 {
     InAAName(node);
     {
         Object[] temp = new Object[node.GetIdentifier().Count];
         node.GetIdentifier().CopyTo(temp, 0);
         for (int i = temp.Length - 1; i >= 0; i--)
         {
             ((TIdentifier)temp[i]).Apply(this);
         }
     }
     OutAAName(node);
 }
 /*
  * Local variable (including formals)
  * Special case: Formals from base constructor calls
  *
  * Struct fields/properties in current struct
  *      Not enherited private fields
  *      Note: If it was a class field, it must be replaced by this->... when used
  *
  * Struct fields/properties in target struct
  *
  * Global field/property
  *
  * NamedType (primitive and structs/classes)
  *
  * enriched primitive
  *
  * Namespace
  */
 public static void GetTargets(AAName name,
     out List<List<Node>>[] targets,
     List<ANamespaceDecl> namespaces,
     SharedData data,
     ErrorCollection errors,
     out bool reportedError, 
     bool allowStructs = true)
 {
     List<string> names = new List<string>();
     foreach (TIdentifier identifier in name.GetIdentifier())
     {
         names.Add(identifier.Text);
     }
     GetTargets(name, names, out targets, namespaces, data, errors, out reportedError, !allowStructs);
 }
        private static void GetTargets(AAName node,
            List<string> names,
            out List<List<Node>>[] targets,
            List<ANamespaceDecl> namespaces,
            SharedData data, 
            ErrorCollection errors,
            out bool reportedError, 
            bool first = false)
        {
            targets = new []
                          {
                              new List<List<Node>>(),//0: Stuff starting with a local variable
                              new List<List<Node>>(),//1: Stuff starting with a struct field/property
                              new List<List<Node>>() //2: Stuff starting with a global declaration
                          };
            reportedError = false;
            string name = names[names.Count - 1];
            if (names.Count == 1)
            {
                //Locals
                AConstructorDecl pConstructor = Util.GetAncestor<AConstructorDecl>(node);
                AMethodDecl pMethod = Util.GetAncestor<AMethodDecl>(node);
                AABlock pBlock = Util.GetAncestor<AABlock>(node);
                if (pBlock != null)
                {
                    if (data.Locals.ContainsKey(pBlock))
                    {
                        foreach (AALocalDecl local in data.Locals[pBlock])
                        {
                            if (local.GetName().Text == name && Util.IsBefore(local, node))
                                targets[0].Add(new List<Node>(){local});
                        }
                    }
                }
                else if (pConstructor != null)
                {
                    foreach (AALocalDecl formal in pConstructor.GetFormals())
                    {
                        if (formal.GetName().Text == name)
                            targets[0].Add(new List<Node>(){formal});
                    }
                }
                //Fields/properties in current struct
                AStructDecl currentStruct = Util.GetAncestor<AStructDecl>(node);
                if (currentStruct != null)
                {
                    bool isStaticContext = false;
                    if (Util.HasAncestor<AMethodDecl>(node))
                        isStaticContext = Util.GetAncestor<AMethodDecl>(node).GetStatic() != null;
                    else if (Util.HasAncestor<APropertyDecl>(node))
                        isStaticContext = Util.GetAncestor<APropertyDecl>(node).GetStatic() != null;
                    else if (Util.HasAncestor<AALocalDecl>(node))
                        isStaticContext = Util.GetAncestor<AALocalDecl>(node).GetStatic() != null;
                    foreach (AALocalDecl local in data.StructFields[currentStruct])
                    {
                        if (local.GetName().Text != name)
                            continue;
                        //If it's an enherited private variable, you can't refer to it.
                        if (local.GetVisibilityModifier() is APrivateVisibilityModifier &&
                            data.EnheritanceLocalMap.ContainsKey(local))
                        {
                            continue;
                        }
                        if (local.GetStatic() != null)
                        {
                            //Add it to the dotted map
                            targets[1].Add(new List<Node>(){currentStruct, local});
                            continue;
                        }
                        if (isStaticContext)
                            continue;//Can't refference non static stuff from static context
                        targets[1].Add(new List<Node>(){local});
                    }
                    foreach (APropertyDecl local in data.StructProperties[currentStruct])
                    {
                        if (local.GetName().Text != name)
                            continue;

                        //If it's an enherited private variable, you can't refer to it.
                        if (local.GetVisibilityModifier() is APrivateVisibilityModifier &&
                            Util.GetAncestor<AStructDecl>(local) != currentStruct)
                        {
                            continue;
                        }

                        if (local.GetStatic() != null)
                        {
                            //Add it to the dotted map
                            targets[1].Add(new List<Node>() { currentStruct, local });
                            continue;
                        }
                        if (isStaticContext)
                            continue;//Can't refference non static stuff from static context
                        targets[1].Add(new List<Node>(){local});
                    }
                }
                //Global field/property
                List<IList> visibleDecls = Util.GetVisibleDecls(node, true);
                AASourceFile currentFile = Util.GetAncestor<AASourceFile>(node);
                List<string> currentNamespace = Util.GetFullNamespace(node);
                foreach (IList declList in visibleDecls)
                {
                    bool isSameFile = false;
                    if (declList.Count > 0)
                        isSameFile = currentFile == Util.GetAncestor<AASourceFile>((PDecl) declList[0]);
                    foreach (PDecl decl in declList)
                    {
                        if (decl is AFieldDecl)
                        {
                            AFieldDecl aDecl = (AFieldDecl)decl;

                            if (aDecl.GetName().Text != name)
                                continue;

                            bool isSameNamespace = Util.NamespacesEquals(currentNamespace, Util.GetFullNamespace(decl));

                            if (!isSameNamespace && aDecl.GetVisibilityModifier() is APrivateVisibilityModifier ||
                                !isSameFile && aDecl.GetStatic() != null)
                                continue;

                            targets[2].Add(new List<Node>(){decl});
                        }
                        else if (decl is APropertyDecl)
                        {
                            APropertyDecl aDecl = (APropertyDecl)decl;

                            if (aDecl.GetName().Text != name)
                                continue;

                            bool isSameNamespace = Util.NamespacesEquals(currentNamespace, Util.GetFullNamespace(decl));

                            if (!isSameNamespace && aDecl.GetVisibilityModifier() is APrivateVisibilityModifier ||
                                !isSameFile && aDecl.GetStatic() != null)
                                continue;

                            targets[2].Add(new List<Node>() { decl });
                        }
                        else if (decl is AStructDecl && !first)
                        {
                            AStructDecl aDecl = (AStructDecl)decl;

                            if (aDecl.GetName().Text != name)
                                continue;

                            bool isSameNamespace = Util.NamespacesEquals(currentNamespace, Util.GetFullNamespace(decl));

                            if (!isSameNamespace && aDecl.GetVisibilityModifier() is APrivateVisibilityModifier)
                                continue;

                            targets[2].Add(new List<Node>() { decl });
                        }
                    }
                }
                //Look in lib fields
                foreach (AFieldDecl field in data.Libraries.Fields)
                {
                    if (field.GetName().Text == name)
                    {
                        targets[2].Add(new List<Node>() { field });
                    }
                }
                //Namespaces
                visibleDecls = Util.GetVisibleDecls(node, false);
                foreach (IList declList in visibleDecls)
                {
                    foreach (PDecl decl in declList)
                    {
                        if (decl is ANamespaceDecl)
                        {
                            ANamespaceDecl aDecl = (ANamespaceDecl)decl;

                            if (aDecl.GetName().Text != name)
                                continue;

                            namespaces.Add(aDecl);
                        }
                    }
                }
            }
            else
            {
                /*private static void GetTargets(AAName node,
            List<string> names,
            List<AALocalDecl> locals,
            List<Node> structDecls, //<AAlocaldecl/APropertyDecl>
            List<PDecl> globalDecls,
            List<AStructDecl> structType,
            List<List<Node>> dotted, //<any of the above>.<AAlocaldecl/APropertyDecl>
            List<ANamespaceDecl> namespaces,
            SharedData data,
            ErrorCollection errors,
            out bool reportedError)*/
                List<string> baseNames = new List<string>();
                baseNames.AddRange(names);
                baseNames.RemoveAt(baseNames.Count - 1);
                List<List<Node>>[] baseTargets;
                List<ANamespaceDecl> baseNamespaces = new List<ANamespaceDecl>();
                GetTargets(node, baseNames, out baseTargets, baseNamespaces, data, errors, out reportedError);

                AStructDecl currentStruct = Util.GetAncestor<AStructDecl>(node);
                for (int i = 0; i < baseTargets.Length; i++)
                {
                    foreach (List<Node> list in baseTargets[i])
                    {
                        Node last = list[list.Count - 1];
                        PType type = null;
                        if (last is AALocalDecl)
                        {
                            type = ((AALocalDecl) last).GetType();
                        }
                        else if (last is APropertyDecl)
                        {
                            type = ((APropertyDecl) last).GetType();
                        }
                        else if (last is AFieldDecl)
                        {
                            type = ((AFieldDecl) last).GetType();
                        }
                        else if (last is TIdentifier)
                        {
                            type = new ANamedType(new TIdentifier("int"), null);
                        }
                        if (last is AStructDecl)
                        {
                            //Special. Static only
                            AStructDecl structDecl = ((AStructDecl) last);
                            foreach (AALocalDecl local in data.StructFields[structDecl])
                            {
                                if (local.GetName().Text != name)
                                    continue;
                                //Must be public if we are outside the struct
                                //If it's an enherited private variable, you can't refer to it.
                                if (currentStruct != structDecl && !(local.GetVisibilityModifier() is APublicVisibilityModifier) ||
                                    currentStruct == structDecl &&
                                    local.GetVisibilityModifier() is APrivateVisibilityModifier &&
                                    data.EnheritanceLocalMap.ContainsKey(local))
                                {
                                    continue;
                                }
                                if (local.GetStatic() == null)
                                {
                                    //non Static types doesn't work in this context
                                    continue;
                                }
                                List<Node> nodeList = new List<Node>();
                                nodeList.Add(structDecl);
                                nodeList.Add(local);
                                targets[i].Add(nodeList);
                            }
                            foreach (APropertyDecl local in data.StructProperties[structDecl])
                            {

                                if (local.GetName().Text != name)
                                    continue;
                                //Must be public if we are outside the struct
                                //If it's an enherited private variable, you can't refer to it.
                                if (currentStruct != structDecl && !(local.GetVisibilityModifier() is APublicVisibilityModifier))
                                {
                                    continue;
                                }
                                if (local.GetStatic() == null)
                                {
                                    //non Static types doesn't work in this context
                                    continue;
                                }
                                List<Node> nodeList = new List<Node>();
                                nodeList.Add(structDecl);
                                nodeList.Add(local);
                                targets[i].Add(nodeList);
                            }

                        }
                        else
                        {
                            if (type is ANamedType && data.StructTypeLinks.ContainsKey((ANamedType)type) && !(data.Enums.ContainsKey(data.StructTypeLinks[(ANamedType)type])))
                            {
                                AStructDecl targetStruct = data.StructTypeLinks[(ANamedType)type];
                                foreach (AALocalDecl local in data.StructFields[targetStruct])
                                {
                                    if (local.GetName().Text != name)
                                        continue;
                                    //Must be public if we are outside the struct
                                    //If it's an enherited private variable, you can't refer to it.
                                    if (currentStruct != targetStruct && !(local.GetVisibilityModifier() is APublicVisibilityModifier) ||
                                        currentStruct == targetStruct &&
                                        local.GetVisibilityModifier() is APrivateVisibilityModifier &&
                                        data.EnheritanceLocalMap.ContainsKey(local))
                                    {
                                        continue;
                                    }
                                    if (local.GetStatic() != null)
                                    {
                                        //Static types doesn't work in this context
                                        continue;
                                    }
                                    List<Node> nodeList = new List<Node>();
                                    nodeList.AddRange(list);
                                    nodeList.Add(local);
                                    targets[i].Add(nodeList);
                                }
                                foreach (APropertyDecl local in data.StructProperties[targetStruct])
                                {

                                    if (local.GetName().Text != name)
                                        continue;
                                    //Must be public if we are outside the struct
                                    //If it's an enherited private variable, you can't refer to it.
                                    if (currentStruct != targetStruct && !(local.GetVisibilityModifier() is APublicVisibilityModifier))
                                    {
                                        continue;
                                    }
                                    if (local.GetStatic() != null)
                                    {
                                        //Static types doesn't work in this context
                                        continue;
                                    }
                                    List<Node> nodeList = new List<Node>();
                                    nodeList.AddRange(list);
                                    nodeList.Add(local);
                                    targets[i].Add(nodeList);
                                }
                            }
                            else//Find matching enrichment
                            {
                                List<IList> visibleDecls = Util.GetVisibleDecls(node, true);
                                AEnrichmentDecl currentEnrichment = Util.GetAncestor<AEnrichmentDecl>(node);
                                foreach (IList declList in visibleDecls)
                                {
                                    foreach (PDecl decl in declList)
                                    {
                                        if (decl is AEnrichmentDecl)
                                        {
                                            AEnrichmentDecl aDecl = (AEnrichmentDecl)decl;
                                            if (Util.TypesEqual(aDecl.GetType(), type, data))
                                            {
                                                foreach (PDecl enrichmentDecl in aDecl.GetDecl())
                                                {
                                                    if (enrichmentDecl is APropertyDecl)
                                                    {
                                                        APropertyDecl local = (APropertyDecl)enrichmentDecl;
                                                        if (local.GetName().Text != name)
                                                            continue;
                                                        //Must be public if we are outside the struct
                                                        if (currentEnrichment != aDecl && !(local.GetVisibilityModifier() is APublicVisibilityModifier))
                                                        {
                                                            continue;
                                                        }
                                                        if (local.GetStatic() != null)
                                                        {
                                                            //Static types doesn't work in this context
                                                            continue;
                                                        }
                                                        List<Node> nodeList = new List<Node>();
                                                        nodeList.AddRange(list);
                                                        nodeList.Add(local);
                                                        targets[i].Add(nodeList);
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                                //Could be array.length
                                if ((type is AArrayTempType || type is ADynamicArrayType) && name == "length")
                                {
                                    List<Node> nodeList = new List<Node>();
                                    nodeList.AddRange(list);
                                    nodeList.Add((TIdentifier)node.GetIdentifier()[names.Count - 1]);
                                    targets[i].Add(nodeList);
                                }
                            }
                        }
                    }
                }

                AASourceFile currentFile = Util.GetAncestor<AASourceFile>(node);
                List<string> currentNamespace = Util.GetFullNamespace(node);
                foreach (ANamespaceDecl ns in baseNamespaces)
                {
                    bool isSameFile = currentFile == Util.GetAncestor<AASourceFile>(ns);
                    foreach (PDecl decl in ns.GetDecl())
                    {
                        if (decl is AFieldDecl)
                        {
                            AFieldDecl aDecl = (AFieldDecl)decl;

                            if (aDecl.GetName().Text != name)
                                continue;

                            bool isSameNamespace = Util.NamespacesEquals(currentNamespace, Util.GetFullNamespace(decl));

                            if (!isSameNamespace && aDecl.GetVisibilityModifier() is APrivateVisibilityModifier ||
                                !isSameFile && aDecl.GetStatic() != null)
                                continue;

                            targets[2].Add(new List<Node>(){decl});
                        }
                        else if (decl is APropertyDecl)
                        {
                            APropertyDecl aDecl = (APropertyDecl)decl;

                            if (aDecl.GetName().Text != name)
                                continue;

                            bool isSameNamespace = Util.NamespacesEquals(currentNamespace, Util.GetFullNamespace(decl));

                            if (!isSameNamespace && aDecl.GetVisibilityModifier() is APrivateVisibilityModifier ||
                                !isSameFile && aDecl.GetStatic() != null)
                                continue;

                            targets[2].Add(new List<Node>() { decl });
                        }
                        else if (decl is AStructDecl)
                        {
                            AStructDecl aDecl = (AStructDecl)decl;

                            if (aDecl.GetName().Text != name)
                                continue;

                            bool isSameNamespace = Util.NamespacesEquals(currentNamespace, Util.GetFullNamespace(decl));

                            if (!isSameNamespace && aDecl.GetVisibilityModifier() is APrivateVisibilityModifier)
                                continue;

                            targets[2].Add(new List<Node>() { decl });
                        }
                        else if (decl is ANamespaceDecl)
                        {
                            ANamespaceDecl aDecl = (ANamespaceDecl)decl;

                            if (aDecl.GetName().Text != name)
                                continue;

                            namespaces.Add(aDecl);
                        }
                    }
                }
            }

            //If we got no matches, and we are not last, report error
            if (errors != null && node.GetIdentifier().Count > names.Count &&
                targets[0].Count + targets[1].Count + targets[2].Count + namespaces.Count == 0)
            {
                string dotList = "";
                foreach (string s in names)
                {
                    if (dotList != "")
                        dotList += ".";
                    dotList += s;
                }
                errors.Add(new ErrorCollection.Error((TIdentifier)node.GetIdentifier()[names.Count - 1], dotList + LocRM.GetString("ErrorText174")));
                reportedError = true;
            }
        }
示例#5
0
 public ANamedType(TIdentifier name, TIdentifier ns)
 {
     AAName aName = new AAName();
     if (ns != null)
         aName.GetIdentifier().Add(ns);
     aName.GetIdentifier().Add(name);
     SetName(aName);
 }
示例#6
0
 ArrayList New260()
 {
     ArrayList nodeList = new ArrayList();
     ArrayList nodeArrayList1 = (ArrayList) Pop();
     TypedList listNode4 = new TypedList();
     TypedList listNode3 = (TypedList)nodeArrayList1[0];
     if ( listNode3 != null )
     {
     listNode4.AddAll(listNode3);
     }
     AAName pnameNode2 = new AAName (
       listNode4
     );
     ANamedType ptypeNode1 = new ANamedType (
       pnameNode2
     );
     nodeList.Add(ptypeNode1);
     return nodeList;
 }
示例#7
0
 ArrayList New531()
 {
     ArrayList nodeList = new ArrayList();
     ArrayList nodeArrayList4 = (ArrayList) Pop();
     ArrayList nodeArrayList3 = (ArrayList) Pop();
     ArrayList nodeArrayList2 = (ArrayList) Pop();
     ArrayList nodeArrayList1 = (ArrayList) Pop();
     TypedList listNode3 = new TypedList();
     TypedList listNode9 = new TypedList();
     TypedList listNode11 = new TypedList();
     TypedList listNode13 = new TypedList();
     TConst tconstNode2 = (TConst)nodeArrayList1[0];
     TypedList listNode7 = new TypedList();
     TypedList listNode6 = (TypedList)nodeArrayList2[0];
     if ( listNode6 != null )
     {
     listNode7.AddAll(listNode6);
     }
     AAName pnameNode5 = new AAName (
       listNode7
     );
     AAmbiguousNameLvalue plvalueNode4 = new AAmbiguousNameLvalue (
       pnameNode5
     );
     TypedList listNode10 = (TypedList)nodeArrayList3[0];
     if ( listNode10 != null )
     {
     listNode11.AddAll(listNode10);
     }
     TypedList listNode12 = (TypedList)nodeArrayList4[0];
     if ( listNode12 != null )
     {
     listNode13.AddAll(listNode12);
     }
     AShadySAssignmentExp pexpNode1 = new AShadySAssignmentExp (
       tconstNode2,
       listNode3,
       plvalueNode4,
       null,
       listNode9,
       listNode11,
       listNode13
     );
     nodeList.Add(pexpNode1);
     return nodeList;
 }
 public virtual void OutAAName(AAName node)
 {
     DefaultOut(node);
 }
示例#9
0
 ArrayList New470()
 {
     ArrayList nodeList = new ArrayList();
     ArrayList nodeArrayList2 = (ArrayList) Pop();
     ArrayList nodeArrayList1 = (ArrayList) Pop();
     TypedList listNode5 = new TypedList();
     TypedList listNode4 = (TypedList)nodeArrayList2[0];
     if ( listNode4 != null )
     {
     listNode5.AddAll(listNode4);
     }
     AAName pnameNode3 = new AAName (
       listNode5
     );
     AAmbiguousNameLvalue plvalueNode2 = new AAmbiguousNameLvalue (
       pnameNode3
     );
     TMinusMinus tminusminusNode7 = (TMinusMinus)nodeArrayList1[0];
     APreDecIncDecOp pincdecopNode6 = new APreDecIncDecOp (
       tminusminusNode7
     );
     AIncDecExp pexpNode1 = new AIncDecExp (
       plvalueNode2,
       pincdecopNode6
     );
     nodeList.Add(pexpNode1);
     return nodeList;
 }
示例#10
0
 ArrayList New509()
 {
     ArrayList nodeList = new ArrayList();
     ArrayList nodeArrayList3 = (ArrayList) Pop();
     ArrayList nodeArrayList2 = (ArrayList) Pop();
     ArrayList nodeArrayList1 = (ArrayList) Pop();
     TAssign tassignNode2 = (TAssign)nodeArrayList2[0];
     TypedList listNode6 = new TypedList();
     TypedList listNode5 = (TypedList)nodeArrayList1[0];
     if ( listNode5 != null )
     {
     listNode6.AddAll(listNode5);
     }
     AAName pnameNode4 = new AAName (
       listNode6
     );
     AAmbiguousNameLvalue plvalueNode3 = new AAmbiguousNameLvalue (
       pnameNode4
     );
     PExp pexpNode7 = (PExp)nodeArrayList3[0];
     AAssignmentExp pexpNode1 = new AAssignmentExp (
       tassignNode2,
       plvalueNode3,
       pexpNode7
     );
     nodeList.Add(pexpNode1);
     return nodeList;
 }
示例#11
0
 ArrayList New422()
 {
     ArrayList nodeList = new ArrayList();
     ArrayList nodeArrayList1 = (ArrayList) Pop();
     TypedList listNode5 = new TypedList();
     TypedList listNode4 = (TypedList)nodeArrayList1[0];
     if ( listNode4 != null )
     {
     listNode5.AddAll(listNode4);
     }
     AAName pnameNode3 = new AAName (
       listNode5
     );
     AAmbiguousNameLvalue plvalueNode2 = new AAmbiguousNameLvalue (
       pnameNode3
     );
     ALvalueExp pexpNode1 = new ALvalueExp (
       plvalueNode2
     );
     nodeList.Add(pexpNode1);
     return nodeList;
 }
示例#12
0
 ArrayList New380()
 {
     ArrayList nodeList = new ArrayList();
     ArrayList nodeArrayList6 = (ArrayList) Pop();
     ArrayList nodeArrayList5 = (ArrayList) Pop();
     ArrayList nodeArrayList4 = (ArrayList) Pop();
     ArrayList nodeArrayList3 = (ArrayList) Pop();
     ArrayList nodeArrayList2 = (ArrayList) Pop();
     ArrayList nodeArrayList1 = (ArrayList) Pop();
     TypedList listNode11 = new TypedList();
     TypedList listNode6 = new TypedList();
     TypedList listNode5 = (TypedList)nodeArrayList1[0];
     if ( listNode5 != null )
     {
     listNode6.AddAll(listNode5);
     }
     AAName pnameNode4 = new AAName (
       listNode6
     );
     AAmbiguousNameLvalue plvalueNode3 = new AAmbiguousNameLvalue (
       pnameNode4
     );
     ALvalueExp pexpNode2 = new ALvalueExp (
       plvalueNode3
     );
     TDot tdotNode8 = (TDot)nodeArrayList2[0];
     ADotDotType pdottypeNode7 = new ADotDotType (
       tdotNode8
     );
     TIdentifier tidentifierNode9 = (TIdentifier)nodeArrayList3[0];
     TypedList listNode10 = (TypedList)nodeArrayList5[0];
     if ( listNode10 != null )
     {
     listNode11.AddAll(listNode10);
     }
     ANonstaticInvokeExp pexpNode1 = new ANonstaticInvokeExp (
       pexpNode2,
       pdottypeNode7,
       tidentifierNode9,
       listNode11
     );
     nodeList.Add(pexpNode1);
     return nodeList;
 }
示例#13
0
 ArrayList New336()
 {
     ArrayList nodeList = new ArrayList();
     ArrayList nodeArrayList4 = (ArrayList) Pop();
     ArrayList nodeArrayList3 = (ArrayList) Pop();
     ArrayList nodeArrayList2 = (ArrayList) Pop();
     ArrayList nodeArrayList1 = (ArrayList) Pop();
     TLBracket tlbracketNode2 = (TLBracket)nodeArrayList2[0];
     TypedList listNode7 = new TypedList();
     TypedList listNode6 = (TypedList)nodeArrayList1[0];
     if ( listNode6 != null )
     {
     listNode7.AddAll(listNode6);
     }
     AAName pnameNode5 = new AAName (
       listNode7
     );
     AAmbiguousNameLvalue plvalueNode4 = new AAmbiguousNameLvalue (
       pnameNode5
     );
     ALvalueExp pexpNode3 = new ALvalueExp (
       plvalueNode4
     );
     PExp pexpNode8 = (PExp)nodeArrayList3[0];
     AArrayLvalue plvalueNode1 = new AArrayLvalue (
       tlbracketNode2,
       pexpNode3,
       pexpNode8
     );
     nodeList.Add(plvalueNode1);
     return nodeList;
 }
示例#14
0
 public virtual void CaseAAName(AAName node)
 {
     DefaultCase(node);
 }
示例#15
0
 ArrayList New532()
 {
     ArrayList nodeList = new ArrayList();
     ArrayList nodeArrayList7 = (ArrayList) Pop();
     ArrayList nodeArrayList6 = (ArrayList) Pop();
     ArrayList nodeArrayList5 = (ArrayList) Pop();
     ArrayList nodeArrayList4 = (ArrayList) Pop();
     ArrayList nodeArrayList3 = (ArrayList) Pop();
     ArrayList nodeArrayList2 = (ArrayList) Pop();
     ArrayList nodeArrayList1 = (ArrayList) Pop();
     TypedList listNode3 = new TypedList();
     TypedList listNode10 = new TypedList();
     TypedList listNode12 = new TypedList();
     TypedList listNode14 = new TypedList();
     TConst tconstNode2 = (TConst)nodeArrayList1[0];
     TypedList listNode7 = new TypedList();
     TypedList listNode6 = (TypedList)nodeArrayList2[0];
     if ( listNode6 != null )
     {
     listNode7.AddAll(listNode6);
     }
     AAName pnameNode5 = new AAName (
       listNode7
     );
     AAmbiguousNameLvalue plvalueNode4 = new AAmbiguousNameLvalue (
       pnameNode5
     );
     TLt tltNode8 = (TLt)nodeArrayList3[0];
     TypedList listNode9 = (TypedList)nodeArrayList4[0];
     if ( listNode9 != null )
     {
     listNode10.AddAll(listNode9);
     }
     TypedList listNode11 = (TypedList)nodeArrayList6[0];
     if ( listNode11 != null )
     {
     listNode12.AddAll(listNode11);
     }
     TypedList listNode13 = (TypedList)nodeArrayList7[0];
     if ( listNode13 != null )
     {
     listNode14.AddAll(listNode13);
     }
     AShadySAssignmentExp pexpNode1 = new AShadySAssignmentExp (
       tconstNode2,
       listNode3,
       plvalueNode4,
       tltNode8,
       listNode10,
       listNode12,
       listNode14
     );
     nodeList.Add(pexpNode1);
     return nodeList;
 }
示例#16
0
 public virtual void InAAName(AAName node)
 {
     DefaultIn(node);
 }
示例#17
0
 ArrayList New583()
 {
     ArrayList nodeList = new ArrayList();
     ArrayList nodeArrayList3 = (ArrayList) Pop();
     ArrayList nodeArrayList2 = (ArrayList) Pop();
     ArrayList nodeArrayList1 = (ArrayList) Pop();
     TypedList listNode6 = new TypedList();
     TypedList listNode5 = (TypedList)nodeArrayList1[0];
     if ( listNode5 != null )
     {
     listNode6.AddAll(listNode5);
     }
     AAName pnameNode4 = new AAName (
       listNode6
     );
     AAmbiguousNameLvalue plvalueNode3 = new AAmbiguousNameLvalue (
       pnameNode4
     );
     ALvalueExp pexpNode2 = new ALvalueExp (
       plvalueNode3
     );
     TArrow tarrowNode8 = (TArrow)nodeArrayList2[0];
     AArrowDotType pdottypeNode7 = new AArrowDotType (
       tarrowNode8
     );
     TIdentifier tidentifierNode9 = (TIdentifier)nodeArrayList3[0];
     AStructLvalue plvalueNode1 = new AStructLvalue (
       pexpNode2,
       pdottypeNode7,
       tidentifierNode9
     );
     nodeList.Add(plvalueNode1);
     return nodeList;
 }
示例#18
0
 public AAmbiguousNameLvalue(ASimpleName simpleName)
 {
     AAName name = new AAName();
     name.GetIdentifier().Add(simpleName.Identifier);
     SetAmbiguous(name);
 }
示例#19
0
 ArrayList New594()
 {
     ArrayList nodeList = new ArrayList();
     ArrayList nodeArrayList1 = (ArrayList) Pop();
     TypedList listNode4 = new TypedList();
     TypedList listNode3 = (TypedList)nodeArrayList1[0];
     if ( listNode3 != null )
     {
     listNode4.AddAll(listNode3);
     }
     AAName pnameNode2 = new AAName (
       listNode4
     );
     AAmbiguousNameLvalue plvalueNode1 = new AAmbiguousNameLvalue (
       pnameNode2
     );
     nodeList.Add(plvalueNode1);
     return nodeList;
 }
示例#20
0
 internal Identifier_Cast(AAName obj)
 {
     this.obj = obj;
 }
 public override void CaseAAName(AAName node)
 {
     Value += node.AsString();
 }