Perl: the Markov chain saw | |
PerlMonks |
Maintaining horrible C with Parse::RecDescentby isotope (Deacon) |
on Mar 15, 2002 at 01:43 UTC ( [id://151883]=perlquestion: print w/replies, xml ) | Need Help?? |
isotope has asked for the wisdom of the Perl Monks concerning the following question:
Today I was reminded of why I chose EE instead of CS in college. I have been asked to undertake a particular project at work. We are currently developing an embedded system, based on work we inherited from our sibling company in Japan. Along with all the hardware documentation and prototypes, they provided us with some sample source code. Unfortunately, the original programmers didn't follow the coding standards we take for granted in the US, and our management decided that we didn't have enough time to develop new software from scratch. As a result, we're using that old, horribly messy code, with all its pitfalls and limitations. We have brought it to the point where it actually works pretty well, but as we add new features, we run into major hurdles. This is where my project sprang up. The source code features massive arrays of arrays of arrays of arrays... and so on. These arrays contain inital data describing the termination points in our system (for any of you in the telecommunications industry), of which there are many thousands. In our development, we need to add some new elements to these deeply nested arrays, and I, being dumb enough to admit I know how to program in Perl, have been assigned the task of automating that (rather than spending the next few years of my life doing it by hand). So, in a fit of insanity I started writing a parser. Fortunately, I noticed the insanity only an hour or two into the process, and started looking around. I read about Parse::RecDescent and realized that this is probably what I need to use. But, first, I'm going to need a C grammar. In short, I've looked around, but I haven't found any ready to drop into P::RD. Now, to ask a question. Am I on the right track using Parse::RecDescent and trying to modify a readily available grammar, or is there another approach I should try? --isotope http://www.skylab.org/~isotope/
Back to
Seekers of Perl Wisdom
|
|