Exemplo n.º 1
0
 public override void CaseAShadySAssignmentExp(AShadySAssignmentExp node)
 {
     InAShadySAssignmentExp(node);
     {
         Object[] temp = new Object[node.GetLocalDeclRight().Count];
         node.GetLocalDeclRight().CopyTo(temp, 0);
         for (int i = temp.Length - 1; i >= 0; i--)
         {
             ((PLocalDeclRight)temp[i]).Apply(this);
         }
     }
     {
         Object[] temp = new Object[node.GetPostPointers().Count];
         node.GetPostPointers().CopyTo(temp, 0);
         for (int i = temp.Length - 1; i >= 0; i--)
         {
             ((PShadyDynamicOps)temp[i]).Apply(this);
         }
     }
     {
         Object[] temp = new Object[node.GetGenericTypes().Count];
         node.GetGenericTypes().CopyTo(temp, 0);
         for (int i = temp.Length - 1; i >= 0; i--)
         {
             ((PType)temp[i]).Apply(this);
         }
     }
     if (node.GetGenericToken() != null)
     {
         node.GetGenericToken().Apply(this);
     }
     if (node.GetLvalue() != null)
     {
         node.GetLvalue().Apply(this);
     }
     {
         Object[] temp = new Object[node.GetPrePointers().Count];
         node.GetPrePointers().CopyTo(temp, 0);
         for (int i = temp.Length - 1; i >= 0; i--)
         {
             ((TStar)temp[i]).Apply(this);
         }
     }
     if (node.GetConst() != null)
     {
         node.GetConst().Apply(this);
     }
     OutAShadySAssignmentExp(node);
 }
Exemplo n.º 2
0
 public virtual void InAShadySAssignmentExp(AShadySAssignmentExp node)
 {
     DefaultIn(node);
 }
Exemplo n.º 3
0
        public override void OutAShadySAssignmentExp(AShadySAssignmentExp node)
        {
            if (node.GetLocalDeclRight().Count == 1 &&
                ((AALocalDeclRight) node.GetLocalDeclRight()[0]).GetName() == null)
            {
                //Assignment expression
                //Cant have any [] or * after first lvalue
                if (node.GetPostPointers().Count > 0)
                {
                    Token token;
                    PShadyDynamicOps op = (PShadyDynamicOps)node.GetPostPointers()[0];
                    if (op is APointerShadyDynamicOps)
                        token = ((APointerShadyDynamicOps) op).GetToken();
                    else
                        token = ((AArrayShadyDynamicOps)op).GetToken();
                    errors.Add(new ErrorCollection.Error(token, currentSourceFile, "Didn't expect " + token.Text + " there. Im very confused."));
                }
                if (node.GetGenericToken() != null)
                    errors.Add(new ErrorCollection.Error(node.GetGenericToken(),
                                                         "What the hell is this? I didn't see that coming. Or maybe I did.. But I don't like it!"));

                //an assignment can't be const);
                if (node.GetConst() != null)
                    errors.Add(new ErrorCollection.Error(node.GetConst(), currentSourceFile, "Unexpected const", false));
                //An assignment must have a right side
                if (((AALocalDeclRight) node.GetLocalDeclRight()[0]).GetInit() == null ||
                    ((AALocalDeclRight) node.GetLocalDeclRight()[0]).GetAssignop() == null)
                {
                    Token token = GetToken(node.GetLvalue());
                    errors.Add(new ErrorCollection.Error(token, currentSourceFile, "Expected assignment", false));
                    node.Parent().RemoveChild(node);
                    return;
                }
                ASAssignmentExp exp = new ASAssignmentExp(
                    ((AALocalDeclRight) node.GetLocalDeclRight()[0]).GetAssignop(), node.GetLvalue(),
                    ((AALocalDeclRight) node.GetLocalDeclRight()[0]).GetInit());
                node.ReplaceBy(exp);
                exp.Apply(this);
            }
            else
            {
                //Local decl
                AMultiLocalDecl localDecl = new AMultiLocalDecl(node.GetConst(), LvalueToType(node.GetLvalue(), node.GetPostPointers(), node.GetGenericToken(), node.GetGenericTypes()),
                                                                new ArrayList());
                while (node.GetLocalDeclRight().Count > 0)
                {
                    localDecl.GetLocalDeclRight().Add(node.GetLocalDeclRight()[0]);
                }

                AExpStm expStm = Util.GetAncestor<AExpStm>(node);
                ALocalDeclStm localDeclStm = new ALocalDeclStm(expStm.GetToken(), localDecl);
                expStm.ReplaceBy(localDeclStm);
                localDeclStm.Apply(this);
            }
        }
