Package de.monticore.grammar
Class LexNamer
java.lang.Object
de.monticore.grammar.LexNamer
Class generates human readable names for Lexersymbols
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringconvertKeyword(String key) static StringReturns a good name for the lex symbol or ""static StringReturns a good name for the lex symbol or ""getComputedLexName(String sym) getConstantName(String sym) Deprecated.getLexName(MCGrammarSymbol grammarSymbol, String sym) Deprecated.getOrComputeLexName(MCGrammarSymbol grammarSymbol, String sym) Returns Human-Readable, antlr conformed name for a lexsymbols nice names for common tokens (change constructor to add tokenes) LEXi where i is number for unknown ones
-
Field Details
-
NAME_PATTERN
-
constantCounter
protected int constantCounter -
lexCounter
protected int lexCounter -
usedLex
-
usedConstants
-
goodNames
-
-
Constructor Details
-
LexNamer
public LexNamer()
-
-
Method Details
-
getGoodNames
-
createGoodName
Returns a good name for the lex symbol or "" -
createSimpleGoodName
Returns a good name for the lex symbol or "" -
getLexName
Deprecated.Computes a new name for the lexical production or returns the previously computed one. -
getComputedLexName
-
getOrComputeLexName
Returns Human-Readable, antlr conformed name for a lexsymbols nice names for common tokens (change constructor to add tokenes) LEXi where i is number for unknown ones- Parameters:
sym- lexer symbol- Returns:
- Human-Readable, antlr conformed name for a lexsymbols
-
getConstantName
Deprecated. -
getComputedConstantName
-
getOrComputeConstantName
-
convertKeyword
-
getLexnames
-
getUsedConstants
-
getComputedLexName(String)orgetOrComputeLexName(MCGrammarSymbol, String)instead