public EnrichmentDescription(AEnrichmentDecl structDecl)
        {
            Parser parser = new Parser(structDecl);

            Fields = parser.Fields;
            Methods = parser.Methods;
            Constructors = parser.Constructors;
            Deconstructors = parser.Deconstructors;
            LineFrom = structDecl.GetToken().Line;
            LineTo = structDecl.GetEndToken().Line;
            type = structDecl.GetType();
            type.Parent().RemoveChild(type);
            IsClass = structDecl.GetDimention() != null;
            Position = TextPoint.FromCompilerCoords(structDecl.GetToken());
        }
Пример #2
0
 public virtual void OutAEnrichmentDecl(AEnrichmentDecl node)
 {
     DefaultOut(node);
 }
Пример #3
0
 public virtual void InAEnrichmentDecl(AEnrichmentDecl node)
 {
     DefaultIn(node);
 }
Пример #4
0
 public virtual void CaseAEnrichmentDecl(AEnrichmentDecl node)
 {
     DefaultCase(node);
 }
Пример #5
0
 public override void CaseAEnrichmentDecl(AEnrichmentDecl node)
 {
     InAEnrichmentDecl(node);
     {
         Object[] temp = new Object[node.GetDecl().Count];
         node.GetDecl().CopyTo(temp, 0);
         for (int i = temp.Length - 1; i >= 0; i--)
         {
             ((PDecl)temp[i]).Apply(this);
         }
     }
     if (node.GetType() != null)
     {
         node.GetType().Apply(this);
     }
     if (node.GetEndToken() != null)
     {
         node.GetEndToken().Apply(this);
     }
     if (node.GetIntDim() != null)
     {
         node.GetIntDim().Apply(this);
     }
     if (node.GetDimention() != null)
     {
         node.GetDimention().Apply(this);
     }
     if (node.GetToken() != null)
     {
         node.GetToken().Apply(this);
     }
     OutAEnrichmentDecl(node);
 }
 //--------------------------
 public override void OutAEnrichmentDecl(AEnrichmentDecl node)
 {
     data.Enrichments.Add(node);
     base.OutAEnrichmentDecl(node);
 }
 public override void CaseAEnrichmentDecl(AEnrichmentDecl node)
 {
     if (node.GetDimention() != null && !data.IsLiteCompile)
     {
         //Find int dim
         foldIntegerConstants = true;
         isInANewExp = true;//If false, we dont require a value
         node.GetDimention().Apply(this);
         isInANewExp = false;
         foldIntegerConstants = false;
         if (foldingFailed)
         {
             errors.Add(new ErrorCollection.Error(node.GetToken(), LocRM.GetString("ErrorText167")));
             throw new ParserException(node.GetToken(), "TypeLinking.CaseAStructDecl");
         }
         node.SetIntDim(new TIntegerLiteral(integerConstant.ToString()));
     }
     base.CaseAEnrichmentDecl(node);
 }
Пример #8
0
            public static AMethodDecl CreateDeleteEnrichmentMethod(Node node, AEnrichmentDecl enrichmentDecl, SharedData data)
            {
                if (deleteEnrichmentMethod.ContainsKey(enrichmentDecl))
                    return deleteEnrichmentMethod[enrichmentDecl];

                if (enrichmentDecl.GetIntDim() == null)
                    return CreateDeleteObjectMethod(node, data);
                return CreateDeleteEnrichmentMethodGlobalArray(node, enrichmentDecl, data);
            }
 public override void OutAEnrichmentDecl(AEnrichmentDecl node)
 {
     node.Parent().RemoveChild(node);
 }
 public override void InAEnrichmentDecl(AEnrichmentDecl node)
 {
     type = node.GetType();
 }
