상속: ICSharpCode.NRefactory.Ast.Expression
예제 #1
0
 public override object VisitNamedArgumentExpression(NamedArgumentExpression namedArgumentExpression, object data)
 {
     var expression = namedArgumentExpression.Expression as MemberReferenceExpression;
     if (expression == null)
         return base.VisitNamedArgumentExpression(namedArgumentExpression, data);
     var identifierExpression = expression.TargetObject as IdentifierExpression;
     if (identifierExpression == null || identifierExpression.Identifier != identifier)
         return base.VisitNamedArgumentExpression(namedArgumentExpression, data);
     var right = new InvocationExpression(new MemberReferenceExpression(namedArgumentExpression.Expression, "Unwrap"))
     {
         Parent = namedArgumentExpression.Expression.Parent
     };
     namedArgumentExpression.Expression.Parent = right;
     namedArgumentExpression.Expression = right;
     return base.VisitNamedArgumentExpression(namedArgumentExpression, data);
 }
예제 #2
0
파일: Parser.cs 프로젝트: almazik/ILSpy
	void Argument(
#line  1933 "VBNET.ATG" 
out Expression argumentexpr) {

#line  1935 "VBNET.ATG" 
		Expression expr;
		argumentexpr = null;
		string name;
		
		if (
#line  1939 "VBNET.ATG" 
IsNamedAssign()) {
			Identifier();

#line  1939 "VBNET.ATG" 
			name = t.val;  
			Expect(13);
			Expect(11);
			Expr(
#line  1939 "VBNET.ATG" 
out expr);

#line  1941 "VBNET.ATG" 
			argumentexpr = new NamedArgumentExpression(name, expr);
			
		} else if (StartOf(27)) {
			Expr(
#line  1944 "VBNET.ATG" 
out argumentexpr);
		} else SynErr(249);
	}
    private static AttributeSection CreateAreaAttributeCode(string attributeName, string argumentName, Expression valueExpression)
    {
      NamedArgumentExpression argument = new NamedArgumentExpression(argumentName, valueExpression);
	  Attribute attribute = new Attribute(attributeName, new List<Expression>(), new List<NamedArgumentExpression>());
      attribute.NamedArguments.Add(argument);
	  AttributeSection attributeSection = new AttributeSection("IDontKnow", new List<Attribute>());
      attributeSection.Attributes.Add(attribute);
      return attributeSection;
    }
		public object VisitNamedArgumentExpression(NamedArgumentExpression namedArgumentExpression, object data)
		{
			AddError(namedArgumentExpression, "Named arguments are not supported in boo. (argument name was " + namedArgumentExpression.Name + ")");
			return namedArgumentExpression.Expression.AcceptVisitor(this, data);
		}
 public override object TrackedVisitNamedArgumentExpression(NamedArgumentExpression namedArgumentExpression, object data)
 {
     this.Append(namedArgumentExpression.Name);
     this.Append(" = ");
     namedArgumentExpression.Expression.AcceptVisitor(this, data);
     return null;
 }
		public virtual object TrackedVisitNamedArgumentExpression(NamedArgumentExpression namedArgumentExpression, object data) {
			return base.VisitNamedArgumentExpression(namedArgumentExpression, data);
		}
예제 #7
0
	void Argument(
#line  2379 "VBNET.ATG" 
out Expression argumentexpr) {

#line  2381 "VBNET.ATG" 
		Expression expr;
		argumentexpr = null;
		string name;
		
		if (
#line  2385 "VBNET.ATG" 
IsNamedAssign()) {
			Identifier();

#line  2385 "VBNET.ATG" 
			name = t.val;  
			Expect(11);
			Expect(10);
			Expr(
#line  2385 "VBNET.ATG" 
out expr);

#line  2387 "VBNET.ATG" 
			argumentexpr = new NamedArgumentExpression(name, expr);
			
		} else if (StartOf(29)) {
			Expr(
#line  2390 "VBNET.ATG" 
out argumentexpr);
		} else SynErr(267);
	}
예제 #8
0
	void AttributeArgument(
#line  276 "cs.ATG" 
List<Expression> positional, List<NamedArgumentExpression> named) {

#line  277 "cs.ATG" 
		string name = null; bool isNamed = false; Expression expr; Location startLocation = la.Location; 
		if (
#line  280 "cs.ATG" 
IsAssignment()) {

#line  280 "cs.ATG" 
			isNamed = true; 
			Identifier();

#line  281 "cs.ATG" 
			name = t.val; 
			Expect(3);
		} else if (
#line  284 "cs.ATG" 
IdentAndColon()) {
			Identifier();

#line  285 "cs.ATG" 
			name = t.val; 
			Expect(9);
		} else if (StartOf(6)) {
		} else SynErr(151);
		Expr(
#line  289 "cs.ATG" 
out expr);

#line  291 "cs.ATG" 
		if (expr != null) {
		if (isNamed) {
			named.Add(new NamedArgumentExpression(name, expr) { StartLocation = startLocation, EndLocation = t.EndLocation });
		} else {
			if (named.Count > 0)
				Error("positional argument after named argument is not allowed");
			if (name != null)
				expr = new NamedArgumentExpression(name, expr) { StartLocation = startLocation, EndLocation = t.EndLocation };
			positional.Add(expr);
		}
		}
		
	}
		public virtual object VisitNamedArgumentExpression(NamedArgumentExpression namedArgumentExpression, object data) {
			Debug.Assert((namedArgumentExpression != null));
			Debug.Assert((namedArgumentExpression.Expression != null));
			nodeStack.Push(namedArgumentExpression.Expression);
			namedArgumentExpression.Expression.AcceptVisitor(this, data);
			namedArgumentExpression.Expression = ((Expression)(nodeStack.Pop()));
			return null;
		}
