Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

java

antlr4

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.

like image 392
Daxer Avatar asked Oct 16 '22 17:10

Daxer


1 Answers

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

like image 198
Daniel Doctor Avatar answered Oct 21 '22 07:10

Daniel Doctor