You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

mparse.html 2.9 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Language" content="en-us">
  4. <title>JavaCC Task</title>
  5. </head>
  6. <body>
  7. <h2><a name="javacc">MParse</a></h2>
  8. <h3>Requirements</h3>
  9. <p>This task requires Metamata Development environment 1.1. It does not work as
  10. is with the latest 2.0 version freely available at <a href="http://www.metamata.com">Metamata</a>.</p>
  11. <h3>Description</h3>
  12. <p>
  13. Invokes the Metamata <a HREF="http://www.metamata.com/parse.html">MParse</a> compiler
  14. compiler on a grammar file.
  15. </p>
  16. <p>
  17. To use the <i>mparse</i> task, set the <i>target</i> attribute to the name of the
  18. grammar file to process. You also need to specify the directory containing
  19. the Metamata installation using the <i>metamatahome</i> attribute, so that Ant
  20. can find the MParse classes.
  21. </p>
  22. <p>
  23. This task only invokes MParse if the grammar file is newer than the generated
  24. Java files. MParse assumes that the Java class name of the generated parser
  25. is the same as the name of the grammar file, less the .jj extension.
  26. </p>
  27. <p>For additional information about MParse, please consult the online manual available <a href="http://download.metamata.com/parse.pdf">here</a>
  28. (PDF)
  29. </p>
  30. <h3>Parameters</h3>
  31. <table border="1" cellpadding="2" cellspacing="0">
  32. <tr>
  33. <td valign="top"><b>Attribute</b></td>
  34. <td valign="top"><b>Description</b></td>
  35. <td align="center" valign="top"><b>Required</b></td>
  36. </tr>
  37. <tr>
  38. <td valign="top">target</td>
  39. <td valign="top">The .jj grammar file to process. It will only be processed
  40. if the grammar is newer than the corresponding .java file.</td>
  41. <td valign="top" align="center">Yes</td>
  42. </tr>
  43. <tr>
  44. <td valign="top">metamatahome</td>
  45. <td valign="top">The home directory containing the Metamata distribution.</td>
  46. <td valign="top" align="center">Yes</td>
  47. </tr>
  48. <tr>
  49. <td valign="top">workingdir</td>
  50. <td valign="top">
  51. The temporary directory used by MParse.
  52. </td>
  53. <td valign="top" align="center">Yes</td>
  54. </tr>
  55. <tr>
  56. <td valign="top">cleanuphack</td>
  57. <td valign="top">Remove the stale file as well as the intermediate Sun
  58. JavaCC file created during the transformation of the grammar file.</td>
  59. <td valign="top" align="center">No. Default to false.</td>
  60. </tr>
  61. </table>
  62. <h3>Nested elements</h3>
  63. <h4>userclasspath</h4>
  64. <p>&nbsp;The <tt>userclasspath</tt> element is required and represents a <a href="index.html#path">PATH like
  65. structure</a>.</p>
  66. <h3>Example</h3>
  67. <pre> &lt;mparse target=&quot;src/Parser.jj&quot; metamatahome=&quot;c:/metamata&quot; workingdir=&quot;c:/tmp&quot;&gt;
  68. &lt;userclasspath&gt;
  69. &lt;pathelement location=&quot;./lib/dependency.jar&quot;/&gt;
  70. &lt;/userclasspath&gt;
  71. &lt;/mparse&gt;</pre>
  72. <p>
  73. This invokes Metamata MParse installed in <tt>c:/metamata</tt> on a grammar file <tt>src/Parser.jj</tt>
  74. with a working directory in <tt>c:/tmp</tt> and a specific classpath
  75. </p>
  76. <hr>