public VariableDescription(AFieldDecl fieldDecl) { Name = fieldDecl.GetName().Text; Type = Util.TypeToString(fieldDecl.GetType()); PlacementPrefix = "Field"; VariableType = VariableTypes.Field; Const = fieldDecl.GetConst() != null; IsStatic = fieldDecl.GetStatic() != null; Visibility = fieldDecl.GetVisibilityModifier(); realType = (PType)fieldDecl.GetType().Clone(); init = fieldDecl.GetInit(); Line = fieldDecl.GetName().Line; Position = TextPoint.FromCompilerCoords(fieldDecl.GetName()); }
public override void CaseAFieldDecl(AFieldDecl node) { if (node.GetStatic() != null) { return; } writer.WriteLine(TypeToString(node.GetType()) + " " + node.GetName().Text + ";"); if (Fields.Any(decl => decl.GetName().Text == node.GetName().Text)) { return; } Fields.Add(node); //node.SetInit(null); node.Parent().RemoveChild(node); }
public override void CaseAFieldDecl(AFieldDecl node) { if (node.GetStatic() != null) { Write("static "); } if (node.GetConst() != null) { Write("const "); } node.GetType().Apply(this); Write(" " + node.GetName().Text); if (node.GetInit() != null) { Write(" = "); node.GetInit().Apply(this); } Write(";\n\n"); }