[antlr-interest] antlr3, no class such as ANTLRInputStream...

Terence Parr parrt at cs.usfca.edu
Thu May 11 10:16:17 PDT 2006


On May 11, 2006, at 9:15 AM, David CROSSON wrote:

> Hello,
>
>   why not adding a new class to ANTLR3 in order to help
> using any kind of input stream.
> I'd like to be able to write such java code :
>
> InputStream is = new GZIPInputStream(new FileInputStream(file));
> CharStream in = new ANTLRInputStream(is);
> Lexer lexer = new BeaStackDumpParserLexer(in);
> CommonTokenStream tokens = new CommonTokenStream(lexer);
> Parser parser = new MyParser(tokens);
> ...
>
> I was also wondering why the ANTLRFileStream class, which is a  
> CharStream,
> doesn't take a charset parameter ?

I forgot about encodings... sorry.  Also, thank you for the  
suggestions on the input streams...we do need that.  One for Reader  
too, right?

Ter


More information about the antlr-interest mailing list