// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) using System; using System.Collections.Generic; namespace PascalABCCompiler.TreeRealization { [Serializable] public class attribute_node : semantic_node, SemanticTree.IAttributeNode, SemanticTree.ILocated { private function_node _attr_constr; private type_node _attr_type; private List _args = new List(); private List _prop_names = new List(); private List _prop_initializers = new List(); private List _field_names = new List(); private List _field_initializers = new List(); private location _loc; private SemanticTree.attribute_qualifier_kind _qualifier; public attribute_node(function_node _attr_constr, type_node _attr_type, location _loc) { this._attr_constr = _attr_constr; this._attr_type = _attr_type; this._loc = _loc; } public type_node attribute_type { get { return _attr_type; } set { _attr_type = value; } } public SemanticTree.attribute_qualifier_kind qualifier { get { return _qualifier; } set { _qualifier = value; } } public function_node attribute_constr { get { return _attr_constr; } set { _attr_constr = value; } } public List args { get { return _args; } } public List prop_names { get { return _prop_names; } } public List prop_initializers { get { return _prop_initializers; } } public List field_names { get { return _field_names; } } public List field_initializers { get { return _field_initializers; } } public SemanticTree.IConstantNode[] Arguments { get { return _args.ToArray(); } } public SemanticTree.IPropertyNode[] PropertyNames { get { return _prop_names.ToArray(); } } public SemanticTree.IConstantNode[] PropertyInitializers { get { return _prop_initializers.ToArray(); } } public SemanticTree.IVAriableDefinitionNode[] FieldNames { get { return _field_names.ToArray(); } } public SemanticTree.IConstantNode[] FieldInitializers { get { return _field_initializers.ToArray(); } } public SemanticTree.ITypeNode AttributeType { get { return _attr_type; } } public SemanticTree.IFunctionNode AttributeConstructor { get { return _attr_constr; } } public location location { get { return _loc; } set { _loc=value; } } SemanticTree.ILocation SemanticTree.ILocated.Location { get { return _loc; } } public override general_node_type general_node_type { get { return general_node_type.attribute_node; } } public override semantic_node_type semantic_node_type { get { return semantic_node_type.attribute_node; } } public override void visit(PascalABCCompiler.SemanticTree.ISemanticVisitor visitor) { visitor.visit(this); } } }