golang - antlr - char_stream.go does not implement FromFileName

Viewed 36

FileStream is deprecated in favor of CharStream, But in the Go runtime using CharStream.FromFileName(...) results in

antlr.CharStream.FromFileName undefined (type "github.com/antlr/antlr4/runtime/Go/antlr".CharStream has no field or method FromFileName)

Checking the source I can see the char_stream.go does not implement/expose the FromFileName method...

While using NewFileStream(...) results in

cannot use file (variable of type *"github.com/antlr/antlr4/runtime/Go/antlr".FileStream) as type "github.com/antlr/antlr4/runtime/Go/antlr/v4".CharStream in argument to NewralfLexer:

What is the correct way to read in a file in this case?

0 Answers
Related