If I use
ANTLRFileStream antlrFileStream = new ANTLRFileStream("myfile.testlang");
or
ANTLRInputStream input = new ANTLRInputStream( new FileInputStream("myfile.testlang") );
Compiler shows deprecation error for both the classes what is alternative?
You can use the CharStreams
class instead of the deprecated classes as below.
CharStream codePointCharStream = CharStreams.fromFileName("myfile.testlang");
TESTLANGLexer lexer = new TESTLANGLexer(codePointCharStream);
TESTLANGParser parser = new TESTLANGParser(new CommonTokenStream(lexer));
parser.addParseListener(new TESTLANGEventListener());
// Start parsing
parser.testlangFile();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With