I am trying to compile a test class to test a simple grammer.
import org.antlr.v4.runtime.*;
public class Test {
public static void main(String[] args) throws Exception
{
CharStream input = null;
// pick an input stream (filename from commandline or stdin)
if(args.length > 0) input = new ANTLRFileStream(args[0]);
else input = new ANTLRInputStream(System.in);
// create the lexer
DrinkLexer lex = new DrinkLexer(input);
// create a buffer of tokens between the lexer and parser
CommonTokenStream tokens = new CommonTokenStream(lex);
// create the parser, attaching it to the token buffer
DrinkParser p = new DrinkParser(tokens);
p.drinkSentence(); // launch parser at drinkSentence file
}
}
How would I go about replacing the deprecated class?