|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.gate.wiki.antlr.YAMContext
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 | |
---|---|
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 |
static String |
PLUGINS
List of package(s) to search for plugin names. |
protected boolean |
inTable
|
protected Stack |
inputNameStack
|
protected YAMLexer |
lexer
|
protected Stack |
listTypeStack
|
protected Hashtable |
pluginCache
Tracks a list of Class objects |
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 Object | |
---|---|
wait, wait, wait, hashCode, getClass, equals, toString, notify, notifyAll |
Field Detail |
---|
static int LOWEST_LEVEL
static int NOT_IN_SECTION_LEVEL
static String PLUGINS
protected boolean inTable
protected Stack inputNameStack
protected YAMLexer lexer
protected Stack listTypeStack
protected Hashtable pluginCache
protected int sectionLevel
protected StringBuffer textBetweenMarkup
protected Hashtable userClasses
protected Hashtable variables
Constructor Detail |
---|
public YAMContext(YAMLexer lexer)
Method Detail |
---|
public void defineVariable(String id, Object value)
public int getColumn()
public String getInputName()
public int getLine()
public Class getPlugin(String name)
public YAMTarget getTarget()
public Object getVariable(String id)
public boolean isNestedTranslator()
public String popInputName()
public void pushInputName(String name)
public void registerClass(String markup, String className)
Groovy Documentation