Class XMLLexer
java.lang.Object
ca.phon.xml.XMLLexer
- All Implemented Interfaces:
org.antlr.runtime.TokenSource
ANTLR3 lexer for XML files using the
StAX API (XMLEventReader) to
pull tokens from the xml stream.
Tokens are emitted on the following xml events:
Token numbers can be assigned using a properties file. If no file is given or the generated token name is not found, the token ID is given ....
TODO Handle namespaces-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic XMLLexerfromStream(InputStream source, String encoding) Create a new lexer for the given stream.static XMLLexerfromStream(InputStream source, String encoding, Properties tokenMap) Create a new lexer for the given stream.org.antlr.runtime.Tokenprotected intGet the token ID for the given token name.protected StringTurn the givenQNameinto a ANTLR token name.
-
Constructor Details
-
XMLLexer
-
-
Method Details
-
fromStream
Create a new lexer for the given stream.- Parameters:
source-- Throws:
IOException
-
fromStream
public static XMLLexer fromStream(InputStream source, String encoding, Properties tokenMap) throws IOException Create a new lexer for the given stream. Also provide a token map, can benull.- Parameters:
tokenMap-stream-- Throws:
IOException
-
tokenName
-
tokenID
Get the token ID for the given token name.- Parameters:
tokenName-- Returns:
- the token ID, if not found in the tokenMap it will be generated.
-
nextToken
public org.antlr.runtime.Token nextToken()- Specified by:
nextTokenin interfaceorg.antlr.runtime.TokenSource
-
getSourceName
- Specified by:
getSourceNamein interfaceorg.antlr.runtime.TokenSource
-