MParse

Requirements

This task requires Metamata Development environment 1.1. It does not work as is with the latest 2.0 version freely available at Metamata.

Description

Invokes the Metamata MParse compiler compiler on a grammar file.

To use the mparse task, set the target attribute to the name of the grammar file to process. You also need to specify the directory containing the Metamata installation using the metamatahome attribute, so that Ant can find the MParse classes.

This task only invokes MParse if the grammar file is newer than the generated Java files. MParse assumes that the Java class name of the generated parser is the same as the name of the grammar file, less the .jj extension.

For additional information about MParse, please consult the online manual available here (PDF)

Parameters

Attribute Description Required
target The .jj grammar file to process. It will only be processed if the grammar is newer than the corresponding .java file. Yes
metamatahome The home directory containing the Metamata distribution. Yes
workingdir The temporary directory used by MParse. Yes
cleanuphack Remove the stale file as well as the intermediate Sun JavaCC file created during the transformation of the grammar file. No. Default to false.

Nested elements

userclasspath

 The userclasspath element is required and represents a PATH like structure.

Example

  <mparse target="src/Parser.jj" metamatahome="c:/metamata" workingdir="c:/tmp">
    <userclasspath>
      <pathelement location="./lib/dependency.jar"/>
    </userclasspath>
  </mparse>

This invokes Metamata MParse installed in c:/metamata on a grammar file src/Parser.jj with a working directory in c:/tmp and a specific classpath