package ddl import ( "github.com/antlr4-go/antlr/v4" "unicode" ) type CaseChangingStream struct { antlr.CharStream upper bool } func newCaseChangingStream(in antlr.CharStream, upper bool) *CaseChangingStream { return &CaseChangingStream{ in, upper, } } func (is *CaseChangingStream) LA(offset int) int { in := is.CharStream.LA(offset) if in < 0 { return in } if is.upper { return int(unicode.ToUpper(rune(in))) } else { return int(unicode.ToLower(rune(in))) } }