### Eclipse Workspace Patch 1.0 #P jdt-core-home Index: howto/generate parser/generateParser.html =================================================================== RCS file: /cvsroot/eclipse/jdt-core-home/howto/generate parser/generateParser.html,v retrieving revision 1.6 diff -u -r1.6 generateParser.html --- howto/generate parser/generateParser.html 26 Sep 2006 07:58:10 -0000 1.6 +++ howto/generate parser/generateParser.html 12 Oct 2006 14:54:48 -0000 @@ -29,7 +29,7 @@ Where to get the grammar
-
The latest grammar is always located in the java_1_5.g file. Go to the org.eclipse.jdt.core plugins +
The latest grammar is always located in the java_1_5.g file. (N.B.: Older versions of the grammar, such as java_1_4.g are not supported and are no longer functional.) Go to the org.eclipse.jdt.core plugins directory (eclipse\plugins\org.eclipse.jdt.core where eclipse is the root of your eclipse installation) and open the grammar directory. Then search for the java_1_5.g file inside the folder grammar. Then copy its contents from: @@ -40,7 +40,8 @@ -- need a carriage return after the $end into a file called java.g. It is important to add a carriage return at the end of the last line. - You can save this file where you want, we will assume from thereon you saved it in d:\temp\. + You can save this file where you want, we will assume from thereon you saved it in d:\temp\. + Also make sure that the file has Unix-style end-of-line characters (i.e., not those of MS-DOS), as the parser generator is quite picky about this.

@@ -49,7 +50,7 @@ What to do with these files and update the parser class...
-Assuming, the LPG executable (lpg.exe or jikespg.exe) is located inside d:\lpg. +Assuming the LPG executable (lpg.exe or jikespg.exe) is located in d:\lpg.
  1. First in a console, run:
    @@ -128,25 +129,25 @@
     
     Escaped symbol $error is an invalid C variable.
      
    - It can be quite different if the output changed since the version 2.30 of lpg. The important part is:
    + It can be quite different if the output changed since version 2.30 of LPG. The important part is:
    This grammar is LALR(1).
    - This creates in the current directory some java source files and information files. + This creates some java source files and information files in the current directory.
    - + - + - + - + @@ -167,8 +168,9 @@
    1. Copy the contents of the JavaAction.java file into the consumeRule(int) method of the org.eclipse.jdt.internal.compiler.parser.Parser class.
    2. -
    3. The class org.eclipse.jdt.internal.compiler.parser.ParserBasicInformation needs to be updated with the content of the file javadef.java. Don't copy the +
    4. The class org.eclipse.jdt.internal.compiler.parser.ParserBasicInformation needs to be updated with the contents of the file javadef.java. Don't copy the interface name. Simply copy the field declarations. The actual source of this class will guide you.
    5. +
    6. Similarly, update the class org.eclipse.jdt.internal.compiler.parser.TerminalTokens with the contents of the file javasym.java.
    7. The last step is to update the resource files:
      Copy the jdtcore.jar file in d:\temp. Compile this source inside d:\temp. You will have a file UpdateParserFiles.class. Then run the following command-line:
    java.lInformation generated by lpg/jikespg. Enumarate all the states created for the automaton, etc.Log information generated by lpg/jikespg. Enumarates all the states created for the automaton, etc.
    JavaAction.javaIt contains the method consumeRule(int) of the class org.eclipse.jdt.internal.compiler.parser.Parser that handles all semantic actions dispatches.Contains the method consumeRule(int) of class org.eclipse.jdt.internal.compiler.parser.Parser, which handles all semantic action dispatches.
    javahdr.javaThis files is used to generate the resources files.Used to generate the resources files.
    javadcl.javaThis files is used to generate the resources files.Used to generate the resources files.
    javasym.java