use of us.parr.bookish.model.SideNote in project bookish by parrt.
the class Translator method visitSidenote.
@Override
public OutputModelObject visitSidenote(BookishParser.SidenoteContext 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);
}
}
SideNote q = new SideNote(def, label, (TextBlock) visit(ctx.block));
if (def != null) {
def.model = q;
}
if (label == null) {
// if no label, insert inline here
return q;
}
return null;
}