QUESTION: saving source locations during parsing

Brent Benson <bwb@concentra.com>
Sat, 24 Jun 1995 04:38:56 GMT

          From comp.compilers

Related articles
QUESTION: saving source locations during parsing bwb@concentra.com (Brent Benson) (1995-06-24)
Re: QUESTION: saving source locations during parse rekers@wi.leidenuniv.nl (1995-06-26)
| List of all articles for this month |
Newsgroups: comp.compilers
From: Brent Benson <bwb@concentra.com>
Keywords: parse, question
Organization: Compilers Central
Date: Sat, 24 Jun 1995 04:38:56 GMT
Status: RO

I have written a lexer and parser for a programming language syntax
using flex and byacc that produces abstract syntax trees. I would
like to be able to save the beginning and ending source code location
of each piece of concrete syntax inside the abstract syntax node that
represents the syntax form.


I am aware that I could add an action that is executed before a
particular form is recognized that saves off the source location, but
I am hoping for a solution that leaves my grammar in a nicer
condition.


Brent Benson
Concentra Corporation
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.