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

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