ANTLR-4.7.1:The type ANTLRInputStream is deprecated [duplicate]
Asked Answered
A

1

6
import  org.antlr.v4.runtime.*;
import  org.antlr.v4.runtime.tree.*;

public class Test{
public static void main(String[] args) throws Exception{

    ANTLRInputStream input = new ANTLRInputStream(System.in);

    ArrayInitLexer lexer = new ArrayInitLexer(input);

    CommonTokenStream tokens = new CommonTokenStream(lexer);

    ArrayInitParser parser = new ArrayInitParser(tokens);

    ParseTree tree = parser.init();
    System.out.println(tree.toStringTree(parser));


}
}

I have found the official API (http://www.antlr.org/api/Java/index.html) , but I still don't know how to solve it.

Appall answered 5/6, 2018 at 3:19 Comment(0)
A
3

Their official ANTLR site recommends using the CharsStreams class as from version 4.7 ANTRLInputStream is deprecated.

Ahmedahmedabad answered 5/6, 2018 at 3:22 Comment(3)
Thanks. But how should I modify my code?Appall
@Appall as with all deprecated method/codes, it is not mandatory to change, however, in newer versions of the library, they might be removed. So it's always a good idea to change to the newer functionality.Pitsaw
@Daniel Doctor Thank you for your enthusiasm. I have solved my problem :)Appall

© 2022 - 2024 — McMap. All rights reserved.