예제 #10
0
 public virtual object VisitNamedArgumentExpression(NamedArgumentExpression namedArgumentExpression, object data)
 {
     Debug.Assert((namedArgumentExpression != null));
     Debug.Assert((namedArgumentExpression.Expression != null));
     return namedArgumentExpression.Expression.AcceptVisitor(this, data);
 }
 public object VisitNamedArgumentExpression(NamedArgumentExpression namedArgumentExpression, object data)
 {
     throw new NotImplementedException ();
 }
 public virtual bool VisitNamedArgumentExpression(NamedArgumentExpression namedArgumentExpression, object d)
 {
     if ((namedArgumentExpression == null)) {
         return SetFailure();
     }
     if ((d == null)) {
         return SetFailure();
     }
     if ((namedArgumentExpression.Expression == null)) {
         return SetFailure();
     }
     if(namedArgumentExpression.GetType() != d.GetType()) {return SetFailure();}
     var data = (NamedArgumentExpression)d;
     if (!IsMatch(namedArgumentExpression, data)) {
         return SetFailure();
     }
     return namedArgumentExpression.Expression.AcceptVisitor(this, data.Expression);
 }
예제 #13
0
		public override object VisitNamedArgumentExpression(NamedArgumentExpression namedArgumentExpression, object data)
		{
			return base.VisitNamedArgumentExpression(namedArgumentExpression, data);
		}
 private bool IsMatch(NamedArgumentExpression left, NamedArgumentExpression data)
 {
     return left.Name == data.Name;
 }
		private static AttributeSection CreateControllerAttributeCode(string attributeName, string argumentName, Expression valueExpression)
		{
			var argument = new NamedArgumentExpression(argumentName, valueExpression);
			
			var attribute = new Attribute(attributeName, new List<Expression>(), new List<NamedArgumentExpression>());
			attribute.NamedArguments.Add(argument);
			
			var attributeSection = new AttributeSection();
			attributeSection.Attributes.Add(attribute);
			
			return attributeSection;
		}
예제 #16
0
 public virtual object VisitNamedArgumentExpression(NamedArgumentExpression namedArgumentExpression, object data) {
     throw CreateException(namedArgumentExpression);
 }
예제 #17
0
	void Argument(
#line  1403 "cs.ATG" 
out Expression argumentexpr) {

#line  1404 "cs.ATG" 
		argumentexpr = null; 
		if (
#line  1406 "cs.ATG" 
IdentAndColon()) {

#line  1407 "cs.ATG" 
			Token ident; Expression expr; 
			Identifier();

#line  1408 "cs.ATG" 
			ident = t; 
			Expect(9);
			ArgumentValue(
#line  1410 "cs.ATG" 
out expr);

#line  1411 "cs.ATG" 
			argumentexpr = new NamedArgumentExpression(ident.val, expr) { StartLocation = ident.Location, EndLocation = t.EndLocation }; 
		} else if (StartOf(25)) {
			ArgumentValue(
#line  1413 "cs.ATG" 
out argumentexpr);
		} else SynErr(194);
	}
예제 #18
0
	void ObjectPropertyInitializerOrVariableInitializer(
#line  1459 "Frames/cs.ATG" 
out Expression expr) {

#line  1460 "Frames/cs.ATG" 
		expr = null; 
		if (
#line  1462 "Frames/cs.ATG" 
IdentAndAsgn()) {
			Identifier();

#line  1464 "Frames/cs.ATG" 
			NamedArgumentExpression nae = new NamedArgumentExpression(t.val, null);
			nae.StartLocation = t.Location;
			Expression r = null; 
			Expect(3);
			if (la.kind == 16) {
				CollectionOrObjectInitializer(
#line  1468 "Frames/cs.ATG" 
out r);
			} else if (StartOf(31)) {
				VariableInitializer(
#line  1469 "Frames/cs.ATG" 
out r);
			} else SynErr(195);

#line  1470 "Frames/cs.ATG" 
			nae.Expression = r; nae.EndLocation = t.EndLocation; expr = nae; 
		} else if (StartOf(31)) {
			VariableInitializer(
#line  1472 "Frames/cs.ATG" 
out expr);
		} else SynErr(196);
	}
