Exemplo n.º 1
0
 internal protected virtual void Walk(SimpleAssignmentExpression /*!*/ node)
 {
     if (Enter(node))
     {
         node.Left.Walk(this);
         node.Right.Walk(this);
     }
     Exit(node);
 }
Exemplo n.º 2
0
        public Parameters(LeftValue/*!*/[] mandatory, int leadingMandatoryCount, SimpleAssignmentExpression/*!*/[] optional, LeftValue unsplat, LocalVariable block, SourceSpan location)
            : base(location) {

            mandatory = mandatory ?? LeftValue.EmptyArray;
            optional = optional ?? SimpleAssignmentExpression.EmptyArray;

            Debug.Assert(leadingMandatoryCount >= 0 && leadingMandatoryCount <= mandatory.Length);
            Debug.Assert(leadingMandatoryCount == mandatory.Length || optional != null || unsplat != null);

            _mandatory = mandatory;
            _leadingMandatoryCount = leadingMandatoryCount;
            _optional = optional;
            _unsplat = unsplat;
            _block = block;
        }
Exemplo n.º 3
0
		void WalkSimpleAssignment(SimpleAssignmentExpression node)
		{
			AttributeAccess attributeAccess = node.Left as AttributeAccess;
			InstanceVariable instance = node.Left as InstanceVariable;
			LocalVariable localVariable = node.Left as LocalVariable;
			if (attributeAccess != null) {
				RubyControlFieldExpression field = RubyControlFieldExpression.Create(attributeAccess);
				object propertyValue = deserializer.Deserialize(node.Right);
				if (propertyValue != null) {
					field.SetPropertyValue(componentCreator, propertyValue);
				} else if (IsResource(node.Right)) {
					field.SetPropertyValue(componentCreator, GetResource(node.Right as MethodCall));
				} else {
					ThrowCouldNotFindTypeException(node.Right);
				}
			} else if (instance != null) {
				string instanceName = RubyControlFieldExpression.GetVariableName(instance.Name);
				object propertyValue = deserializer.Deserialize(instanceName, node.Right);
				AddComponent(instanceName, propertyValue);
			} else if (localVariable != null) {
				object propertyValue = deserializer.Deserialize(localVariable.Name, node.Right);
				if (propertyValue == null) {
					ThrowCouldNotFindTypeException(node.Right);
				}
			}
		}
Exemplo n.º 4
0
 public virtual void Exit(SimpleAssignmentExpression/*!*/ node) { }
Exemplo n.º 5
0
 public virtual bool Enter(SimpleAssignmentExpression/*!*/ node) { return true; }
Exemplo n.º 6
0
 public virtual void Exit(SimpleAssignmentExpression /*!*/ node)
 {
 }
Exemplo n.º 7
0
 public virtual bool Enter(SimpleAssignmentExpression /*!*/ node)
 {
     return(true);
 }