Search in sources :

Example 1 with SideQuote

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

the class Translator method visitSidequote.

@Override
public OutputModelObject visitSidequote(BookishParser.SidequoteContext ctx) {
    String label = null;
    EntityDef def = null;
    if (ctx.REF() != null) {
        label = stripQuotes(ctx.REF().getText());
        def = document.getEntity(label);
        if (def == null) {
            System.err.printf("line %d: Unknown label '%s'\n", ctx.start.getLine(), label);
        }
    }
    SideQuote q = new SideQuote(def, label, (TextBlock) visit(ctx.q), (TextBlock) visit(ctx.a));
    if (def != null) {
        def.model = q;
    }
    if (label == null) {
        // if no label, insert inline here
        return q;
    }
    return null;
}
Also used : SideQuote(us.parr.bookish.model.SideQuote) EntityDef(us.parr.bookish.model.entity.EntityDef)

Aggregations

SideQuote (us.parr.bookish.model.SideQuote)1 EntityDef (us.parr.bookish.model.entity.EntityDef)1