Class X_LLkParser

java.lang.Object
antlr.Parser
antlr.LLkParser
eu.bandm.tools.xantlr.runtime.X_LLkParser
Direct Known Subclasses:
D2dParser, JavaParser, UModParser

public class X_LLkParser extends antlr.LLkParser
Base class for all parsers generated by xantlr, see user doc. Such a new base class is needed (1) to perform the event generation, which is the purpose of the xantlr tool, and (2) to re-implement the antlr error handling routines, for to pipe the antlr errors and warnings into the metatools message system.

(1) is done as follows: the xantlr transformations add semantic actions (as described in the user doc) to the parser code which call the event genrating runtime routines in that EventGenerator object which is stored in event.
(Currently this object is always a SAXEventGenerator, but this is not necessarily so.)
(2) is achieved by re-implementing the methods reportError(String), reportWarning(String), etc., which are called by standard antlr behaviour, and here create Message objects.
Before starting any parser process, the user has to configure this class corretly with the targets of these both data channeld, ie. by calling setEventGenerator(EventGenerator) and setMessageReceiver(MessageReceiver). After creation of the X_LLKParser, the field event contains a new EventFilter, which is a clsss which discards all events! This is probably not what you want.
(Plese note that the parser has to be linked to a lexer using HistoryToken. See there for an example.)