Search in sources :

Example 1 with Citation

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

the class Translator method visitCitation.

@Override
public OutputModelObject visitCitation(BookishParser.CitationContext 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);
            return null;
        }
    }
    def.model = new Citation(def, label, (TextBlock) visit(ctx.t), (TextBlock) visit(ctx.a));
    return null;
}
Also used : Citation(us.parr.bookish.model.Citation) TextBlock(us.parr.bookish.model.TextBlock) EntityDef(us.parr.bookish.model.entity.EntityDef)

Aggregations

Citation (us.parr.bookish.model.Citation)1 TextBlock (us.parr.bookish.model.TextBlock)1 EntityDef (us.parr.bookish.model.entity.EntityDef)1