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 4.2 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <!-- saved from url=(0022)http://internet.e-mail -->
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Language" content="en-us">
  5. <title>MParse Task</title>
  6. </head>
  7. <body>
  8. <h2><a name="mparse">MParse</a></h2>
  9. <p>by</p>
  10. <ul>
  11. <li>Stephane Bailliez (<a href="mailto:sbailliez@imediation.com">sbailliez@imediation.com</a>)</li>
  12. </ul>
  13. <h3>Requirements</h3>
  14. <p>This task requires Metamata Development environment 2.0 freely available at <a href="http://www.metamata.com">Metamata</a>.</p>
  15. <h3>Description</h3>
  16. <p>
  17. Invokes the Metamata <a HREF="http://www.metamata.com/parse.html">MParse</a> compiler
  18. compiler on a grammar file.
  19. </p>
  20. <p>
  21. To use the <i>mparse</i> task, set the <i>target</i> attribute to the name of the
  22. grammar file to process. You also need to specify the directory containing
  23. the Metamata installation using the <i>metamatahome</i> attribute, so that Ant
  24. can find the MParse classes.
  25. </p>
  26. <p>
  27. This task only invokes MParse if the grammar file is newer than the generated
  28. Java files. MParse assumes that the Java class name of the generated parser
  29. is the same as the name of the grammar file, less the .jj extension.
  30. </p>
  31. <p>For additional information about MParse, please consult the online manual available <a href="http://download.metamata.com/parse.pdf">here</a>
  32. (PDF)
  33. </p>
  34. <h3>Parameters</h3>
  35. <table border="1" cellpadding="2" cellspacing="0">
  36. <tr>
  37. <td valign="top"><b>Attribute</b></td>
  38. <td valign="top"><b>Description</b></td>
  39. <td align="center" valign="top"><b>Required</b></td>
  40. </tr>
  41. <tr>
  42. <td valign="top">target</td>
  43. <td valign="top">The .jj grammar file to process. It will only be processed
  44. if the grammar is newer than the corresponding .java file.</td>
  45. <td valign="top" align="center">Yes</td>
  46. </tr>
  47. <tr>
  48. <td valign="top">metamatahome</td>
  49. <td valign="top">The home directory containing the Metamata distribution.</td>
  50. <td valign="top" align="center">Yes</td>
  51. </tr>
  52. <tr>
  53. <td valign="top">verbose</td>
  54. <td valign="top">
  55. Enable all messages
  56. </td>
  57. <td valign="top" align="center">No</td>
  58. </tr>
  59. <tr>
  60. <td valign="top">debugparser</td>
  61. <td valign="top">
  62. Enables parser debugging
  63. </td>
  64. <td valign="top" align="center">No</td>
  65. </tr>
  66. <tr>
  67. <td valign="top">debugscanner</td>
  68. <td valign="top">
  69. Enables scanner debugging
  70. </td>
  71. <td valign="top" align="center">No</td>
  72. </tr>
  73. <tr>
  74. <td valign="top">cleanup</td>
  75. <td valign="top">Remove the intermediate Sun
  76. JavaCC file created during the transformation of the grammar file.</td>
  77. <td valign="top" align="center">No. Default to false</td>
  78. </tr>
  79. <tr>
  80. <td valign="top">maxmemory</td>
  81. <td valign="top">Set the maximum memory for the JVM. this is a convenient
  82. way to set the -mx or -Xmx argument.</td>
  83. <td valign="top" align="center">No</td>
  84. </tr>
  85. </table>
  86. <h3>Nested elements</h3>
  87. <h4>jvmarg</h4>
  88. <p>Additional parameters may be passed to the VM via nested <code>&lt;jvmarg&gt;</code>
  89. attributes. <code>&lt;jvmarg&gt;</code> allows all attributes described in <a href="../using.html#arg">Command
  90. line arguments</a>.</p>
  91. <h4>classpath</h4>
  92. <p>Sets class path (also source path unless one explicitly set). Overrides
  93. METAPATH/CLASSPATH environment variables. &nbsp;The <tt>classpath</tt> element represents a <a href="../using.html#path">PATH like
  94. structure</a>.</p>
  95. <h4>sourcepath</h4>
  96. <p>Sets source path. Overrides the SOURCEPATH environment variable.&nbsp;The <tt>sourcepath</tt> element represents a <a href="../using.html#path">PATH like
  97. structure</a>.</p>
  98. <h3>Example</h3>
  99. <pre> &lt;mparse target=&quot;c:/metamata/examples/parseexamples/javagrammars/singlefile/JavaParser.jj&quot;
  100. metamatahome=&quot;c:/metamata&quot; cleanup=&quot;true&quot;&gt;
  101. &lt;classpath&gt;
  102. &lt;pathelement location=&quot;c:/metamata/examples/&quot;/&gt;
  103. &lt;/classpath&gt;
  104. &lt;/mparse&gt;</pre>
  105. <p>
  106. This invokes Metamata MParse installed in <tt>c:/metamata</tt> on one of the grammar file
  107. example <tt>(JavaParser.jj)</tt>
  108. and cleans up the intermediate Sun JavaCC file.
  109. </p>
  110. <hr>
  111. <p align="center">Copyright &copy; 2001,2004 The Apache Software Foundation. All rights
  112. Reserved.</p>
  113. </body>
  114. </html>