gate.wiki.antlr
Class NOPTarget

java.lang.Object
  extended by gate.wiki.antlr.NOPTarget
All Implemented Interfaces:
YAMTarget
Direct Known Subclasses:
DBGTarget, HTMLTarget, LaTeXTarget, LoutTarget, XHTMLTarget

public class NOPTarget
extends Object
implements YAMTarget

This class represents the NOP translation and can be used to check syntax of your YAM input. More importantly, it is a useful superclass for translation targets because when I add features later the targets by default ignore these enhancements--avoiding the cost of modifying every target. The cost is a loss of compile-error when you don't implement a feature. Some useful support routines here. Using write/writeln is good because it buffers the last output string. For example, If you need to avoid generating a paragraph symbol after a list because it makes too much space, you can look back to see what you just generated.


Field Summary
protected  String lastCommand
           
protected  Writer out
           
 
Constructor Summary
NOPTarget()
           
 
Method Summary
 void anchor(String name)
           
 void begin_ol(int level)
           
 void begin_table()
           
 void begin_ul(int level)
           
 void begin()
          insert head.html if found
 String beginBF()
           
 String beginEM()
           
 void beginListItem(int level)
           
 void beginSection(String title, int level)
           
 void beginSectionList(int level)
           
 String beginTT()
           
 void blankline()
          They want a blank line without signaling a new paragraph.
 void blockquote(String q)
           
 void bold(String t)
           
 void box(YAMContext context, Vector args)
           
 void c(YAMContext context, Vector args)
           
 void cite(YAMContext context, Vector args)
          Former plugins
 void code(String c)
           
 void col()
           
 void contents()
           
 void date(YAMContext context, Vector args)
           
 void delete(YAMContext context, Vector args)
           
 void end_ol(int level)
           
 void end_table()
           
 void end_ul(int level)
           
 void end()
          insert tail.html if found
 String endBF()
           
 String endEM()
           
 void endListItem(int level)
           
 void endSection(int level)
           
 void endSectionList(int level)
           
 String endTT()
           
 void eps(YAMContext context, Vector args)
           
protected  String extractLastCommand(String text)
          Subclasses should implement this; i.e., pull out <...
 void footnote(YAMContext context, Vector args)
           
protected  String getLastOutputCommand()
           
 String getTargetLanguage()
          Typically "HTML", or "Lout"
 void hr()
           
 void image(YAMContext context, Vector args)
          Former plugins
 void include(YAMContext context, Vector args)
           
 void italic(String t)
           
 void linebreak()
          They want a new line in a paragraph
 void link(String url, String title)
           
 void longdash()
           
 void notes(YAMContext context, Vector args)
           
 void paragraph()
           
 void row()
           
 void syndiag(YAMContext context, Vector args)
           
 void text(String t)
           
 void title(String title)
           
 void tree(YAMContext context, Vector args)
           
 void tt(String t)
           
 void verbatim(String rawOutput)
          Assume rawOutput is in output language and just dump
 void wikilink(String url, String title)
           
protected  void write(String s)
           
