Package antlr
Class LexerGrammar
- java.lang.Object
-
- antlr.Grammar
-
- antlr.LexerGrammar
-
class LexerGrammar extends Grammar
Lexer-specific grammar subclass
-
-
Field Summary
Fields Modifier and Type Field Description protected booleancaseSensitivetrue if the lexer generates case-sensitive literals testingprotected booleancaseSensitiveLiteralsprotected BitSetcharVocabularyprotected booleanfilterModetrue if lexer is to ignore all unrecognized tokensprotected java.lang.StringfilterRuleif filterMode is true, then filterRule can indicate an optional rule to use as the scarf language.protected booleantestLiterals-
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
Constructors Constructor Description LexerGrammar(java.lang.String className_, Tool tool_, java.lang.String superClass)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidgenerate()Top-level call to generate the codejava.lang.StringgetSuperClass()booleangetTestLiterals()voidprocessArguments(java.lang.String[] args)Process command line arguments.voidsetCharVocabulary(BitSet b)Set the character vocabulary used by the lexerbooleansetOption(java.lang.String key, Token value)Set lexer options-
Methods inherited from class antlr.Grammar
define, getClassName, getDefaultErrorHandler, getFilename, getIntegerOption, getOption, getSymbol, getSymbols, hasOption, isDefined, setCodeGenerator, setFilename, setGrammarAnalyzer, setTokenManager, toString
-
-
-
-
Field Detail
-
charVocabulary
protected BitSet charVocabulary
-
testLiterals
protected boolean testLiterals
-
caseSensitiveLiterals
protected boolean caseSensitiveLiterals
-
caseSensitive
protected boolean caseSensitive
true if the lexer generates case-sensitive literals testing
-
filterMode
protected boolean filterMode
true if lexer is to ignore all unrecognized tokens
-
filterRule
protected java.lang.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".
-
-
Constructor Detail
-
LexerGrammar
LexerGrammar(java.lang.String className_, Tool tool_, java.lang.String superClass)
-
-
Method Detail
-
generate
public void generate() throws java.io.IOExceptionTop-level call to generate the code
-
getSuperClass
public java.lang.String getSuperClass()
- Specified by:
getSuperClassin classGrammar
-
getTestLiterals
public boolean getTestLiterals()
-
processArguments
public void processArguments(java.lang.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- Specified by:
processArgumentsin classGrammar
-
setCharVocabulary
public void setCharVocabulary(BitSet b)
Set the character vocabulary used by the lexer
-
-