<!-- saved from url=(0022)http://internet.e-mail --> <html> <head> <meta http-equiv="Content-Language" content="en-us"> <title>MParse Task</title> </head> <body> <h2><a name="mparse">MParse</a></h2> <p>by</p> <ul> <li>Stephane Bailliez (<a href="mailto:sbailliez@imediation.com">sbailliez@imediation.com</a>)</li> </ul> <h3>Requirements</h3> <p>This task requires Metamata Development environment 2.0 freely available at <a href="http://www.metamata.com">Metamata</a>.</p> <h3>Description</h3> <p> Invokes the Metamata <a HREF="http://www.metamata.com/parse.html">MParse</a> compiler compiler on a grammar file. </p> <p> To use the <i>mparse</i> task, set the <i>target</i> attribute to the name of the grammar file to process. You also need to specify the directory containing the Metamata installation using the <i>metamatahome</i> attribute, so that Ant can find the MParse classes. </p> <p> 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. </p> <p>For additional information about MParse, please consult the online manual available <a href="http://download.metamata.com/parse.pdf">here</a> (PDF) </p> <h3>Parameters</h3> <table border="1" cellpadding="2" cellspacing="0"> <tr> <td valign="top"><b>Attribute</b></td> <td valign="top"><b>Description</b></td> <td align="center" valign="top"><b>Required</b></td> </tr> <tr> <td valign="top">target</td> <td valign="top">The .jj grammar file to process. It will only be processed if the grammar is newer than the corresponding .java file.</td> <td valign="top" align="center">Yes</td> </tr> <tr> <td valign="top">metamatahome</td> <td valign="top">The home directory containing the Metamata distribution.</td> <td valign="top" align="center">Yes</td> </tr> <tr> <td valign="top">verbose</td> <td valign="top"> Enable all messages </td> <td valign="top" align="center">No</td> </tr> <tr> <td valign="top">debugparser</td> <td valign="top"> Enables parser debugging </td> <td valign="top" align="center">No</td> </tr> <tr> <td valign="top">debugscanner</td> <td valign="top"> Enables scanner debugging </td> <td valign="top" align="center">No</td> </tr> <tr> <td valign="top">cleanup</td> <td valign="top">Remove the intermediate Sun JavaCC file created during the transformation of the grammar file.</td> <td valign="top" align="center">No. Default to false</td> </tr> <tr> <td valign="top">maxmemory</td> <td valign="top">Set the maximum memory for the JVM. this is a convenient way to set the -mx or -Xmx argument.</td> <td valign="top" align="center">No</td> </tr> </table> <h3>Nested elements</h3> <h4>jvmarg</h4> <p>Additional parameters may be passed to the VM via nested <code><jvmarg></code> attributes. <code><jvmarg></code> allows all attributes described in <a href="../using.html#arg">Command line arguments</a>.</p> <h4>classpath</h4> <p>Sets class path (also source path unless one explicitly set). Overrides METAPATH/CLASSPATH environment variables. The <tt>classpath</tt> element represents a <a href="../using.html#path">PATH like structure</a>.</p> <h4>sourcepath</h4> <p>Sets source path. Overrides the SOURCEPATH environment variable. The <tt>sourcepath</tt> element represents a <a href="../using.html#path">PATH like structure</a>.</p> <h3>Example</h3> <pre> <mparse target="c:/metamata/examples/parseexamples/javagrammars/singlefile/JavaParser.jj" metamatahome="c:/metamata" cleanup="true"> <classpath> <pathelement location="c:/metamata/examples/"/> </classpath> </mparse></pre> <p> This invokes Metamata MParse installed in <tt>c:/metamata</tt> on one of the grammar file example <tt>(JavaParser.jj)</tt> and cleans up the intermediate Sun JavaCC file. </p> <hr> <p align="center">Copyright © 2001,2004 The Apache Software Foundation. All rights Reserved.</p> </body> </html>