Listing 1 First guess at an unknown grammar

{
/*
 File:   CONV.SYN - AnaGram syntax file for
                conversion program;
        Version 1
/*
#include "string.h"
#include "convutil.h"
}
[
  parser file name = "conv.cpp"
]

grammar
 -> record?..., eof

(void) record
 -> valid record, newline                  =cleanUp();
 -> bad data, newline                      =cleanUp();

bad data
 -> error               =wrError(PCB.line, PCB.column);

(void) valid record
 -> "class", attribute list                =putClass();
 -> "instanceVariable",
      attribute list           =putInstanceVariable();
// six other record types handled similarly

attribute list
 -> tab, attribute
 -> attribute list, tab, attribute

(void) attribute
 -> "name@", value:a                   =atAdd(NAME, a);
 -> "file@", value:a                  =atAdd(FILEN, a);
 -> "line@", value:a                   =atAdd(LINE, a);
// twelve other attribute types handled similarly

(char *) value
 -> value contents                          =release();

(void) value contents
 -> value char:c                      =collectFirst(c);
 -> value contents, value char:c           =collect(c);

// =============== lexical definitions ================
eof              = -1 + 0 + ^Z
newline          = '\n'
tab              = '\t'
value char       = ~(eof + tab + '@' + newline)

// Supporting C++ code follows
{
int main(int argc, char * argv[]) {
  if (FALSE == setErrorFile(argv[1])) {
    fprintf(stderr, "Couldn't open error file\n");
    return 1;
  }
  conv();
  return 0;
}
}

/* End of File */