Search in sources :

Example 1 with Abstract

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

the class Translator method visitAbstract_.

@Override
public OutputModelObject visitAbstract_(BookishParser.Abstract_Context 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 Abstract(paras);
}
Also used : OutputModelObject(us.parr.bookish.model.OutputModelObject) Abstract(us.parr.bookish.model.Abstract) 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 Abstract (us.parr.bookish.model.Abstract)1 OutputModelObject (us.parr.bookish.model.OutputModelObject)1 Paragraph (us.parr.bookish.model.Paragraph)1 PreAbstract (us.parr.bookish.model.PreAbstract)1