Groovy Documentation

java.gate.wiki.antlr
Class YAMContext

java.lang.Object
  java.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

LOWEST_LEVEL

static int LOWEST_LEVEL
Lowest section/overhead level etc...


NOT_IN_SECTION_LEVEL

static int NOT_IN_SECTION_LEVEL
Indication that we are below the lowest level and not in a section


PLUGINS

static String PLUGINS
List of package(s) to search for plugin names. CLASSPATH must include dirs containing package roots listed here.


inTable

protected boolean inTable


inputNameStack

protected Stack inputNameStack


lexer

protected YAMLexer lexer


listTypeStack

protected Stack listTypeStack


pluginCache

protected Hashtable pluginCache
Tracks a list of Class objects


sectionLevel

protected int sectionLevel


textBetweenMarkup

protected StringBuffer textBetweenMarkup


userClasses

protected Hashtable userClasses
A hashtable used to store the user defined markup to plugin class name mappings.


variables

protected Hashtable variables


 
Constructor Detail

YAMContext

public YAMContext(YAMLexer lexer)


 
Method Detail

defineVariable

public void defineVariable(String id, Object value)


getColumn

public int getColumn()
What column number in the file are we at?


getInputName

public String getInputName()


getLine

public int getLine()
What line number in the file are we at?


getPlugin

public Class getPlugin(String name)
Get from cache or using predefined variable PLUGINS


getTarget

public YAMTarget getTarget()
The plugins will want to know what the output target language is


getVariable

public Object getVariable(String id)


isNestedTranslator

public boolean isNestedTranslator()


popInputName

public String popInputName()


pushInputName

public void pushInputName(String name)


registerClass

public void registerClass(String markup, String className)
This method is used for registering the plugin class as the handler for the specified markup type.
param:
markup the markup that this plugin handles.
param:
className the class name of the plgin.


 

Groovy Documentation