|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gate.wiki.antlr.YAMContext
public class YAMContext
Track everything about a translation in progress. Translation targets get this context. Plugins generate text that must be interpreted as YAM. We create a new lexer to handle the string, but the new lexer must share context with the original (enclosing) lexer. This object is what is shared among lexers.
Field Summary | |
---|---|
protected Stack |
inputNameStack
|
protected boolean |
inTable
|
protected YAMLexer |
lexer
|
protected Stack |
listTypeStack
|
static int |
LOWEST_LEVEL
Lowest section/overhead level etc... |
static int |
NOT_IN_SECTION_LEVEL
Indication that we are below the lowest level and not in a section |
protected Hashtable |
pluginCache
Tracks a list of Class objects |
static String |
PLUGINS
List of package(s) to search for plugin names. |
protected int |
sectionLevel
|
protected StringBuffer |
textBetweenMarkup
|
protected Hashtable |
userClasses
A hashtable used to store the user defined markup to plugin class name mappings. |
protected Hashtable |
variables
|
Constructor Summary | |
---|---|
YAMContext(YAMLexer lexer)
|
Method Summary | |
---|---|
void |
defineVariable(String id,
Object value)
|
int |
getColumn()
What column number in the file are we at? |
String |
getInputName()
|
int |
getLine()
What line number in the file are we at? |
Class |
getPlugin(String name)
Get from cache or using predefined variable PLUGINS |
YAMTarget |
getTarget()
The plugins will want to know what the output target language is |
Object |
getVariable(String id)
|
boolean |
isNestedTranslator()
|
String |
popInputName()
|
void |
pushInputName(String name)
|
void |
registerClass(String markup,
String className)
This method is used for registering the plugin class as the handler for the specified markup type. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static int LOWEST_LEVEL
public static int NOT_IN_SECTION_LEVEL
public static String PLUGINS
protected boolean inTable
protected Stack listTypeStack
protected int sectionLevel
protected StringBuffer textBetweenMarkup
protected Stack inputNameStack
protected Hashtable userClasses
protected YAMLexer lexer
protected Hashtable pluginCache
protected Hashtable variables
Constructor Detail |
---|
public YAMContext(YAMLexer lexer)
Method Detail |
---|
public boolean isNestedTranslator()
public YAMTarget getTarget()
public void pushInputName(String name)
public String popInputName()
public String getInputName()
public int getLine()
public int getColumn()
public Object getVariable(String id)
public void defineVariable(String id, Object value)
public void registerClass(String markup, String className)
markup
- the markup that this plugin handles.className
- the class name of the plgin.public Class getPlugin(String name)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |