Re: Should data filtering be done while building the parse tree or after the parse tree is built?

Robert A Duff <bobduff@shell01.TheWorld.com>
Thu, 06 Jun 2013 12:10:05 -0400

          From comp.compilers

Related articles
Should data filtering be done while building the parse tree or after t costello@mitre.org (Costello, Roger L.) (2013-06-03)
Re: Should data filtering be done while building the parse tree or aft bobduff@shell01.TheWorld.com (Robert A Duff) (2013-06-06)
| List of all articles for this month |
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Newsgroups: comp.compilers
Date: Thu, 06 Jun 2013 12:10:05 -0400
Organization: The World Public Access UNIX, Brookline, MA
References: 13-06-005
Keywords: parse
Posted-Date: 06 Jun 2013 12:33:55 EDT

> Should I embed filtering rules into the grammar -- perform filtering as I
> build the parse tree?
>
> Or, should I build the parse tree and then have an application perform
> filtering on the parse tree?


I think the second approach is usually simpler. Separation of concerns.
A parser is working with text (or a sequence of tokens, or whatever).
A syntax tree is an easier data structure to work with for doing
various transformations.


- Bob



Post a followup to this message

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