[antlr-interest] Re: mystery in printing order

idontwantanidwith2000init idontwantanidwith2000init at yahoo.com
Fri Apr 16 11:01:07 PDT 2004


Wow,
You are correct.
How do I refer System.err to System.out temporarly ?

Tal.

--- In antlr-interest at yahoogroups.com, Greg Lindholm 
<glindholm at y...> wrote:
> (I assume reportError is going to System.err)
>  
> I've seen similar behaviour in other Java apps when you print to 
both System.out and System.err you can never count on seeing the 
output weaved together in a timestamp based order. I'm guessing it's 
because of buffering.
>  
> If you change to print to System.err you should see what you 
expect.
> 
> 
> idontwantanidwith2000init <idontwantanidwith2000init at y...> wrote:
> Hi,
> I turned errorDefaultHandler off.
> I wrote the following:
> System.out.print("#");
> reportError(exceptionVariable.toString());
> consumeUntil(NEWLINE);
> consume();
> System.out.print("? please type an id =>");
> t = idToken();
> 
> idToken is the rule we are tring to parse.
> It will lead to recursion but this is not the issue.
> The issue is the output order:
> #? please type an id =>error: line 1:16: expecting ID, found 'moo'
> While the expected output is:
> #error: line 1:16: expecting ID, found 'moo'
> ? please type an id =>
> 
> It seems like System.out.print is quicker to print then 
reportError.
> Is there threading invoved?
> How can I make reportError output to be writethrough ?
> 
> 
> BTW,
> Could I read ANTLR code?
> 
> Tal.
> 
> 
> 
> 
> 
> Yahoo! Groups Links
> 
> 
> 
> 
> 
> 		
> ---------------------------------
> Do you Yahoo!?
> Yahoo! Tax Center - File online by April 15th



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
     antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 



More information about the antlr-interest mailing list