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/
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.