Exemplo n.º 4
0
 public virtual void CaseAShadySAssignmentExp(AShadySAssignmentExp node)
 {
     DefaultCase(node);
 }
Exemplo n.º 5
0
 ArrayList New527()
 {
     ArrayList nodeList = new ArrayList();
     ArrayList nodeArrayList3 = (ArrayList) Pop();
     ArrayList nodeArrayList2 = (ArrayList) Pop();
     ArrayList nodeArrayList1 = (ArrayList) Pop();
     TypedList listNode3 = new TypedList();
     TypedList listNode7 = new TypedList();
     TypedList listNode9 = new TypedList();
     TypedList listNode11 = new TypedList();
     TThis tthisNode5 = (TThis)nodeArrayList1[0];
     AThisLvalue plvalueNode4 = new AThisLvalue (
       tthisNode5
     );
     TypedList listNode8 = (TypedList)nodeArrayList2[0];
     if ( listNode8 != null )
     {
     listNode9.AddAll(listNode8);
     }
     TypedList listNode10 = (TypedList)nodeArrayList3[0];
     if ( listNode10 != null )
     {
     listNode11.AddAll(listNode10);
     }
     AShadySAssignmentExp pexpNode1 = new AShadySAssignmentExp (
       null,
       listNode3,
       plvalueNode4,
       null,
       listNode7,
       listNode9,
       listNode11
     );
     nodeList.Add(pexpNode1);
     return nodeList;
 }
Exemplo n.º 6
0
 ArrayList New544()
 {
     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 listNode8 = new TypedList();
     TypedList listNode10 = new TypedList();
     TypedList listNode12 = new TypedList();
     TConst tconstNode2 = (TConst)nodeArrayList1[0];
     TValue tvalueNode5 = (TValue)nodeArrayList2[0];
     AValueLvalue plvalueNode4 = new AValueLvalue (
       tvalueNode5
     );
     TLt tltNode6 = (TLt)nodeArrayList3[0];
     TypedList listNode7 = (TypedList)nodeArrayList4[0];
     if ( listNode7 != null )
     {
     listNode8.AddAll(listNode7);
     }
     TypedList listNode9 = (TypedList)nodeArrayList6[0];
     if ( listNode9 != null )
     {
     listNode10.AddAll(listNode9);
     }
     TypedList listNode11 = (TypedList)nodeArrayList7[0];
     if ( listNode11 != null )
     {
     listNode12.AddAll(listNode11);
     }
     AShadySAssignmentExp pexpNode1 = new AShadySAssignmentExp (
       tconstNode2,
       listNode3,
       plvalueNode4,
       tltNode6,
       listNode8,
       listNode10,
       listNode12
     );
     nodeList.Add(pexpNode1);
     return nodeList;
 }
Exemplo n.º 7
0
 ArrayList New539()
 {
     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 listNode6 = new TypedList();
     TypedList listNode8 = new TypedList();
     TypedList listNode10 = new TypedList();
     TConst tconstNode2 = (TConst)nodeArrayList1[0];
     PLvalue plvalueNode4 = (PLvalue)nodeArrayList2[0];
     TypedList listNode7 = (TypedList)nodeArrayList3[0];
     if ( listNode7 != null )
     {
     listNode8.AddAll(listNode7);
     }
     TypedList listNode9 = (TypedList)nodeArrayList4[0];
     if ( listNode9 != null )
     {
     listNode10.AddAll(listNode9);
     }
     AShadySAssignmentExp pexpNode1 = new AShadySAssignmentExp (
       tconstNode2,
       listNode3,
       plvalueNode4,
       null,
       listNode6,
       listNode8,
       listNode10
     );
     nodeList.Add(pexpNode1);
     return nodeList;
 }
Exemplo n.º 8
0
 internal LocalDeclRight_Cast(AShadySAssignmentExp obj)
 {
     this.obj = obj;
 }
