jdt-core-home/howto/generate parser/generateParser.html

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1, Wed Jul 24 14:38:41 2002 UTC revision 1.2, Fri Jun 13 09:42:23 2003 UTC
# Line 151  Line 151 
151   </tr>   </tr>
152   <tr>   <tr>
153  <th VALIGN=top align=left>javasym.java</th>  <th VALIGN=top align=left>javasym.java</th>
154   <td>This is the contents of the class org.eclipse.jdt.core.compiler.ITerminalSymbols. You need to replace:<br>   <td>This is the contents of the class org.eclipse.jdt.core.compiler.TerminalTokens. You need to replace:<br>
155   <ul>   <ul>
156   <li>TokenName$eof with TokenNameEOF</li>   <li>TokenName$eof with TokenNameEOF</li>
157   <li>TokenName$error with TokenNameERROR</li>   <li>TokenName$error with TokenNameERROR</li>
# Line 172  Line 172 
172   <ol>   <ol>
173   <li>Copy the contents of the <font color="#3366FF">JavaAction.java</font> file into the <font color="#3366FF">consumeRule(int)</font> method of the org.eclipse.jdt.internal.compiler.parser.Parser class.   <li>Copy the contents of the <font color="#3366FF">JavaAction.java</font> file into the <font color="#3366FF">consumeRule(int)</font> method of the org.eclipse.jdt.internal.compiler.parser.Parser class.
174   </li>   </li>
175   <li>The definition of the Parser needs to be updated with two tables from <font color="#3366FF">javadcl.java</font>. Those are <font color="#3366FF">rhs[]</font> and <font color="#3366FF">name[]</font>.   <li>The definition of the Parser needs to be updated with three tables from <font color="#3366FF">javadcl.java</font>. Those are <font color="#3366FF">rhs[]</font>, <font color="#3366FF">name[]</font> and <font color="#3366FF">scope_la[]</font>.
176   The following entries in name[] need to be replaced:   The following entries in name[] need to be replaced:
177   <ul>   <ul>
178   <li><font color="#3366FF">$eof</font> with <font color="#3366FF">UNEXPECTED_EOF</font></li>   <li><font color="#3366FF">$eof</font> with <font color="#3366FF">UNEXPECTED_EOF</font></li>
# Line 182  Line 182 
182   </li>   </li>
183   <li>The class <font color="#3366FF">org.eclipse.jdt.internal.compiler.parser.ParserBasicInformation</font> needs to be updated with the content of the file <font color="#3366FF">javadef.java</font>. Don't copy the   <li>The class <font color="#3366FF">org.eclipse.jdt.internal.compiler.parser.ParserBasicInformation</font> needs to be updated with the content of the file <font color="#3366FF">javadef.java</font>. Don't copy the
184   interface name. Simply copy the field declarations. The actual source of this class will guide you.</li>   interface name. Simply copy the field declarations. The actual source of this class will guide you.</li>
185   <li>This is the contents of the class org.eclipse.jdt.internal.compiler.parser.TerminalSymbols. You need to replace:<br>   <li>This is the contents of the class org.eclipse.jdt.internal.compiler.parser.TerminalTokens. You need to replace:<br>
186   <ul>   <ul>
187   <li><font color="#3366FF">TokenName$eof</font> with <font color="#3366FF">TokenNameEOF</font></li>   <li><font color="#3366FF">TokenName$eof</font> with <font color="#3366FF">TokenNameEOF</font></li>
188   <li><font color="#3366FF">TokenName$error</font> with <font color="#3366FF">TokenNameERROR</font></li>   <li><font color="#3366FF">TokenName$error</font> with <font color="#3366FF">TokenNameERROR</font></li>
# Line 192  Line 192 
192   Copy the jdtcore.jar file in d:\temp. Compile this <A HREF="UpdateParserFiles.java">source</A> inside d:\temp. You will have a file UpdateParserFiles.class.   Copy the jdtcore.jar file in d:\temp. Compile this <A HREF="UpdateParserFiles.java">source</A> inside d:\temp. You will have a file UpdateParserFiles.class.
193   Then run the following command-line:   Then run the following command-line:
194    <PRE>    <PRE>
195   D:\temp>java -classpath jdtcore.jar;. UpdateParserFiles javadcl.java   D:\temp>java -classpath jdtcore.jar:. UpdateParserFiles javadcl.java
196   </PRE>   </PRE>
197  Once this done, you will end up with 5 new files inside d:\temp. They are called parser&lt;n&gt;.rsc, with n equals to 1..5.  Once this done, you will end up with 16 new files inside d:\temp. They are called parser&lt;n&gt;.rsc, with n equals to 1..16.
198  All these files need to be moved to the org\eclipse\jdt\internal\compiler\parser folder. Now you are ready to execute and test  All these files need to be moved to the org\eclipse\jdt\internal\compiler\parser folder. Now you are ready to execute and test
199  the new parser.  the new parser.
200   </li>   </li>

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2