Title: [PATCH] MParse

I sent this message yesterday but it looks like our mail server sent this message to /dev/null since it does not appears on the list. Probably due to the virus panic here. I'm reposting it.

----------

Conor,

MParse task has been completely rewritten to support 2.0 version and provide additional flexibility if needed (VM arguments and memory to override default metamata properties).

It works fine on my computer with the example given in the documentation.
Documentation is fully updated as well.

If you choose to ship the previous version, there are some glitches in the documentation, html title is set to JavaCC as well as the href on the MParse task. Sorry I was quite fast at writing it. :(

IMHO I don't think we should ship the old version since the mparse 1.1 is not available anymore and it is totally deprecated as of now.

I'm sending the mail to Louis Tribble in BCC(hope you don't mind Louis), so that he can speak out loud and confirm/infirm this and pinpoints some stupid assumptions in my code.

Cheers,


--
 St�phane Bailliez
 Software Engineer, Paris - France
 iMediation - http://www.imediation.com
 Disclaimer: All the opinions expressed above are mine and not those from my company.

 

Attachment: MParse.java
Description: Binary data

Title: MParse Task

MParse

by

Requirements

This task requires Metamata Development environment 2.0 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
verbose Enable all messages No
debugparser Enables parser debugging No
debugscanner Enables scanner debugging No
cleanup Remove the intermediate Sun JavaCC file created during the transformation of the grammar file. No. Default to false
maxmemory Set the maximum memory for the JVM. this is a convenient way to set the -mx or -Xmx argument. No

Nested elements

jvmarg

Additional parameters may be passed to the VM via nested <jvmarg> attributes. <jvmarg> allows all attributes described in Command line arguments.

classpath

Sets class path (also source path unless one explicitly set). Overrides METAPATH/CLASSPATH environment variables.  The classpath element represents a PATH like structure.

sourcepath

Sets source path. Overrides the SOURCEPATH environment variable. The sourcepath element represents a PATH like structure.

Example

  <mparse target="c:/metamata/examples/parseexamples/javagrammars/singlefile/JavaParser.jj"
          metamatahome="c:/metamata" cleanup="true">
    <classpath>
      <pathelement location="c:/metamata/examples/"/>
    </classpath>
  </mparse>

This invokes Metamata MParse installed in c:/metamata on one of the grammar file example (JavaParser.jj) and cleans up the intermediate Sun JavaCC file.





Reply via email to