Exemplo n.º 9
0
 ArrayList New537()
 {
     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 listNode3 = new TypedList();
     TypedList listNode7 = new TypedList();
     TypedList listNode9 = new TypedList();
     TypedList listNode11 = new TypedList();
     TConst tconstNode2 = (TConst)nodeArrayList1[0];
     TIdentifier tidentifierNode5 = (TIdentifier)nodeArrayList4[0];
     AStructFieldLvalue plvalueNode4 = new AStructFieldLvalue (
       tidentifierNode5
     );
     TypedList listNode8 = (TypedList)nodeArrayList5[0];
     if ( listNode8 != null )
     {
     listNode9.AddAll(listNode8);
     }
     TypedList listNode10 = (TypedList)nodeArrayList6[0];
     if ( listNode10 != null )
     {
     listNode11.AddAll(listNode10);
     }
     AShadySAssignmentExp pexpNode1 = new AShadySAssignmentExp (
       tconstNode2,
       listNode3,
       plvalueNode4,
       null,
       listNode7,
       listNode9,
       listNode11
     );
     nodeList.Add(pexpNode1);
     return nodeList;
 }
Exemplo n.º 10
0
 ArrayList New538()
 {
     ArrayList nodeList = new ArrayList();
     ArrayList nodeArrayList9 = (ArrayList) Pop();
     ArrayList nodeArrayList8 = (ArrayList) Pop();
     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 listNode8 = new TypedList();
     TypedList listNode10 = new TypedList();
     TypedList listNode12 = new TypedList();
     TConst tconstNode2 = (TConst)nodeArrayList1[0];
     TIdentifier tidentifierNode5 = (TIdentifier)nodeArrayList4[0];
     AStructFieldLvalue plvalueNode4 = new AStructFieldLvalue (
       tidentifierNode5
     );
     TLt tltNode6 = (TLt)nodeArrayList5[0];
     TypedList listNode7 = (TypedList)nodeArrayList6[0];
     if ( listNode7 != null )
     {
     listNode8.AddAll(listNode7);
     }
     TypedList listNode9 = (TypedList)nodeArrayList8[0];
     if ( listNode9 != null )
     {
     listNode10.AddAll(listNode9);
     }
     TypedList listNode11 = (TypedList)nodeArrayList9[0];
     if ( listNode11 != null )
     {
     listNode12.AddAll(listNode11);
     }
     AShadySAssignmentExp pexpNode1 = new AShadySAssignmentExp (
       tconstNode2,
       listNode3,
       plvalueNode4,
       tltNode6,
       listNode8,
       listNode10,
       listNode12
     );
     nodeList.Add(pexpNode1);
     return nodeList;
 }
Exemplo n.º 11
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;
 }
Exemplo n.º 12
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;
 }
Exemplo n.º 13
0
 ArrayList New528()
 {
     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 listNode3 = new TypedList();
     TypedList listNode8 = new TypedList();
     TypedList listNode10 = new TypedList();
     TypedList listNode12 = new TypedList();
     TThis tthisNode5 = (TThis)nodeArrayList1[0];
     AThisLvalue plvalueNode4 = new AThisLvalue (
       tthisNode5
     );
     TLt tltNode6 = (TLt)nodeArrayList2[0];
     TypedList listNode7 = (TypedList)nodeArrayList3[0];
     if ( listNode7 != null )
     {
     listNode8.AddAll(listNode7);
     }
     TypedList listNode9 = (TypedList)nodeArrayList5[0];
     if ( listNode9 != null )
     {
     listNode10.AddAll(listNode9);
     }
     TypedList listNode11 = (TypedList)nodeArrayList6[0];
     if ( listNode11 != null )
     {
     listNode12.AddAll(listNode11);
     }
     AShadySAssignmentExp pexpNode1 = new AShadySAssignmentExp (
       null,
       listNode3,
       plvalueNode4,
       tltNode6,
       listNode8,
       listNode10,
       listNode12
     );
     nodeList.Add(pexpNode1);
     return nodeList;
 }
Exemplo n.º 14
0
 public virtual void OutAShadySAssignmentExp(AShadySAssignmentExp node)
 {
     DefaultOut(node);
 }
