[antlr-interest] Best way to carry input file name along with ASTs

Jim Idle jimi at temporal-wave.com
Thu Feb 3 08:04:13 PST 2011


The token references its input stream, which gives you the file name.
Target? How are you processing things like include files? Track the file
boundaries by token index?

Jim

> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of Bill Andersen
> Sent: Thursday, February 03, 2011 7:24 AM
> To: antlr-interest
> Subject: [antlr-interest] Best way to carry input file name along with
> ASTs
>
> Folks
>
> I have a parser that emits an AST and a number of stages after that.
> At each stage, errors can be detected and I want to emit informative
> error messages about the source of the problem, to include the input
> file name.
>
> I know there are several ways to do it but I'm looking for an easy way
> to have access to the source file name of a given token, even if its
> several passes down the line.
>
> Any suggestions welcome.
>
>   .bill
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-
> email-address


More information about the antlr-interest mailing list