Package io.debezium.antlr
Class CaseChangingCharStream
- java.lang.Object
-
- io.debezium.antlr.CaseChangingCharStream
-
- All Implemented Interfaces:
org.antlr.v4.runtime.CharStream,org.antlr.v4.runtime.IntStream
public class CaseChangingCharStream extends Object implements org.antlr.v4.runtime.CharStream
https://github.com/parrt/antlr4/blob/case-insensitivity-doc/doc/resources/CaseChangingCharStream.javaThis class supports case-insensitive lexing by wrapping an existing
CharStreamand 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'.
-
-
Constructor Summary
Constructors Constructor Description CaseChangingCharStream(org.antlr.v4.runtime.CharStream stream, boolean upper)Constructs a new CaseChangingCharStream wrapping the givenCharStreamforcing all characters to upper case or lower case.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconsume()StringgetSourceName()StringgetText(org.antlr.v4.runtime.misc.Interval interval)intindex()intLA(int i)intmark()voidrelease(int marker)voidseek(int index)intsize()
-
-
-
Constructor Detail
-
CaseChangingCharStream
public CaseChangingCharStream(org.antlr.v4.runtime.CharStream stream, boolean upper)Constructs a new CaseChangingCharStream wrapping the givenCharStreamforcing all characters to upper case or lower case.- Parameters:
stream- The stream to wrap.upper- If true force each symbol to upper case, otherwise force to lower.
-
-
Method Detail
-
getText
public String getText(org.antlr.v4.runtime.misc.Interval interval)
- Specified by:
getTextin interfaceorg.antlr.v4.runtime.CharStream
-
consume
public void consume()
- Specified by:
consumein interfaceorg.antlr.v4.runtime.IntStream
-
LA
public int LA(int i)
- Specified by:
LAin interfaceorg.antlr.v4.runtime.IntStream
-
mark
public int mark()
- Specified by:
markin interfaceorg.antlr.v4.runtime.IntStream
-
release
public void release(int marker)
- Specified by:
releasein interfaceorg.antlr.v4.runtime.IntStream
-
index
public int index()
- Specified by:
indexin interfaceorg.antlr.v4.runtime.IntStream
-
seek
public void seek(int index)
- Specified by:
seekin interfaceorg.antlr.v4.runtime.IntStream
-
size
public int size()
- Specified by:
sizein interfaceorg.antlr.v4.runtime.IntStream
-
getSourceName
public String getSourceName()
- Specified by:
getSourceNamein interfaceorg.antlr.v4.runtime.IntStream
-
-