Package eu.bandm.tools.xantlr.runtime
Class SAXEventGenerator
java.lang.Object
eu.bandm.tools.xantlr.runtime.SAXEventGenerator
- All Implemented Interfaces:
EventGenerator<NamespaceName,
,XMLDocumentIdentifier> Locator
public class SAXEventGenerator
extends Object
implements EventGenerator<NamespaceName,XMLDocumentIdentifier>, Locator
Runtime class for an xantlr generated parser which maps the
AST-representing events onto SAX events.
For details please refer to
For the SAX events to reach a certain consumer, this class has to be linked to some SAX content handler by calling
X_LLkParser
and to
the user doc.
For the SAX events to reach a certain consumer, this class has to be linked to some SAX content handler by calling
myParser.event.
setContentHandler(ContentHandler)
before starting the parser process.-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
protected ContentHandler
protected XMLDocumentIdentifier
final Attributes
protected ErrorHandler
protected final antlr.Parser
protected String
protected int
protected String
protected boolean
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
allow()
void
characters
(String name) void
endElement
(NamespaceName name) void
void
fatalError
(String message) int
int
getLocation
(antlr.RecognitionException e) void
setContentHandler
(ContentHandler contentHandler) void
setErrorHandler
(ErrorHandler errorHandler) void
setPublicId
(String publicId) void
setSystemId
(String systemId) void
startElement
(NamespaceName name) void
suppress()
void
-
Field Details
-
EMPTY_ATTRIBUTES
-
parser
protected final antlr.Parser parser -
contentHandler
-
errorHandler
-
suppression
protected int suppression -
publicId
-
systemId
-
documentId
-
useSystemId
protected boolean useSystemId -
atEnd
protected transient boolean atEnd
-
-
Constructor Details
-
SAXEventGenerator
public SAXEventGenerator(antlr.Parser parser)
-
-
Method Details
-
getContentHandler
-
setContentHandler
-
getErrorHandler
-
setErrorHandler
-
suppress
public void suppress()- Specified by:
suppress
in interfaceEventGenerator<NamespaceName,
XMLDocumentIdentifier>
-
allow
public void allow() throws antlr.SemanticException- Specified by:
allow
in interfaceEventGenerator<NamespaceName,
XMLDocumentIdentifier> - Throws:
antlr.SemanticException
-
startElement
- Specified by:
startElement
in interfaceEventGenerator<NamespaceName,
XMLDocumentIdentifier> - Throws:
antlr.SemanticException
-
endElement
- Specified by:
endElement
in interfaceEventGenerator<NamespaceName,
XMLDocumentIdentifier> - Throws:
antlr.SemanticException
-
characters
- Specified by:
characters
in interfaceEventGenerator<NamespaceName,
XMLDocumentIdentifier> - Throws:
antlr.SemanticException
-
warning
- Specified by:
warning
in interfaceEventGenerator<NamespaceName,
XMLDocumentIdentifier> - Throws:
antlr.SemanticException
-
error
- Specified by:
error
in interfaceEventGenerator<NamespaceName,
XMLDocumentIdentifier> - Throws:
antlr.SemanticException
-
fatalError
- Specified by:
fatalError
in interfaceEventGenerator<NamespaceName,
XMLDocumentIdentifier> - Throws:
antlr.SemanticException
-
setPublicId
-
setSystemId
-
getPublicId
- Specified by:
getPublicId
in interfaceLocator
-
getSystemId
- Specified by:
getSystemId
in interfaceLocator
-
getDocumentId
-
getLineNumber
public int getLineNumber()- Specified by:
getLineNumber
in interfaceLocator
-
getColumnNumber
public int getColumnNumber()- Specified by:
getColumnNumber
in interfaceLocator
-
getLocation
- Specified by:
getLocation
in interfaceEventGenerator<NamespaceName,
XMLDocumentIdentifier>
-
getLocation
- Specified by:
getLocation
in interfaceEventGenerator<NamespaceName,
XMLDocumentIdentifier>
-