[Document procedure for using a GF grammar. bjorn@bringert.net**20041206125241] < > { hunk ./doc/gf-java.html 60 +

Producing a grammar for the interpreter

+ +

+The GF interpreter needs two representations of the grammar to do +linearization and parsing. These two representations can be generated +from a GF source grammar by using the +GF system. +This example assumes that we have the concrete syntax modules +TestEng and TestSwe. +

+ +
    + +
  1. +

    +Load all the source modules into GF: +

    +
    +> i TestEng.gf
    +> i TestSwe.gf
    +
    +
  2. +
  3. +

    +Create a GFCM file: +

    +
    +> pm -utf8 -printer=header | wf test.gfcm
    +
    +
  4. +
  5. +

    +Create a CFGM file: +

    +
    +> pm -utf8 -printer=cfgm | wf test.cfgm
    +
    +
  6. +
  7. +

    +Create a properties file (here test.properties) so that the interpreter can find +these files: +

    +
    +$ cat > test.properties <<PROP
    +name: test
    +gfcm: test.gfcm
    +cfgm: test.cfgm
    +PROP
    +
    +
  8. + +
+ +

See the +build-gramlet +script for an example of how to do this automatically.

+ hunk ./doc/gf-java.html 125 -is a demo applet which uses the Java GF -interpreter and the GF numerals +is a demo applet which uses the Java GF interpreter and the GF numerals hunk ./doc/gf-java.html 148 -

Struct names are case-insensitive in OAA. This means that we cannot handle functions whose names differ only in case.

+

+Struct names are case-insensitive in OAA. This means that we cannot +handle functions whose names differ only in case. +

hunk ./test.html 16 +

+The source code for the applet is included with the +Java +GF interpreter source code. +

+ }