Re: Is lex/yacc the right tool for this problem

sonyantony@hotmail.com (Sony Antony)
29 Jan 2003 23:43:50 -0500

          From comp.compilers

Related articles
Is lex/yacc the right tool for this problem sonyantony@hotmail.com (2003-01-26)
Re: Is lex/yacc the right tool for this problem arnold@skeeve.com (2003-01-27)
Re: Is lex/yacc the right tool for this problem tenger@idirect.com (Terrence Enger) (2003-01-27)
Re: Is lex/yacc the right tool for this problem sonyantony@hotmail.com (2003-01-29)
Re: Is lex/yacc the right tool for this problem sonyantony@hotmail.com (2003-01-29)
Re: Is lex/yacc the right tool for this problem codeworker@free.fr (2003-01-29)
| List of all articles for this month |

From: sonyantony@hotmail.com (Sony Antony)
Newsgroups: comp.compilers
Date: 29 Jan 2003 23:43:50 -0500
Organization: http://groups.google.com/
References: 03-01-163 03-01-165
Keywords: lex, yacc
Posted-Date: 29 Jan 2003 23:43:50 EST

>
> function extract1()
> {
> FIELDWIDTHS = "3 2 5 7" # whatever
> $0 = $0 # force $0 to be reparsed
> amount = $2
> customer = $3 # assign fields to variables for readability
> # ...
> }
>
> function logic1()
> {
> if (amount == 42 && customer == "whatever)
> ...
> }




First, thanks for taking time to read/think and respond.


My intention of investigating the possibility of yacc was to see if
the processing logic can be taken off the program to configuration *in
a minimal way*.


Since these rulesets are very probably to change frequently, I didn t
want a programmer to be involved to change the processing logic. I
wanted an admin guy to change teh configuration file to reflect this.
Since teh syntax for teh rulesset is very simple ( Field() etc. kind
of syntax ), he can easily change it without being a full fledged
programmer. So I thought I can write a program that will parse the
configuration file with lex/yacc and then will have the intelligence
to rewire its logic ( function pointers, containers with functors
etc. ) accordingly, so that a given datafile will be processed as
specified in the configuration file.


But I have reached the conclusion that its much easier to do it in a
straight forward/uncool/ugly/hard coded logic/conventional way and
that the extra time required to go the first path might not be
justifiable in the end


Thanks again
--sony


Post a followup to this message

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