Search in sources :

Example 1 with PreAbstract

use of us.parr.bookish.model.PreAbstract in project bookish by parrt.

the class Translator method visitPreabstract.

@Override
public OutputModelObject visitPreabstract(BookishParser.PreabstractContext ctx) {
    List<OutputModelObject> paras = new ArrayList<>();
    paras.add(visit(ctx.paragraph_optional_blank_line()));
    for (ParseTree p : ctx.paragraph()) {
        Paragraph para = (Paragraph) visit(p);
        paras.add(para);
    }
    return new PreAbstract(paras);
}
Also used : OutputModelObject(us.parr.bookish.model.OutputModelObject) PreAbstract(us.parr.bookish.model.PreAbstract) ArrayList(java.util.ArrayList) ParseTree(org.antlr.v4.runtime.tree.ParseTree) Paragraph(us.parr.bookish.model.Paragraph)

Aggregations

ArrayList (java.util.ArrayList)1 ParseTree (org.antlr.v4.runtime.tree.ParseTree)1 OutputModelObject (us.parr.bookish.model.OutputModelObject)1 Paragraph (us.parr.bookish.model.Paragraph)1 PreAbstract (us.parr.bookish.model.PreAbstract)1