Package com.github._1c_syntax.bsl.parser
Class CaseChangingCharStream
java.lang.Object
com.github._1c_syntax.bsl.parser.CaseChangingCharStream
- All Implemented Interfaces:
CharStream
,IntStream
,UnicodeCharStream
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'.-
Field Summary
Fields inherited from interface org.antlr.v4.runtime.IntStream
EOF, UNKNOWN_SOURCE_NAME
-
Constructor Summary
ConstructorDescriptionConstructs a new CaseChangingCharStream wrapping the givenUnicodeCharStream
forcing all characters to upper case. -
Method Summary
-
Constructor Details
-
CaseChangingCharStream
Constructs a new CaseChangingCharStream wrapping the givenUnicodeCharStream
forcing all characters to upper case.- Parameters:
stream
- The stream to wrap.
-
-
Method Details
-
getText
- Specified by:
getText
in interfaceCharStream
-
consume
public void consume() -
LA
public int LA(int i) -
mark
public int mark() -
release
public void release(int marker) -
index
public int index() -
seek
public void seek(int index) -
size
public int size() -
getSourceName
- Specified by:
getSourceName
in interfaceIntStream
-
supportsUnicodeCodePoints
public boolean supportsUnicodeCodePoints()- Specified by:
supportsUnicodeCodePoints
in interfaceUnicodeCharStream
-