예제 #19
0
	void MemberInitializer(
#line  2324 "VBNET.ATG" 
out NamedArgumentExpression memberInitializer) {

#line  2326 "VBNET.ATG" 
		memberInitializer = new NamedArgumentExpression();
		memberInitializer.StartLocation = la.Location;
		Expression initExpr = null;
		string name = null;
		
		Expect(16);
		IdentifierOrKeyword(
#line  2331 "VBNET.ATG" 
out name);
		Expect(10);
		Expr(
#line  2331 "VBNET.ATG" 
out initExpr);

#line  2333 "VBNET.ATG" 
		memberInitializer.Name = name;
		memberInitializer.Expression = initExpr;
		memberInitializer.EndLocation = t.EndLocation;
		
	}
예제 #20
0
		public override object VisitNamedArgumentExpression (NamedArgumentExpression expr, object data)
		{
			return expr.Expression.AcceptVisitor (this, data);
		}
예제 #21
0
		public virtual object VisitNamedArgumentExpression(NamedArgumentExpression namedArgumentExpression, object data) {
			throw new global::System.NotImplementedException("NamedArgumentExpression");
		}
예제 #22
0
	void Argument(
//#line  1383 "cs.ATG" 
out Expression argumentexpr) {

//#line  1384 "cs.ATG" 
		argumentexpr = null; 
		if (
//#line  1386 "cs.ATG" 
IdentAndColon()) {

//#line  1387 "cs.ATG" 
			Token ident; Expression expr; 
			Identifier();

//#line  1388 "cs.ATG" 
			ident = t; 
			Expect(9);
			ArgumentValue(
//#line  1390 "cs.ATG" 
out expr);

//#line  1391 "cs.ATG" 
			argumentexpr = new NamedArgumentExpression(ident.val, expr) { StartLocation = ident.Location, EndLocation = t.EndLocation }; 
		} else if (StartOf(25)) {
			ArgumentValue(
//#line  1393 "cs.ATG" 
out argumentexpr);
		} else SynErr(192);
	}
		public sealed override object VisitNamedArgumentExpression(NamedArgumentExpression namedArgumentExpression, object data) {
			this.BeginVisit(namedArgumentExpression);
			object result = this.TrackedVisitNamedArgumentExpression(namedArgumentExpression, data);
			this.EndVisit(namedArgumentExpression);
			return result;
		}
예제 #24
0
	void AttributeArgument(
//#line  274 "cs.ATG" 
List<Expression> positional, List<NamedArgumentExpression> named) {

//#line  275 "cs.ATG" 
		string name = null; bool isNamed = false; Expression expr; 
		if (
//#line  278 "cs.ATG" 
IsAssignment()) {

//#line  278 "cs.ATG" 
			isNamed = true; 
			Identifier();

//#line  279 "cs.ATG" 
			name = t.val; 
			Expect(3);
		} else if (
//#line  282 "cs.ATG" 
IdentAndColon()) {
			Identifier();

//#line  283 "cs.ATG" 
			name = t.val; 
			Expect(9);
		} else if (StartOf(6)) {
		} else SynErr(149);
		Expr(
//#line  287 "cs.ATG" 
out expr);

//#line  289 "cs.ATG" 
		if (expr != null) {
		if (isNamed) {
			named.Add(new NamedArgumentExpression(name, expr));
		} else {
			if (named.Count > 0)
				Error("positional argument after named argument is not allowed");
			if (name != null)
				expr = new NamedArgumentExpression(name, expr);
			positional.Add(expr);
		}
		}
		
	}
예제 #25
0
파일: Parser.cs 프로젝트: Altaxo/Altaxo
	void Argument(
//#line  2678 "VBNET.ATG" 
out Expression argumentexpr) {

//#line  2680 "VBNET.ATG" 
		Expression expr;
		argumentexpr = null;
		string name;
		Location startLocation = la.Location;
		
		if (
//#line  2685 "VBNET.ATG" 
IsNamedAssign()) {
			Identifier();

//#line  2685 "VBNET.ATG" 
			name = t.val;  
			Expect(55);
			Expr(
//#line  2685 "VBNET.ATG" 
out expr);

//#line  2687 "VBNET.ATG" 
			argumentexpr = new NamedArgumentExpression(name, expr) { StartLocation = startLocation, EndLocation = t.EndLocation };
			
		} else if (StartOf(24)) {
			Expr(
//#line  2690 "VBNET.ATG" 
out argumentexpr);
		} else SynErr(308);
	}
예제 #26
0
	void Argument(
#line  2620 "VBNET.ATG" 
out Expression argumentexpr) {

#line  2622 "VBNET.ATG" 
		Expression expr;
		argumentexpr = null;
		string name;
		
		if (
#line  2626 "VBNET.ATG" 
IsNamedAssign()) {
			Identifier();

#line  2626 "VBNET.ATG" 
			name = t.val;  
			Expect(55);
			Expr(
#line  2626 "VBNET.ATG" 
out expr);

#line  2628 "VBNET.ATG" 
			argumentexpr = new NamedArgumentExpression(name, expr);
			
		} else if (StartOf(24)) {
			Expr(
#line  2631 "VBNET.ATG" 
out argumentexpr);
		} else SynErr(308);
	}