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: [email protected] [mailto:antlr-interest- > [email protected]] 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 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.
