[antlr-interest] Countinous parsing of inputstream (i.e. from Serial port)

Arne Ploese aploese at gmx.de
Tue May 25 11:20:09 PDT 2010


Hi,
        
        I want to parse a stream from a serial port. There are packages
        like
        "T12346679FF22\r\n" which com in all 2 minutes. I want to
        lex/parse them
        at the moment they arrive.
        
        Using 
        
          ANTLRInputStream input = new ANTLRInputStream(is); 
          FhzLexer lexer = new FhzLexer(input);
          CommonTokenStream tokens = new CommonTokenStream(lexer);
          FhzParser parser = new FhzParser(tokens);
                    
        
        will give me the results only when I close the InputStream is.
        
        Any Idea how to archive this in "realtime".
        
        Arne Plöse




More information about the antlr-interest mailing list