Search in sources :

Example 6 with BlockContent

use of ast.Expression.BlockContent in project L42 by ElvisResearchGroup.

the class ToAst method visitRoundBlockAux.

private Expression visitRoundBlockAux(ParserRuleContext ctx, DocsOptContext docsOpt, List<BbContext> bB, ETopContext eTop) {
    Doc doc = parseDoc(docsOpt);
    List<BlockContent> contents = new ArrayList<BlockContent>();
    for (BbContext b : bB) {
        List<VarDec> decs = new ArrayList<VarDec>();
        for (DContext d : b.d()) {
            decs.add(parseVDec(d));
        }
        assert b.ks() != null;
        List<Catch> _catch = parseKs(b.ks());
        contents.add(new BlockContent(decs, _catch));
    }
    Expression inner = eTop.accept(this);
    return new Expression.RoundBlock(position(ctx), doc, inner, contents);
}
Also used : Expression(ast.Expression) Catch(ast.Expression.Catch) VarDec(ast.Ast.VarDec) BlockContent(ast.Expression.BlockContent) Doc(ast.Ast.Doc)

Aggregations

BlockContent (ast.Expression.BlockContent)6 VarDec (ast.Ast.VarDec)5 Catch (ast.Expression.Catch)5 Expression (ast.Expression)4 RoundBlock (ast.Expression.RoundBlock)3 Doc (ast.Ast.Doc)2 Type (ast.Ast.Type)2 X (ast.Expression.X)2 ArrayList (java.util.ArrayList)2 VarDecE (ast.Ast.VarDecE)1 VarDecXE (ast.Ast.VarDecXE)1 MethodWithType (ast.Expression.ClassB.MethodWithType)1 CurlyBlock (ast.Expression.CurlyBlock)1 Loop (ast.Expression.Loop)1