Exemplo n.º 15
0
 ArrayList New540()
 {
     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 listNode7 = new TypedList();
     TypedList listNode9 = new TypedList();
     TypedList listNode11 = new TypedList();
     TConst tconstNode2 = (TConst)nodeArrayList1[0];
     PLvalue plvalueNode4 = (PLvalue)nodeArrayList2[0];
     TLt tltNode5 = (TLt)nodeArrayList3[0];
     TypedList listNode6 = (TypedList)nodeArrayList4[0];
     if ( listNode6 != null )
     {
     listNode7.AddAll(listNode6);
     }
     TypedList listNode8 = (TypedList)nodeArrayList6[0];
     if ( listNode8 != null )
     {
     listNode9.AddAll(listNode8);
     }
     TypedList listNode10 = (TypedList)nodeArrayList7[0];
     if ( listNode10 != null )
     {
     listNode11.AddAll(listNode10);
     }
     AShadySAssignmentExp pexpNode1 = new AShadySAssignmentExp (
       tconstNode2,
       listNode3,
       plvalueNode4,
       tltNode5,
       listNode7,
       listNode9,
       listNode11
     );
     nodeList.Add(pexpNode1);
     return nodeList;
 }
Exemplo n.º 16
0
 internal GenericTypes_Cast(AShadySAssignmentExp obj)
 {
     this.obj = obj;
 }
Exemplo n.º 17
0
 ArrayList New543()
 {
     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 listNode7 = new TypedList();
     TypedList listNode9 = new TypedList();
     TypedList listNode11 = new TypedList();
     TConst tconstNode2 = (TConst)nodeArrayList1[0];
     TValue tvalueNode5 = (TValue)nodeArrayList2[0];
     AValueLvalue plvalueNode4 = new AValueLvalue (
       tvalueNode5
     );
     TypedList listNode8 = (TypedList)nodeArrayList3[0];
     if ( listNode8 != null )
     {
     listNode9.AddAll(listNode8);
     }
     TypedList listNode10 = (TypedList)nodeArrayList4[0];
     if ( listNode10 != null )
     {
     listNode11.AddAll(listNode10);
     }
     AShadySAssignmentExp pexpNode1 = new AShadySAssignmentExp (
       tconstNode2,
       listNode3,
       plvalueNode4,
       null,
       listNode7,
       listNode9,
       listNode11
     );
     nodeList.Add(pexpNode1);
     return nodeList;
 }
Exemplo n.º 18
0
 internal PrePointers_Cast(AShadySAssignmentExp obj)
 {
     this.obj = obj;
 }
        public override void OutAShadySAssignmentExp(AShadySAssignmentExp node)
        {
            if (node.GetLocalDeclRight().Count == 1 &&
                ((AALocalDeclRight) node.GetLocalDeclRight()[0]).GetName() == null)
            {
                //Assignment expression

                //an assignment can't be const);
                //An assignment must have a right side
                if (((AALocalDeclRight) node.GetLocalDeclRight()[0]).GetInit() == null ||
                    ((AALocalDeclRight) node.GetLocalDeclRight()[0]).GetAssignop() == null)
                {
                    node.Parent().RemoveChild(node);
                    return;
                }
                ASAssignmentExp exp = new ASAssignmentExp(
                    ((AALocalDeclRight) node.GetLocalDeclRight()[0]).GetAssignop(), node.GetLvalue(),
                    ((AALocalDeclRight) node.GetLocalDeclRight()[0]).GetInit());
                node.ReplaceBy(exp);
                exp.Apply(this);
            }
            else
            {

                //Local decl
                AMultiLocalDecl localDecl = new AMultiLocalDecl(node.GetConst(), LvalueToType(node.GetLvalue(), node.GetPostPointers(), node.GetGenericToken(), node.GetGenericTypes()),
                                                                new ArrayList());
                while (node.GetLocalDeclRight().Count > 0)
                {
                    localDecl.GetLocalDeclRight().Add(node.GetLocalDeclRight()[0]);
                }

                AExpStm expStm = Util.GetAncestor<AExpStm>(node);
                ALocalDeclStm localDeclStm = new ALocalDeclStm(expStm.GetToken(), localDecl);
                expStm.ReplaceBy(localDeclStm);
                localDeclStm.Apply(this);
            }
        }