antlr

Class LexerGrammar

class LexerGrammar extends Grammar

Lexer-specific grammar subclass
Field Summary
protected booleancaseSensitive
true if the lexer generates case-sensitive literals testing
protected booleancaseSensitiveLiterals
protected BitSetcharVocabulary
protected booleanfilterMode
true if lexer is to ignore all unrecognized tokens
protected StringfilterRule
if filterMode is true, then filterRule can indicate an optional rule to use as the scarf language.
protected booleantestLiterals
Constructor Summary
LexerGrammar(String className_, Tool tool_, String superClass)
Method Summary
voidgenerate()
Top-level call to generate the code
StringgetSuperClass()
booleangetTestLiterals()
voidprocessArguments(String[] args)
Process command line arguments.
voidsetCharVocabulary(BitSet b)
Set the character vocabulary used by the lexer
booleansetOption(String key, Token value)
Set lexer options

Field Detail

caseSensitive

protected boolean caseSensitive
true if the lexer generates case-sensitive literals testing

caseSensitiveLiterals

protected boolean caseSensitiveLiterals

charVocabulary

protected BitSet charVocabulary

filterMode

protected boolean filterMode
true if lexer is to ignore all unrecognized tokens

filterRule

protected String filterRule
if filterMode is true, then filterRule can indicate an optional rule to use as the scarf language. If null, programmer used plain "filter=true" not "filter=rule".

testLiterals

protected boolean testLiterals

Constructor Detail

LexerGrammar

LexerGrammar(String className_, Tool tool_, String superClass)

Method Detail

generate

public void generate()
Top-level call to generate the code

getSuperClass

public String getSuperClass()

getTestLiterals

public boolean getTestLiterals()

processArguments

public void processArguments(String[] args)
Process command line arguments. -trace have all rules call traceIn/traceOut -traceLexer have lexical rules call traceIn/traceOut -debug generate debugging output for parser debugger

setCharVocabulary

public void setCharVocabulary(BitSet b)
Set the character vocabulary used by the lexer

setOption

public boolean setOption(String key, Token value)
Set lexer options