Create antlr ANTLRFileStream - Java Parser

Java examples for Parser:antlr

Description

Create antlr ANTLRFileStream

Demo Code

import org.antlr.runtime.*;

public class Main {
    public static void main(String[] args) throws Exception {
        CharStream input = new ANTLRFileStream(args[0]);
        qsortLexer lex = new qsortLexer(input);
        CommonTokenStream tokens = new CommonTokenStream(lex);
        // System.out.println("tokens="+tokens);
        qsortParser parser = new qsortParser(tokens);
        parser.program();//www . jav a  2s  . c  om
    }
}

Related Tutorials