antlr

Class LexerGrammar


(package private) class LexerGrammar
extends Grammar

Lexer-specific grammar subclass

Field Summary

protected boolean
caseSensitive
true if the lexer generates case-sensitive literals testing
protected boolean
caseSensitiveLiterals
protected BitSet
charVocabulary
protected boolean
filterMode
true if lexer is to ignore all unrecognized tokens
protected String
filterRule
if filterMode is true, then filterRule can indicate an optional rule to use as the scarf language.
protected boolean
testLiterals

Fields inherited from class antlr.Grammar

analyzerDebug, antlrTool, buildAST, classMemberAction, className, comment, debuggingOutput, defaultErrorHandler, exportVocab, fileName, generator, hasSyntacticPredicate, hasUserErrorHandling, importVocab, interactive, maxk, options, preambleAction, rules, superClass, symbols, theLLkAnalyzer, tokenManager, traceRules

Constructor Summary

LexerGrammar(String className_, Tool tool_, String superClass)

Method Summary

void
generate()
Top-level call to generate the code
String
getSuperClass()
boolean
getTestLiterals()
void
processArguments(String[] args)
Process command line arguments.
void
setCharVocabulary(BitSet b)
Set the character vocabulary used by the lexer
boolean
setOption(String key, Token value)
Set lexer options

Methods inherited from class antlr.Grammar

define, generate, getClassName, getDefaultErrorHandler, getFilename, getIntegerOption, getOption, getSuperClass, getSymbol, getSymbols, hasOption, isDefined, processArguments, setCodeGenerator, setFilename, setGrammarAnalyzer, setOption, setTokenManager, toString

Field Details

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 Details

LexerGrammar

(package private)  LexerGrammar(String className_,
                                Tool tool_,
                                String superClass)

Method Details

generate

public void generate()
            throws IOException
Top-level call to generate the code
Overrides:
generate in interface Grammar

getSuperClass

public String getSuperClass()
Overrides:
getSuperClass in interface Grammar

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
Overrides:
processArguments in interface Grammar

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
Overrides:
setOption in interface Grammar