/// <inheritdoc /> public Node Visit(VarDeclarationParseNode vdpn) { Node val = null; Node type = null; if (vdpn.Value != null) { val = vdpn.Value.Visit(this); } if (vdpn.Type != null) { type = vdpn.Type.Visit(this); } var ret = new VarDeclarationNode(vdpn.Token, vdpn, val, type); addAnnotations(vdpn.Annotations, ret.Annotations); if (vdpn.Annotations != null && vdpn.Annotations.HasAnnotation("public")) { ret.Readable = true; ret.Writable = true; } else { ret.Readable = (vdpn.Annotations != null && vdpn.Annotations.HasAnnotation("readable")); ret.Writable = (vdpn.Annotations != null && vdpn.Annotations.HasAnnotation("writable")); } return(ret); }
public XmlElement Visit(VarDeclarationParseNode vdpn) { var el = makeNode(vdpn, "var-declaration"); addProperty(el, "name", vdpn.Name); addProperty(el, "type", vdpn.Type); addProperty(el, "value", vdpn.Value); return(el); }
/// <inheritdoc/> public virtual ParseNode Visit(VarDeclarationParseNode vdpn) { vdpn.Name.Visit(this); if (vdpn.Value != null) { vdpn.Value.Visit(this); } if (vdpn.Type != null) { vdpn.Type.Visit(this); } if (vdpn.Annotations != null) { vdpn.Annotations.Visit(this); } return(vdpn); }