protected  void writeln(String s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

out

protected Writer out

lastCommand

protected String lastCommand
Constructor Detail

NOPTarget

public NOPTarget()
Method Detail

getTargetLanguage

public String getTargetLanguage()
Description copied from interface: YAMTarget
Typically "HTML", or "Lout"

Specified by:
getTargetLanguage in interface YAMTarget

write

protected void write(String s)

writeln

protected void writeln(String s)

getLastOutputCommand

protected String getLastOutputCommand()

extractLastCommand

protected String extractLastCommand(String text)
Subclasses should implement this; i.e., pull out <...>or ID. Groovy because you get a list like this when you from say paragraph(): last cmd=[@Heading] last cmd=[@LP] last cmd=[@EndList] last cmd=[@Begin]


begin

public void begin()
insert head.html if found

Specified by:
begin in interface YAMTarget

end

public void end()
insert tail.html if found

Specified by:
end in interface YAMTarget

text

public void text(String t)
Specified by:
text in interface YAMTarget

bold

public void bold(String t)
Specified by:
bold in interface YAMTarget

italic

public void italic(String t)
Specified by:
italic in interface YAMTarget

tt

public void tt(String t)
Specified by:
tt in interface YAMTarget

begin_ul

public void begin_ul(int level)
Specified by:
begin_ul in interface YAMTarget

begin_ol

public void begin_ol(int level)
Specified by:
begin_ol in interface YAMTarget

end_ul

public void end_ul(int level)
Specified by:
end_ul in interface YAMTarget

end_ol

public void end_ol(int level)
Specified by:
end_ol in interface YAMTarget

beginListItem

public void beginListItem(int level)
Specified by:
beginListItem in interface YAMTarget

endListItem

public void endListItem(int level)
Specified by:
endListItem in interface YAMTarget

paragraph

public void paragraph()
Specified by:
paragraph in interface YAMTarget

linebreak

public void linebreak()
Description copied from interface: YAMTarget
They want a new line in a paragraph

Specified by:
linebreak in interface YAMTarget

blankline

public void blankline()
Description copied from interface: YAMTarget
They want a blank line without signaling a new paragraph. Useful for new "paragraphs" within a single bullet.

Specified by:
blankline in interface YAMTarget

verbatim

public void verbatim(String rawOutput)
Description copied from interface: YAMTarget
Assume rawOutput is in output language and just dump

Specified by:
verbatim in interface YAMTarget

code

public void code(String c)
Specified by:
code in interface YAMTarget

blockquote

public void blockquote(String q)
Specified by:
blockquote in interface YAMTarget

link

public void link(String url,
                 String title)
Specified by:
link in interface YAMTarget

anchor

public void anchor(String name)
Specified by:
anchor in interface YAMTarget

title

public void title(String title)
Specified by:
title in interface YAMTarget

beginSection

public void beginSection(String title,
                         int level)
Specified by:
beginSection in interface YAMTarget

endSection

public void endSection(int level)
Specified by:
endSection in interface YAMTarget

beginSectionList

public void beginSectionList(int level)
Specified by:
beginSectionList in interface YAMTarget

endSectionList

public void endSectionList(int level)
Specified by:
endSectionList in interface YAMTarget

col

public void col()
Specified by:
col in interface YAMTarget

row

public void row()
Specified by:
row in interface YAMTarget

hr

public void hr()
Specified by:
hr in interface YAMTarget

begin_table

public void begin_table()
Specified by:
begin_table in interface YAMTarget

end_table

public void end_table()
Specified by:
end_table in interface YAMTarget

beginEM

public String beginEM()
Specified by:
beginEM in interface YAMTarget

endEM

public String endEM()
Specified by:
endEM in interface YAMTarget

beginTT

public String beginTT()
Specified by:
beginTT in interface YAMTarget

endTT

public String endTT()
Specified by:
endTT in interface YAMTarget

beginBF

public String beginBF()
Specified by:
beginBF in interface YAMTarget

endBF

public String endBF()
Specified by:
endBF in interface YAMTarget

longdash

public void longdash()
Specified by:
longdash in interface YAMTarget

contents

public void contents()
Specified by:
contents in interface YAMTarget

wikilink

public void wikilink(String url,
                     String title)
Specified by:
wikilink in interface YAMTarget

image

public void image(YAMContext context,
                  Vector args)
Former plugins

Specified by:
image in interface YAMTarget

cite

public void cite(YAMContext context,
                 Vector args)
Description copied from interface: YAMTarget
Former plugins

Specified by:
cite in interface YAMTarget

box

public void box(YAMContext context,
                Vector args)
Specified by:
box in interface YAMTarget

c

public void c(YAMContext context,
              Vector args)
Specified by:
c in interface YAMTarget

date

public void date(YAMContext context,
                 Vector args)
Specified by:
date in interface YAMTarget

delete

public void delete(YAMContext context,
                   Vector args)
Specified by:
delete in interface YAMTarget

eps

public void eps(YAMContext context,
                Vector args)
Specified by:
eps in interface YAMTarget

footnote

public void footnote(YAMContext context,
                     Vector args)
Specified by:
footnote in interface YAMTarget

include

public void include(YAMContext context,
                    Vector args)
Specified by:
include in interface YAMTarget

notes

public void notes(YAMContext context,
                  Vector args)
Specified by:
notes in interface YAMTarget

syndiag

public void syndiag(YAMContext context,
                    Vector args)
Specified by:
syndiag in interface YAMTarget

tree

public void tree(YAMContext context,
                 Vector args)
Specified by:
tree in interface YAMTarget