public override void PropagateChanges(MethodInvocationExpression eval, List chain)
 {
     ExpressionCollection expressions = new ExpressionCollection();
     foreach (object local1 in chain.Reversed)
     {
         if (!(local1 is ProcessAssignmentsToSpecialMembers.ChainItem))
         {
         }
         ProcessAssignmentsToSpecialMembers.ChainItem item = (ProcessAssignmentsToSpecialMembers.ChainItem) RuntimeServices.Coerce(local1, typeof(ProcessAssignmentsToSpecialMembers.ChainItem));
         if (item.Container is MethodInvocationExpression)
         {
             break;
         }
         if (item.Container is SlicingExpression)
         {
             SlicingExpression expression = item.Container;
             Expression[] expressionArray1 = new Expression[] { expression.get_Target().CloneNode(), expression.get_Indices().get_Item(0).get_Begin().CloneNode(), this.get_CodeBuilder().CreateReference(item.Local) };
             expressions.Add(this.CreateConstructorInvocation(this._sliceValueTypeChangeConstructor, expressionArray1));
             break;
         }
         MemberReferenceExpression container = item.Container;
         Expression[] args = new Expression[] { container.get_Target().CloneNode(), this.get_CodeBuilder().CreateStringLiteral(container.get_Name()), this.get_CodeBuilder().CreateReference(item.Local) };
         expressions.Add(this.CreateConstructorInvocation(this._valueTypeChangeConstructor, args));
     }
     MethodInvocationExpression expression3 = this.get_CodeBuilder().CreateMethodInvocation(this._propagateChanges);
     IArrayType type = this._valueTypeChangeType.MakeArrayType(1);
     expression3.get_Arguments().Add(this.get_CodeBuilder().CreateArray(type, expressions));
     eval.get_Arguments().Add(expression3);
 }
Exemple #2
0
 void ConvertExpressions(IEnumerable input, B.ExpressionCollection output)
 {
     foreach (Expression e in input)
     {
         B.Expression expr = ConvertExpression(e);
         if (expr != null)
         {
             output.Add(expr);
         }
     }
 }
Exemple #3
0
        private IEntity ResolveAmbiguousLValue(Expression sourceNode, Ambiguous candidates, Expression rvalue)
        {
            if (!candidates.AllEntitiesAre(EntityType.Property)) return null;

            IEntity[] entities = candidates.Entities;
            IEntity[] getters = GetSetMethods(entities);
            ExpressionCollection args = new ExpressionCollection();
            args.Add(rvalue);
            IEntity found = GetCorrectCallableReference(sourceNode, args, getters);
            if (null != found && EntityType.Method == found.EntityType)
            {
                IProperty property = (IProperty)entities[GetIndex(getters, found)];
                BindProperty(sourceNode, property);
                return property;
            }
            return null;
        }
