History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: ANTLR-144
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Jim Idle
Reporter: Jim Idle
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
ANTLR v3

C runtime does not track originating input stream for tokens

Created: 19/Jun/07 08:40 AM   Updated: 02/Jun/08 11:38 AM  Due: 24/Jun/07
Component/s: C Target
Affects Version/s: 3.0
Fix Version/s: 3.0

Environment: Any platform.


 Description  « Hide
When trying to imlpement INCLUDE functinoality in a lexer, the setCharStrem() works properly for the actaul input but when a token is finally asked for its text, it retrieves the text from jstu the firs tinput stream. It seems that the tokens are not tracking their input stream correctly. Either that, or the way to do this in C needs to be documented.

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Jim Idle - 19/Jun/07 05:57 PM
This fix, as well as correcting the fact that setCharStyream did not update the token factory to indicate which stream the token was soruced from, also builds the handling of stacked input streams directly into the runtime. They are pretty mcuh zero overhead if you do not use them. Note that the built in stream ahndling is not handled in filtering lexers (but perhps I ought to build it in there too).

The C example set has been updated to cater for the #include statement in the C parser example, which now uses the stacked input streams.

new macros:

PUSHSTREAM(i) - i is a pANTLR3_INPUT_STREAM
POPSTREAM() - reverts to the prior intput stream if available and handled automaticaly by the built in nextToken method.