Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.compilers > #915 > unrolled thread

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

Started by"Costello, Roger L." <costello@mitre.org>
First post2013-06-03 19:47 +0000
Last post2013-06-06 12:10 -0400
Articles 2 — 2 participants

Back to article view | Back to comp.compilers


Contents

  Should data filtering be done while building the parse tree or after the parse tree is built? "Costello, Roger L." <costello@mitre.org> - 2013-06-03 19:47 +0000
    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> - 2013-06-06 12:10 -0400

#915 — Should data filtering be done while building the parse tree or after the parse tree is built?

From"Costello, Roger L." <costello@mitre.org>
Date2013-06-03 19:47 +0000
SubjectShould data filtering be done while building the parse tree or after the parse tree is built?
Message-ID<13-06-005@comp.compilers>
Hi Folks,

I am building a parser to parse some data.

I want to filter some of the data.

For example, I want to "fuzz" latitude and longitude values to contain just
two digits to the right of the decimal point.

    Fuzz this latitude value:
          42.3583
    to this:
         42.35

When should filtering be done?

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?

/Roger

[toc] | [next] | [standalone]


#919

FromRobert A Duff <bobduff@shell01.TheWorld.com>
Date2013-06-06 12:10 -0400
Message-ID<13-06-009@comp.compilers>
In reply to#915
> 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

[toc] | [prev] | [standalone]


Back to top | Article view | comp.compilers


csiph-web