forked from jasder/antlr
case-insensitive-lexing: Golang: make direct-importing possible
This commit is contained in:
parent
91f4b89ee6
commit
013dca5d7d
|
@ -1,13 +1,15 @@
|
||||||
package antlr
|
package antlr_resource
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"unicode"
|
"unicode"
|
||||||
|
|
||||||
|
"github.com/antlr/antlr4/runtime/Go/antlr"
|
||||||
)
|
)
|
||||||
|
|
||||||
// CaseChangingStream wraps an existing CharStream, but upper cases, or
|
// CaseChangingStream wraps an existing CharStream, but upper cases, or
|
||||||
// lower cases the input before it is tokenized.
|
// lower cases the input before it is tokenized.
|
||||||
type CaseChangingStream struct {
|
type CaseChangingStream struct {
|
||||||
CharStream
|
antlr.CharStream
|
||||||
|
|
||||||
upper bool
|
upper bool
|
||||||
}
|
}
|
||||||
|
@ -15,10 +17,8 @@ type CaseChangingStream struct {
|
||||||
// NewCaseChangingStream returns a new CaseChangingStream that forces
|
// NewCaseChangingStream returns a new CaseChangingStream that forces
|
||||||
// all tokens read from the underlying stream to be either upper case
|
// all tokens read from the underlying stream to be either upper case
|
||||||
// or lower case based on the upper argument.
|
// or lower case based on the upper argument.
|
||||||
func NewCaseChangingStream(in CharStream, upper bool) *CaseChangingStream {
|
func NewCaseChangingStream(in antlr.CharStream, upper bool) *CaseChangingStream {
|
||||||
return &CaseChangingStream{
|
return &CaseChangingStream{in, upper}
|
||||||
in, upper,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// LA gets the value of the symbol at offset from the current position
|
// LA gets the value of the symbol at offset from the current position
|
||||||
|
|
Loading…
Reference in New Issue