Exemple #1
0
        private static SyntaxNode ForEachStatement(RParser.ForEachStatementContext forStatement, Func <ParserRuleContext, Scope, SyntaxNode> transform, Scope scope)
        {
            if (!topLevel(forStatement))
            {
                throw new NotImplementedException();
            }

            var exprs = forStatement.expr();
            var array = (ExpressionSyntax)transform(exprs[0], scope);
            var body  = parseBlock(exprs[1], transform, scope);

            return(@foreach.Get <ForEachStatementSyntax>(forStatement.ID().ToString(), array)
                   .WithStatement(body));
        }
Exemple #2
0
 /// <summary>
 /// Exit a parse tree produced by <see cref="RParser.ForEachStatement"/>.
 /// <para>The default implementation does nothing.</para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 public virtual void ExitForEachStatement([NotNull] RParser.ForEachStatementContext context)
 {
 }