Loading ...
Sorry, an error occurred while loading the content.
 

Re: Passing OutputStream to Lexer

Expand Messages
  • spenserkao
    Empirically, I think I ve found the alternative for the same goal. In the Lexer part of the grammar, create a method something like Public String
    Message 1 of 3 , Jun 7, 2002
      Empirically, I think I've found the alternative for the same goal.
      In the Lexer part of the grammar, create a method something like
      Public String getOutputMsg() { … } to return the outgoing message,
      then in the main program, where Parser and Lexer will be
      instantiated, call the public method to pass the outgoing message to
      PrintWriter.println().

      I am answering my own question here:o)

      Regards, Spenser
      --- In antlr-interest@y..., "Spenser Kao" <spenserkao@o...> wrote:
      > Question on Java version antlr 2.7.1:
      > Is there any to pass OutputStream to Lexer constructor?
      >
      > I can pass an InputStream instance to the Lexer constructor; can I
      do
      > the same with OutputStream?
      > So far I can only redirect the o/p message to a file on the command
      > line, but passing an OutputStream onto Lexer on the fly will be
      more
      > flexible and it seems none of current Lexer constructors allows me
      to do
      > that.
      >
      > Any clue will be much appreciated!
      >
      > Regards,
      >
      > Spenser
    • bob mcwhirter
      I personally think having antlr adopt either log4j or the jakarta-commons-logging API would be a good thing. log4j would allow us to do just about anything we
      Message 2 of 3 , Jun 7, 2002
        I personally think having antlr adopt either log4j or the
        jakarta-commons-logging API would be a good thing.

        log4j would allow us to do just about anything we want
        with the output.

        -bob

        On Fri, 7 Jun 2002, spenserkao wrote:

        > Empirically, I think I've found the alternative for the same goal.
        > In the Lexer part of the grammar, create a method something like
        > Public String getOutputMsg() { � } to return the outgoing message,
        > then in the main program, where Parser and Lexer will be
        > instantiated, call the public method to pass the outgoing message to
        > PrintWriter.println().
        >
        > I am answering my own question here:o)
        >
        > Regards, Spenser
        > --- In antlr-interest@y..., "Spenser Kao" <spenserkao@o...> wrote:
        > > Question on Java version antlr 2.7.1:
        > > Is there any to pass OutputStream to Lexer constructor?
        > >
        > > I can pass an InputStream instance to the Lexer constructor; can I
        > do
        > > the same with OutputStream?
        > > So far I can only redirect the o/p message to a file on the command
        > > line, but passing an OutputStream onto Lexer on the fly will be
        > more
        > > flexible and it seems none of current Lexer constructors allows me
        > to do
        > > that.
        > >
        > > Any clue will be much appreciated!
        > >
        > > Regards,
        > >
        > > Spenser
        >
        >
        >
        >
        > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
        >
        >

        --
        Bob McWhirter bob@...
        The Werken Company http://werken.com/
      Your message has been successfully submitted and would be delivered to recipients shortly.