[apt4ssx8] Re: APT Grammar

  • From: "Kent A. Reed" <kentallanreed@xxxxxxxxx>
  • To: apt4ssx8@xxxxxxxxxxxxx
  • Date: Thu, 21 Jun 2012 22:45:01 -0400

On 6/21/2012 2:27 PM, Brent Muller wrote:
On 6/21/2012 9:56 AM, Kent A. Reed wrote:
Gentle persons:

<...>

Toward this end, I've started a page on the APT Grammar and have included a file containing all the syntactic productions in the Brown et al. paper. It represents a major subset of APT 3 and will be my basis for building an APT360 grammar.

Regards,
Kent



Some of you might have the ANSI standard that is available for the Apt grammar. As you may know if you have it, it follows the Backus-Naur format. When I started Aptos, I originally was going to create a language based on this document. That got dropped when the apt360 source showed up.


Brent:

This brings up a tricky point that I have dithered around.

Because we have a working APT system in the form of APT360, I am most interested in working on tools that know its flavor of APT. I assume that this (APT4) flavor is best captured in the 1977 version of ANSI X3.37 but I haven't seen that version (yet) so I can't confirm this is a reasonable assumption. In the meantime, I think I can continue inching forward by working from the older, partial grammar I just posted and the contents of the APT360 manual y'all so niftily put together.

On the other hand, I can tell there are those who want to move beyond technology that was current when Jimmie Carter occupied the White House! I do own a copy of ANSI INCTS X3.37-1999. Frankly, I'm put off by its "modernity" as well as its reliance on two ISO standards that are outrageously expensive for an over-the-hill hobbyist. If I had access to a working APT system that obeyed this version's rules I would be more motivated to pursue it.

I mention this because I have the outlines of a parser in the Aptos code. It already does quite a bit of the ANSI syntax, and creates a parse tree using Yacc.


I mention on my APT Grammar page a "software tool to be named later." It probably would not be drawn from the Lex/Flex Yacc/Bison stable just because I remember the pain using them in the early days of STEP. I've been looking over the current choices. Also, I'd rather use tools that fit easily into a Python working environment because I was never a C++ coder and I've forgotten much of what I used to know about C.

For all that, Yacc/Bison may turn out to still be Hobson's choice.

Of course, this is just me bellyaching:-) Any language is the right language if it gets the job done.

I mention this because it might serve as a starting point if we were interested in completing or extending the grammar. I don't know that I would have the energy to do it myself, but I would love to see some of the modern language techniques mentioned in the Ansi standard implemented. It might give us a starting point. It is in C++, with the Yacc in C, of course. Whatever language we use, the Yacc file might give us a base.


Like I said, I can tell there are others who want the latest goodies in APT!

I guess my real concern is that Yacc heavily weights the scale toward LALR(1) derivation and users tend to skew their grammars to suit, fixing all those shift-reduce and reduce-reduce conflicts, for example. I'd like to postpone the choice of derivation as long as possible. I'm hoping to develop a grammar that can be poured into various compiler compilers without too much handwork. This may be a fool's errand, but we'll see.

Now that I've waved my prejudice around, I'll say that comparing what you've already done with what I'm trying to do (and with my understanding of ANSI X3.37-1999) would be interesting. Is your grammar anywhere I can see it?

After learning about how apt360 works, I have an idea on how the front-end of a new Apt compiler might be implemented. As you might guess, the section 1 code is mostly parsing and geometry calculation; the hard stuff is in section 2, and that is when I asked an industry insider for some info, and he sent me the apt360 code. The separation between the two sections is very clean, and a front-end could be tacked on quite easily. If anyone is interested, I could go into more detail on this.

Of course. Lay on MacDuff! I'm sure it's obvious to you that my current interests lie more in the realm of what the APT folk called section 1---things like an APT part-program syntax verifier and geometry checker.

If I didn't say it before, I'll say it now, like you I think section 1 is just the tip of the iceberg. The other 7/8ths of the job lie out of my sight.


As an aside, I am glad to not be the lead on this project- I am quite happy to be a coder, and think other people could do the leadership part better, so please don't think I would have any problems with us starting with any part of the Aptos base for a parser.


Well, I"m not trying to be a leader here either (reminds me of Alphonse and Gaston --- http://en.wikipedia.org/wiki/Alphonse_and_Gaston) but I *always* have ideas, sometimes they even survive first contact with the sun.

Do you have a place to post your aptos code base? sourceforge, the aptos wiki, google site, etc.?

Brent.




Thanks, Brent.

Regards,
Kent


Other related posts: