Vocabulary.getLiteralName

@uml Gets the string literal associated with a token type. The string returned by this method, when not {@code null}, can be used unaltered in a parser grammar to represent this token type.

<p>The following table shows examples of lexer rules and the literal names assigned to the corresponding token types.</p>

<table> <tr> <th>Rule</th> <th>Literal Name</th> <th>Java String Literal</th> </tr> <tr> <td>{@code THIS : 'this';}</td> <td>{@code 'this'}</td> <td>{@code "'this'"}</td> </tr> <tr> <td>{@code SQUOTE : '\'';}</td> <td>{@code '\''}</td> <td>{@code "'\\''"}</td> </tr> <tr> <td>{@code ID : [A-Z]+;}</td> <td>n/a</td> <td>{@code null}</td> </tr> </table>

@param tokenType The token type.

@return The string literal associated with the specified token type, or {@code null} if no string literal is associated with the type.

interface Vocabulary
string
getLiteralName
()

Meta