public class CaseChangingCharStream extends Object implements org.antlr.v4.runtime.CharStream
This class supports case-insensitive lexing by wrapping an existing
CharStream and forcing the lexer to see either upper or
lowercase characters. Grammar literals should then be either upper or
lower case such as 'BEGIN' or 'begin'. The text of the character
stream is unaffected. Example: input 'BeGiN' would match lexer rule
'BEGIN' if constructor parameter upper=true but getText() would return
'BeGiN'.
| Modifier and Type | Field and Description |
|---|---|
(package private) org.antlr.v4.runtime.CharStream |
stream |
(package private) boolean |
upper |
| Constructor and Description |
|---|
CaseChangingCharStream(org.antlr.v4.runtime.CharStream stream,
boolean upper)
Constructs a new CaseChangingCharStream wrapping the given
CharStream forcing
all characters to upper case or lower case. |
| Modifier and Type | Method and Description |
|---|---|
void |
consume() |
String |
getSourceName() |
String |
getText(org.antlr.v4.runtime.misc.Interval interval) |
int |
index() |
int |
LA(int i) |
int |
mark() |
void |
release(int marker) |
void |
seek(int index) |
int |
size() |
public CaseChangingCharStream(org.antlr.v4.runtime.CharStream stream,
boolean upper)
CharStream forcing
all characters to upper case or lower case.stream - The stream to wrap.upper - If true force each symbol to upper case, otherwise force to lower.public String getText(org.antlr.v4.runtime.misc.Interval interval)
getText in interface org.antlr.v4.runtime.CharStreampublic void consume()
consume in interface org.antlr.v4.runtime.IntStreampublic int LA(int i)
LA in interface org.antlr.v4.runtime.IntStreampublic int mark()
mark in interface org.antlr.v4.runtime.IntStreampublic void release(int marker)
release in interface org.antlr.v4.runtime.IntStreampublic int index()
index in interface org.antlr.v4.runtime.IntStreampublic void seek(int index)
seek in interface org.antlr.v4.runtime.IntStreampublic int size()
size in interface org.antlr.v4.runtime.IntStreampublic String getSourceName()
getSourceName in interface org.antlr.v4.runtime.IntStreamCopyright © 2018 JBoss by Red Hat. All rights reserved.