Search in sources :

Example 1 with SubSubSection

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

the class Translator method visitSubsubsection.

@Override
public OutputModelObject visitSubsubsection(BookishParser.SubsubsectionContext ctx) {
    String title = ctx.sec.getText();
    title = title.substring(title.indexOf(' ') + 1).trim();
    Pair<String, String> results = splitSectionTitle(title);
    title = results.a;
    String anchor = results.b;
    EntityDef def = null;
    if (anchor != null) {
        def = document.getEntity(anchor);
        if (def == null) {
            System.err.printf("line %d: Unknown label '%s'\n", ctx.start.getLine(), anchor);
        }
    }
    Join sec = (Join) visitSection_content(ctx.section_content());
    return new SubSubSection(def, title, anchor, sec != null ? sec.elements : null);
}
Also used : Join(us.parr.bookish.model.Join) SubSubSection(us.parr.bookish.model.SubSubSection) EntityDef(us.parr.bookish.model.entity.EntityDef)

Aggregations

Join (us.parr.bookish.model.Join)1 SubSubSection (us.parr.bookish.model.SubSubSection)1 EntityDef (us.parr.bookish.model.entity.EntityDef)1