Exemplo n.º 1
0
 public virtual Expression VisitNamedArgument(NamedArgument namedArgument)
 {
     if (namedArgument == null) return null;
     namedArgument.Value = this.VisitExpression(namedArgument.Value);
     return namedArgument;
 }
Exemplo n.º 2
0
 private void WriteAssignment(NamedArgument assignment) {
     string name = assignment.Name.Name;
     Literal value = (Literal)assignment.Value;
     writer.WriteStartElement("assignment");
     WriteStringAttribute("name", name);
     WriteLiteral(value);
     writer.WriteEndElement();
 }
Exemplo n.º 3
0
 public override Expression VisitNamedArgument(NamedArgument namedArgument)
 {
     if (namedArgument == null) return null;
     return base.VisitNamedArgument((NamedArgument)namedArgument.Clone());
 }
Exemplo n.º 4
0
 private void ParseAttributeArguments(AttributeNode attr, TokenSet followers){
   if (this.currentToken != Token.LeftParenthesis) return;
   SourceContext sctx = this.scanner.CurrentSourceContext;
   if (this.sink != null) this.sink.StartParameters(sctx);
   this.GetNextToken();
   ExpressionList expressions = attr.Expressions = new ExpressionList();
   bool hadNamedArgument = false;
   while (this.currentToken != Token.RightParenthesis){
     SourceContext sctx1 = this.scanner.CurrentSourceContext;
     Expression expr = this.ParseExpression(followers|Token.Comma|Token.RightParenthesis);
     if (expr != null){
       if (this.sink != null) {
         sctx1.EndPos = this.scanner.endPos;
         this.sink.NextParameter(sctx1);
       }
       AssignmentExpression aExpr = expr as AssignmentExpression;
       if (aExpr != null){
         AssignmentStatement aStat = (AssignmentStatement)aExpr.AssignmentStatement;
         Identifier id = aStat.Target as Identifier;
         if (id == null){
           this.HandleError(aStat.Target.SourceContext, Error.ExpectedIdentifier);
           expr = null;
         }else
           expr = new NamedArgument(id, aStat.Source, expr.SourceContext);
         hadNamedArgument = true;
       }else if (hadNamedArgument)
         this.HandleError(expr.SourceContext, Error.NamedArgumentExpected);
     }
     expressions.Add(expr);
     if (this.currentToken != Token.Comma) break;
     this.GetNextToken();
   }
   attr.SourceContext.EndPos = this.scanner.endPos;
   if (this.sink != null && this.currentToken != Token.EndOfFile) this.sink.EndParameters(this.scanner.CurrentSourceContext);
   this.ParseBracket(sctx, Token.RightParenthesis, followers, Error.ExpectedRightParenthesis);
 }
Exemplo n.º 5
0
 public override Expression VisitNamedArgument(NamedArgument namedArgument)
 {
     throw new NotImplementedException("Node type not yet supported");
 }
Exemplo n.º 6
0
 public EventingVisitor(Action<NamedArgument> visitNamedArgument) { VisitedNamedArgument += visitNamedArgument; } public event Action<NamedArgument> VisitedNamedArgument; public override Expression VisitNamedArgument(NamedArgument namedArgument) { if (VisitedNamedArgument != null) VisitedNamedArgument(namedArgument); return base.VisitNamedArgument(namedArgument); }