Exemple #4
0
	protected void expression_list(
		ExpressionCollection ec
	) //throws RecognitionException, TokenStreamException
{
		
		
				Expression e = null;
			
		
		try {      // for error handling
			{
				switch ( LA(1) )
				{
				case ESEPARATOR:
				case CAST:
				case CHAR:
				case FALSE:
				case NOT:
				case NULL:
				case SELF:
				case SUPER:
				case THEN:
				case TRUE:
				case TYPEOF:
				case TRIPLE_QUOTED_STRING:
				case LPAREN:
				case DOUBLE_QUOTED_STRING:
				case SINGLE_QUOTED_STRING:
				case ID:
				case MULTIPLY:
				case LBRACK:
				case SPLICE_BEGIN:
				case DOT:
				case LBRACE:
				case QQ_BEGIN:
				case SUBTRACT:
				case LONG:
				case INCREMENT:
				case DECREMENT:
				case ONES_COMPLEMENT:
				case INT:
				case BACKTICK_QUOTED_STRING:
				case RE_LITERAL:
				case DOUBLE:
				case FLOAT:
				case TIMESPAN:
				{
					e=expression();
					if (0==inputState.guessing)
					{
						ec.Add(e);
					}
					{    // ( ... )*
						for (;;)
						{
							if ((LA(1)==COMMA))
							{
								match(COMMA);
								e=expression();
								if (0==inputState.guessing)
								{
									if (e != null) ec.Add(e);
								}
							}
							else
							{
								goto _loop653_breakloop;
							}
							
						}
_loop653_breakloop:						;
					}    // ( ... )*
					break;
				}
				case EOL:
				case IF:
				case UNLESS:
				case WHILE:
				case EOS:
				case RPAREN:
				case COLON:
				case RBRACE:
				case QQ_END:
				{
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				 }
			}
		}
		catch (RecognitionException ex)
		{
			if (0 == inputState.guessing)
			{
				reportError(ex, "expression_list");
				recover(ex,tokenSet_29_);
			}
			else
			{
				throw ex;
			}
		}
	}
Exemple #5
0
	protected void list_items(
		ExpressionCollection items
	) //throws RecognitionException, TokenStreamException
{
		
		
				Expression item = null;
			
		
		try {      // for error handling
			{
				switch ( LA(1) )
				{
				case ESEPARATOR:
				case CAST:
				case CHAR:
				case FALSE:
				case NOT:
				case NULL:
				case SELF:
				case SUPER:
				case THEN:
				case TRUE:
				case TYPEOF:
				case TRIPLE_QUOTED_STRING:
				case LPAREN:
				case DOUBLE_QUOTED_STRING:
				case SINGLE_QUOTED_STRING:
				case ID:
				case MULTIPLY:
				case LBRACK:
				case SPLICE_BEGIN:
				case DOT:
				case LBRACE:
				case QQ_BEGIN:
				case SUBTRACT:
				case LONG:
				case INCREMENT:
				case DECREMENT:
				case ONES_COMPLEMENT:
				case INT:
				case BACKTICK_QUOTED_STRING:
				case RE_LITERAL:
				case DOUBLE:
				case FLOAT:
				case TIMESPAN:
				{
					item=expression();
					if (0==inputState.guessing)
					{
						items.Add(item);
					}
					{
						{    // ( ... )*
							for (;;)
							{
								if ((LA(1)==COMMA) && (tokenSet_5_.member(LA(2))))
								{
									match(COMMA);
									item=expression();
									if (0==inputState.guessing)
									{
										items.Add(item);
									}
								}
								else
								{
									goto _loop634_breakloop;
								}
								
							}
_loop634_breakloop:							;
						}    // ( ... )*
					}
					{
						switch ( LA(1) )
						{
						case COMMA:
						{
							match(COMMA);
							break;
						}
						case RBRACK:
						case RBRACE:
						{
							break;
						}
						default:
						{
							throw new NoViableAltException(LT(1), getFilename());
						}
						 }
					}
					break;
				}
				case RBRACK:
				case RBRACE:
				{
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				 }
			}
		}
		catch (RecognitionException ex)
		{
			if (0 == inputState.guessing)
			{
				reportError(ex, "list_items");
				recover(ex,tokenSet_129_);
			}
			else
			{
				throw ex;
			}
		}
	}
 public void expression_list(ExpressionCollection ec)
 {
     try
     {
         if (tokenSet_16_.member(this.LA(1)) && tokenSet_17_.member(this.LA(2)))
         {
             Expression expression = this.expression();
             if (base.inputState.guessing == 0)
             {
                 ec.Add(expression);
             }
             while (this.LA(1) == 0x43)
             {
                 this.match(0x43);
                 expression = this.expression();
                 if (base.inputState.guessing == 0)
                 {
                     ec.Add(expression);
                 }
             }
         }
         else if ((((this.LA(1) != 0x3d) && (this.LA(1) != 0x40)) && (this.LA(1) != 0x45)) || !tokenSet_20_.member(this.LA(2)))
         {
             throw new NoViableAltException(this.LT(1), this.getFilename());
         }
     }
     catch (RecognitionException exception)
     {
         if (base.inputState.guessing != 0)
         {
             throw;
         }
         this.reportError(exception);
         this.recover(exception, tokenSet_52_);
     }
 }