override public object Clone()
        {
            StatementTypeMember clone = (StatementTypeMember)FormatterServices.GetUninitializedObject(typeof(StatementTypeMember));

            clone._lexicalInfo       = _lexicalInfo;
            clone._endSourceLocation = _endSourceLocation;
            clone._documentation     = _documentation;
            clone._entity            = _entity;
            if (_annotations != null)
            {
                clone._annotations = (Hashtable)_annotations.Clone();
            }

            clone._modifiers = _modifiers;
            clone._name      = _name;
            if (null != _attributes)
            {
                clone._attributes = _attributes.Clone() as AttributeCollection;
                clone._attributes.InitializeParent(clone);
            }
            if (null != _statement)
            {
                clone._statement = _statement.Clone() as Statement;
                clone._statement.InitializeParent(clone);
            }
            return(clone);
        }
        override public object Clone()
        {
            StatementTypeMember clone = new StatementTypeMember();

            clone._lexicalInfo       = _lexicalInfo;
            clone._endSourceLocation = _endSourceLocation;
            clone._documentation     = _documentation;
            clone._isSynthetic       = _isSynthetic;
            clone._entity            = _entity;
            if (_annotations != null)
            {
                clone._annotations = (Hashtable)_annotations.Clone();
            }
            clone._modifiers = _modifiers;
            clone._name      = _name;
            if (null != _attributes)
            {
                clone._attributes = _attributes.Clone() as AttributeCollection;
                clone._attributes.InitializeParent(clone);
            }
            if (null != _statement)
            {
                clone._statement = _statement.Clone() as Statement;
                clone._statement.InitializeParent(clone);
            }
            return(clone);
        }
Esempio n. 3
0
        private void ProcessStatementTypeMemberInitializer(ClassDefinition node, StatementTypeMember statementTypeMember)
        {
            var stmt = statementTypeMember.Statement;

            var initializer = GetInitializerFor(node, node.IsStatic);
            initializer.Body.Add(stmt);

            var entity = (InternalMethod) GetEntity(initializer);
            ProcessNodeInMethodContext(entity, entity, stmt);

            node.Members.Remove(statementTypeMember);
        }
Esempio n. 4
0
 public override void OnStatementTypeMember(StatementTypeMember node)
 {
     // statement type members are later
     // processed as initializers
 }
Esempio n. 5
0
	protected TypeMember  member_macro() //throws RecognitionException, TokenStreamException
{
		TypeMember result;
		
		
			MacroStatement s = null;
			result = null;
		
		
		try {      // for error handling
			s=macro_stmt();
			if (0==inputState.guessing)
			{
				
						result = new StatementTypeMember(s);
						result.Modifiers = _modifiers;
						AddAttributes(result.Attributes);
					
			}
		}
		catch (RecognitionException ex)
		{
			if (0 == inputState.guessing)
			{
				reportError(ex, "member_macro");
				recover(ex,tokenSet_55_);
			}
			else
			{
				throw ex;
			}
		}
		return result;
	}
Esempio n. 6
0
		override public object Clone()
		{
		
			StatementTypeMember clone = new StatementTypeMember();
			clone._lexicalInfo = _lexicalInfo;
			clone._endSourceLocation = _endSourceLocation;
			clone._documentation = _documentation;
			clone._isSynthetic = _isSynthetic;
			clone._entity = _entity;
			if (_annotations != null) clone._annotations = (Hashtable)_annotations.Clone();
			clone._modifiers = _modifiers;
			clone._name = _name;
			if (null != _attributes)
			{
				clone._attributes = _attributes.Clone() as AttributeCollection;
				clone._attributes.InitializeParent(clone);
			}
			if (null != _statement)
			{
				clone._statement = _statement.Clone() as Statement;
				clone._statement.InitializeParent(clone);
			}
			return clone;


		}
Esempio n. 7
0
		public NodeGeneratorExpander(MacroStatement node)
		{
			_node = node;
			_typeMemberPrototype = node.ParentNode as StatementTypeMember;
		}
Esempio n. 8
0
 public NodeGeneratorExpander(MacroStatement node, bool addTypeMembersToEnclosingTypeDefinition)
 {
     _node = node;
     _addTypeMembersToEnclosingTypeDefinition = addTypeMembersToEnclosingTypeDefinition;
     _typeMemberPrototype = node.ParentNode as StatementTypeMember;
 }
Esempio n. 9
0
 public override void LeaveStatementTypeMember(StatementTypeMember node)
 {
     if (node.Statement == null)
         RemoveCurrentNode();
 }