1
<!-- saved from url=(0022)http://internet.e-mail -->
5
<meta http-equiv="Content-Language" content="en-us">
6
<title>MParse Task</title>
11
<h2><a name="mparse">MParse</a></h2>
14
<li>Stephane Bailliez (<a href="mailto:sbailliez@imediation.com">sbailliez@imediation.com</a>)</li>
17
<p>This task requires Metamata Development environment 2.0 freely available at <a href="http://www.metamata.com">Metamata</a>.</p>
20
Invokes the Metamata <a HREF="http://www.metamata.com/parse.html">MParse</a> compiler
21
compiler on a grammar file.
24
To use the <i>mparse</i> task, set the <i>target</i> attribute to the name of the
25
grammar file to process. You also need to specify the directory containing
26
the Metamata installation using the <i>metamatahome</i> attribute, so that Ant
27
can find the MParse classes.
30
This task only invokes MParse if the grammar file is newer than the generated
31
Java files. MParse assumes that the Java class name of the generated parser
32
is the same as the name of the grammar file, less the .jj extension.
35
<p>For additional information about MParse, please consult the online manual available <a href="http://download.metamata.com/parse.pdf">here</a>
40
<table border="1" cellpadding="2" cellspacing="0">
42
<td valign="top"><b>Attribute</b></td>
43
<td valign="top"><b>Description</b></td>
44
<td align="center" valign="top"><b>Required</b></td>
47
<td valign="top">target</td>
48
<td valign="top">The .jj grammar file to process. It will only be processed
49
if the grammar is newer than the corresponding .java file.</td>
50
<td valign="top" align="center">Yes</td>
53
<td valign="top">metamatahome</td>
54
<td valign="top">The home directory containing the Metamata distribution.</td>
55
<td valign="top" align="center">Yes</td>
58
<td valign="top">verbose</td>
62
<td valign="top" align="center">No</td>
65
<td valign="top">debugparser</td>
67
Enables parser debugging
69
<td valign="top" align="center">No</td>
72
<td valign="top">debugscanner</td>
74
Enables scanner debugging
76
<td valign="top" align="center">No</td>
79
<td valign="top">cleanup</td>
80
<td valign="top">Remove the intermediate Sun
81
JavaCC file created during the transformation of the grammar file.</td>
82
<td valign="top" align="center">No. Default to false</td>
85
<td valign="top">maxmemory</td>
86
<td valign="top">Set the maximum memory for the JVM. this is a convenient
87
way to set the -mx or -Xmx argument.</td>
88
<td valign="top" align="center">No</td>
91
<h3>Nested elements</h3>
93
<p>Additional parameters may be passed to the VM via nested <code><jvmarg></code>
94
attributes. <code><jvmarg></code> allows all attributes described in <a href="index.html#arg">Command
95
line arguments</a>.</p>
97
<p>Sets class path (also source path unless one explicitly set). Overrides
98
METAPATH/CLASSPATH environment variables. The <tt>classpath</tt> element represents a <a href="index.html#path">PATH like
101
<p>Sets source path. Overrides the SOURCEPATH environment variable. The <tt>sourcepath</tt> element represents a <a href="index.html#path">PATH like
104
<pre> <mparse target="c:/metamata/examples/parseexamples/javagrammars/singlefile/JavaParser.jj"
105
metamatahome="c:/metamata" cleanup="true">
107
<pathelement location="c:/metamata/examples/"/>
109
</mparse></pre>
111
This invokes Metamata MParse installed in <tt>c:/metamata</tt> on one of the grammar file
112
example <tt>(JavaParser.jj)</tt>
113
and cleans up the intermediate Sun JavaCC file.