Пример #11
0
            public static AMethodDecl CreateNewObjectMethod(Node node, AEnrichmentDecl enrichmentDecl, SharedData data)
            {
                if (createEnrichmentMethod.ContainsKey(enrichmentDecl))
                    return createEnrichmentMethod[enrichmentDecl];

                createEnrichmentMethod[enrichmentDecl] = CreateNewObjectMethodP(node, enrichmentDecl.GetIntDim(),
                                                                        Util.TypeToIdentifierString(enrichmentDecl.GetType()),
                                                                        CreateEnrichmentFields(node, enrichmentDecl, data), data);

                return createEnrichmentMethod[enrichmentDecl];
            }
Пример #12
0
            public static GlobalStructVars CreateEnrichmentFields(Node node, AEnrichmentDecl enrichmentDecl, SharedData data)
            {
                if (EnrichmentFields.ContainsKey(enrichmentDecl))
                    return EnrichmentFields[enrichmentDecl];

                EnrichmentFields[enrichmentDecl] = CreatePointerFields(node, enrichmentDecl.GetIntDim(),
                                                                       Util.TypeToIdentifierString(
                                                                           enrichmentDecl.GetType()),
                                                                       Util.MakeClone(enrichmentDecl.GetType(), data), data);
                return EnrichmentFields[enrichmentDecl];
            }
Пример #13
0
 public static AMethodDecl CreateDeleteEnrichmentMethodGlobalArray(Node node, AEnrichmentDecl enrichmentDecl, SharedData data)
 {
     deleteEnrichmentMethod[enrichmentDecl] = CreateDeleteStructMethodGlobalArrayP(node, enrichmentDecl.GetIntDim(),
                                                                           Util.TypeToIdentifierString(enrichmentDecl.GetType()),
                                                                           CreateEnrichmentFields(node,
                                                                                              enrichmentDecl,
                                                                                              data), data);
     return deleteEnrichmentMethod[enrichmentDecl];
 }
 public override void CaseAEnrichmentDecl(AEnrichmentDecl node)
 {
     if (node.GetDimention() != null)
     {
         bool prevFolding = folding;
         int prevValue = value;
         bool wasANewExp = isANewExp;
         folding = true;
         value = 0;
         node.GetDimention().Apply(this);
         node.SetIntDim(new TIntegerLiteral(value.ToString()));
         folding = prevFolding;
         value = prevValue;
         isANewExp = wasANewExp;
     }
     base.CaseAEnrichmentDecl(node);
 }
Пример #15
0
 ArrayList New124()
 {
     ArrayList nodeList = new ArrayList();
     ArrayList nodeArrayList5 = (ArrayList) Pop();
     ArrayList nodeArrayList4 = (ArrayList) Pop();
     ArrayList nodeArrayList3 = (ArrayList) Pop();
     ArrayList nodeArrayList2 = (ArrayList) Pop();
     ArrayList nodeArrayList1 = (ArrayList) Pop();
     TypedList listNode8 = new TypedList();
     TEnrichment tenrichmentNode2 = (TEnrichment)nodeArrayList1[0];
     PExp pexpNode3 = (PExp)nodeArrayList2[0];
     TRBrace trbraceNode5 = (TRBrace)nodeArrayList4[1];
     PType ptypeNode6 = (PType)nodeArrayList3[0];
     TypedList listNode7 = (TypedList)nodeArrayList4[0];
     if ( listNode7 != null )
     {
     listNode8.AddAll(listNode7);
     }
     AEnrichmentDecl pdeclNode1 = new AEnrichmentDecl (
       tenrichmentNode2,
       pexpNode3,
       null,
       trbraceNode5,
       ptypeNode6,
       listNode8
     );
     nodeList.Add(pdeclNode1);
     return nodeList;
 }
Пример #16
0
 internal Decl_Cast(AEnrichmentDecl obj)
 {
     this.obj = obj;
 }
 public override void CaseAEnrichmentDecl(AEnrichmentDecl node)
 {
     EnrichmentDescription enrichmentDescription = new EnrichmentDescription(node);
     Enrichments.Add(enrichmentDescription);
     //inEnrichment = true;
     //base.CaseAEnrichmentDecl(node);
     //inEnrichment = false;
 }