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()); }
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 InAEnrichmentDecl(AEnrichmentDecl node) { type = node.GetType(); }
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]; }
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]; }
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]; }