I have searched Google and likely Perl sites in vain; I now ask my fellow Monks before I do some heavy manual lifting.

My task is to do a bunch of UCA (unfamiliar code analysis) on several huge repositories of Ada95 and GNAT source code files. In UCA cases, we often don't know what a given program does, or what it might depend on, or even if it will build successfully. Rarely is there documentation to be found.

A very helpful technique I've employed in UCA missions involving FORTRAN and C++ is to partially parse each source file, and generate a call-tree graph. I then pump that graph through a color-coded GraphViz template. Some hand-tweaking of that graph can bring order from chaos, at least enough to figure out the scope of complexity and interaction in a given codebase.

I am not very familiar with Ada code in practice, but most of it can be read for the basics after a one-day primer on the web. The real and complete Ada language appears to be pretty darn tricky to parse, however, when you get into all of the various historical tweaks. The best LALR grammar I've found is Ada Home's Ada95 LALR Grammar. It's not complete, though, since some of the rule names are not actually defined here.

Before I go through the trouble of converting that LALR grammar to something that Parse::RecDescent can parse, even partially, I ask if anyone else has something better than the aforementioned grammar, for use with Perl. Even if it's not RecDescent, anything Perl would help immensely.

I'll publish the working PRD version if I have to build it myself. I wish there were a central place where people could publish useful PRD grammars, besides maybe the CPAN Inline:: namespace.

--
[ e d @ h a l l e y . c c ]


In reply to Parse::RecDescent Ada95 Grammar? by halley

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.