public override CSharpSyntaxNode VisitSet([NotNull] DonatelloParser.SetContext context) { var children = context.form(); var arguments = children .Select(child => Argument(Visit(child) as ExpressionSyntax)) .ToArray(); return(InvocationExpression( MemberAccessExpression( SyntaxKind.SimpleMemberAccessExpression, IdentifierName(nameof(ImmutableHashSet)), IdentifierName(nameof(ImmutableHashSet.Create)))) .WithArgumentList(ArgumentList(SeparatedList(arguments)))); }
/// <summary> /// Exit a parse tree produced by <see cref="DonatelloParser.set"/>. /// <para>The default implementation does nothing.</para> /// </summary> /// <param name="context">The parse tree.</param> public virtual void ExitSet([NotNull] DonatelloParser.SetContext context) { }
/// <summary> /// Visit a parse tree produced by <see cref="DonatelloParser.set"/>. /// <para> /// The default implementation returns the result of calling <see cref="AbstractParseTreeVisitor{Result}.VisitChildren(IRuleNode)"/> /// on <paramref name="context"/>. /// </para> /// </summary> /// <param name="context">The parse tree.</param> /// <return>The visitor result.</return> public virtual Result VisitSet([NotNull] DonatelloParser.SetContext context) { return(VisitChildren(context)); }