Home
Name Modified Size InfoDownloads / Week
README 2011-03-22 1.7 kB
makefile 2011-03-22 1.7 kB
COPYING.LESSER 2011-03-22 7.7 kB
COPYING 2011-03-22 35.1 kB
airimp_yacc.y 2011-03-22 7.6 kB
airimp_scanner.c 2011-03-22 30.3 kB
airimp_driver.c 2011-03-22 2.2 kB
airimp_scanint.h 2011-03-22 1.8 kB
Totals: 8 Items   88.2 kB 0
These files are a scanner and parser for the AIRIMP language, version 31 (2007).  As
the 2011 edition will appear relatively soon, we will wait for that before updating
this code to the newest version.

Unix has great tools for creating scanners and parsers.  Notable among them are Yacc
and Lex (and their descendents in the open source community).  

The problem is that Yacc only works for a LR(1) language with disambiguation rules 
and it doesn't appear to me that AIRIMP is entirely LR(1).  But although the Yacc
syntax is certainly not readable by computer amateurs, it's still something that
is very familiar to a lot of people and I would like to use.

So a compromise of sorts is required.  This compromise will have a few elements:

1. The scanner will be written in C rather than Lex.  Lex is the weaker of the two
programs and also the one that generates the least efficient code.

2. Some decisions (things like whether a three letter abbreviation is a valid city
code, for example) will be done in the scanner in C code, effectively making that
part of the semantic analysis.

3. Some fumbling around with yyerror in the yacc code is likely going to be required;
this will be rather obscure but, hopefully, once it works, it won't need to be looked
at often.

Note also that the scanner and parser are not, by themselves, a complete product.  
That is why they are being released under the Lesser GPL rather than the more 
restrictive regular GPL.  It is possible that once updated, the new scanner and 
parser will be quickly incorporated into a full usable product.  In that case, be 
aware that the license may change for the updated code.

Richard A Karp
Feburary, 2011 
Source: README, updated 2011-03-22