On 6/24/11 7:49 PM, "Jim Idle" <[email protected]> wrote:
Hi Jim,
I will send few letters now, but I will start with simple question to this
your letter.
Am I right, that we also in this loop should kill and create again
TreeParser?
Yes?
> Because the documentation is not yet up to date, here is an example of
> reusing the allocated memory in input streams and token streams:
>
>
>
> for (i=0; i<iterations; i++)
> {
> // Run the parser.
> //
> psr->start(psr);
>
> // --------------------------------------
> // Now reset everything for the next run.
> // Order of calls is important.
>
> // Input stream can now be reused
> //
> input->reuse(input, sourceCode, sourceLen, sourceName);
>
> // Reset the common token stream so that it will reuse its resources
> //
> tstream->reset(tstream);
>
> // Reset the lexer (new function generated by antlr now)
> //
> lxr->reset(lxr);
>
> // Reset the parser (new function generated by antlr now)
> //
> psr->reset(psr);
> }
--
Best regards,
Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc
Valentina - Joining Worlds of Information
http://www.paradigmasoft.com
[I feel the need: the need for speed]
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address
--
You received this message because you are subscribed to the Google Groups
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/il-antlr-interest?hl=en.