Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jdt-core-dev] trouble generating parser

Hi,
I’m having trouble producing a usable jdt.core plugin after generating the parser from the grammar. I have not changed the grammar file except to set the CR/LF to the expected unix format. If I export the plugin using the parser in the repository, all works as expected.

According to the instructions in jdt-core-home/howto, there should be 21 parser<n>.rsc files, while I get 24. Also, the file readableNames.properties is created with 0 bytes. I tried using both the original and empty copies of this file, with the same results.

I am able to build and export a jdt.core plugin with this modified parser. But when Eclipse is started with this version and a .java file is opened in an editor, an ArrayIndexOutOfBoundsException is thrown. The top of the editor pane has the message “unable to create this part due to an internal error. Reason for the failure: Editor could not be initialized.” The stack trace given in the details area is shown at the end of this message.

Also below is the batch file used to generate the parser. The version of jikespg used is from a zip file that has 1.3 as its filename, but the tool reports that it is version 1.2, as defined in globals.c.

Any help would be greatly appreciated. If there’s any additional information I can provide, please just let me know.
Best regards,
Perry
==
Perry James
perry.james@xxxxxxxxxxxx

----- batch file used to generate the parser. It’s called from the grammar directory.
set jdtDir=U:\workspace\org.eclipse.jdt.core
set grammarDir=%jdtDir%\grammar
set parserDir=%jdtDir%\compiler\org\eclipse\jdt\internal\compiler\parser

jikespg.exe java_1_4.g >> %grammarDir%\generateParser.out

copy parserScript.vim %parserDir% >> %grammarDir%\generateParser.temp
copy javaDefScript.vim %parserDir% >> %grammarDir%\generateParser.temp
copy JavaAction.java %parserDir% >> %grammarDir%\generateParser.temp
copy javadef.java %parserDir% >> %grammarDir%\generateParser.temp

pushd .
cd %parserDir%
call vi -S parserScript.vim Parser.java
call vi -S javadefScript.vim ParserBasicInformation.java
popd

del %parserDir%\parserScript.vim
del %parserDir%\javaDefScript.vim
del %parserDir%\JavaAction.java
del %parserDir%\javadef.java

javac -classpath jdtcore.jar;. UpdateParserFiles.java
java -classpath jdtcore.jar;. UpdateParserFiles javadcl.java javahdr.java >> %grammarDir%\generateParser.out
copy parser*.rsc %parserDir% >> %grammarDir%\generateParser.temp
del %grammarDir%\generateParser.temp

----- output file generateParser.out

IBM Research Jikes Parser Generator Mon Sep 25 10:46:58 2006
%OPTIONS ACTION, AN=JavaAction.java, GP=java,
%OPTIONS FILE-PREFIX=java, ESCAPE=$, PREFIX=TokenName, OUTPUT-SIZE=125 ,
%OPTIONS NOGOTO-DEFAULT, SINGLE-PRODUCTIONS, LALR=1 , TABLE,
%OPTIONS ERROR_MAPS
%OPTIONS first follow
%OPTIONS TRACE=FULL ,
%OPTIONS VERBOSE
%OPTIONS DEFERRED
%OPTIONS NAMES=MAX
%OPTIONS SCOPES
Options in effect:
ACTION ACTFILE-NAME=JavaAction.java BLOCKB=/. BLOCKE=./ BYTE CONFLICTS
DEFAULT=5 NODEBUG DEFERRED NOEDIT ERROR-MAPS ESCAPE=$
FILE-PREFIX=java FIRST FOLLOW GENERATE-PARSER=JAVA NOGOTO-DEFAULT
HACTFILE-NAME=javahdr.java HBLOCKB=/: HBLOCKE=:/ LALR=1 LIST
MAX-DISTANCE=30 MIN-DISTANCE=3 NAMES=MAXIMUM NONT-CHECK ORMARK=|
OUTPUT-SIZE=125 PREFIX=TokenName READ-REDUCE SCOPES NOSHIFT-DEFAULT
SINGLE-PRODUCTIONS STACK-SIZE=128 STATES SUFFIX= TABLE=SPACE
TRACE=FULL VERBOSE WARNINGS XREF


This grammar is LALR(1).

Number of Terminals: 105
Number of Nonterminals: 202
Number of Productions: 434
Number of Single Productions: 159
Number of Items: 1255
Number of Scopes: 64
Number of States: 597
Number of Shift actions: 3342
Number of Goto actions: 3918
Number of Shift/Reduce actions: 343
Number of Goto/Reduce actions: 650
Number of Reduce actions: 9004
Number of Shift-Reduce conflicts: 0
Number of Reduce-Reduce conflicts: 0

Length of base Action Table: 5703
Number of entries in base Action Table: 5165
Percentage of increase: 10.4%
Storage required for base Tables: 11406 Bytes, 12K
Storage required for Rules: 866 Bytes
Number of unique terminal states: 495
Number of Shift actions saved by merging: 1925
Number of Reduce actions saved by merging: 490
Number of Reduce saved by default: 5430

Length of Terminal Check Table: 5789
Length of Terminal Action Table: 5711
Number of entries in Terminal Action Table: 5339
Percentage of increase: 6.9%
Storage required for Terminal Tables: 17211 Bytes, 17K
Total storage required for Tables: 28617 Bytes, 28K


Actions in Compressed Tables:
Number of Shifts: 1548
Number of Shift/Reduces: 212
Number of Gotos: 3918
Number of Goto/Reduces: 650
Number of Reduces: 3084
Number of Defaults: 340

Error maps storage:
Storage required for ACTION_SYMBOLS_BASE map: 1194 Bytes
Storage required for ACTION_SYMBOLS_RANGE map: 1154 Bytes
Storage required for NACTION_SYMBOLS_BASE map: 1194 Bytes
Storage required for NACTION_SYMBOLS_RANGE map: 568 Bytes
Storage required for TERMINAL_INDEX map: 210 Bytes
Storage required for NON_TERMINAL_INDEX map: 406 Bytes
Storage required for STRING_BUFFER map: 7852 Bytes

***Warning: Base Check vector contains value > 127. 16-bit words used.
Escaped symbol $eof is an invalid C variable.

Escaped symbol $error is an invalid C variable.

parser1.rsc creation complete

parser2.rsc creation complete

parser3.rsc creation complete

parser4.rsc creation complete

parser5.rsc creation complete

parser6.rsc creation complete

parser7.rsc creation complete

parser8.rsc creation complete

parser9.rsc creation complete

parser10.rsc creation complete

parser11.rsc creation complete

parser12.rsc creation complete

parser13.rsc creation complete

parser14.rsc creation complete

parser15.rsc creation complete

parser16.rsc creation complete

parser17.rsc creation complete

parser18.rsc creation complete

parser19.rsc creation complete

parser20.rsc creation complete

parser21.rsc creation complete

Goal has no readable name

CompilationUnit has no readable name

MethodBody has no readable name

StaticInitializer has no readable name

Initializer has no readable name

Headers has no readable name

BlockStatements has no readable name

CatchHeader has no readable name

FieldDeclaration has no readable name

ImportDeclaration has no readable name

PackageDeclaration has no readable name

TypeDeclaration has no readable name

GenericMethodDeclaration has no readable name

ClassBodyDeclarations has no readable name

Expression has no readable name

BlockStatementsopt has no readable name

Literal has no readable name

BooleanLiteral has no readable name

Type has no readable name

PrimitiveType has no readable name

ReferenceType has no readable name

NumericType has no readable name

IntegralType has no readable name

FloatingPointType has no readable name

ClassOrInterfaceType has no readable name

ArrayType has no readable name

Name has no readable name

Dims has no readable name

ClassType has no readable name

SimpleName has no readable name

QualifiedName has no readable name

EnterCompilationUnit has no readable name

PackageDeclarationopt has no readable name

ImportDeclarationsopt has no readable name

TypeDeclarationsopt has no readable name

Header has no readable name

ClassHeader has no readable name

InterfaceHeader has no readable name

MethodHeader has no readable name

ConstructorHeader has no readable name

AllocationHeader has no readable name

ArrayCreationHeader has no readable name

FormalParameter has no readable name

ImportDeclarations has no readable name

TypeDeclarations has no readable name

PackageDeclarationName has no readable name

SingleTypeImportDeclaration has no readable name

TypeImportOnDemandDeclaration has no readable name

SingleTypeImportDeclarationName has no readable name

TypeImportOnDemandDeclarationName has no readable name

ClassDeclaration has no readable name

InterfaceDeclaration has no readable name

Modifiers has no readable name

Modifier has no readable name

ClassBody has no readable name

ClassHeaderName has no readable name

ClassHeaderExtendsopt has no readable name

ClassHeaderImplementsopt has no readable name

Modifiersopt has no readable name

ClassHeaderExtends has no readable name

ClassHeaderImplements has no readable name

InterfaceTypeList has no readable name

InterfaceType has no readable name

ClassBodyDeclarationsopt has no readable name

ClassBodyDeclaration has no readable name

ClassMemberDeclaration has no readable name

ConstructorDeclaration has no readable name

Diet has no readable name

NestedMethod has no readable name

Block has no readable name

MethodDeclaration has no readable name

VariableDeclarators has no readable name

VariableDeclarator has no readable name

VariableDeclaratorId has no readable name

EnterVariable has no readable name

ExitVariableWithoutInitialization has no readable name

ForceNoDiet has no readable name

VariableInitializer has no readable name

RestoreDiet has no readable name

ExitVariableWithInitialization has no readable name

Dimsopt has no readable name

ArrayInitializer has no readable name

AbstractMethodDeclaration has no readable name

MethodHeaderName has no readable name

MethodHeaderParameters has no readable name

MethodHeaderExtendedDims has no readable name

MethodHeaderThrowsClauseopt has no readable name

FormalParameterListopt has no readable name

MethodHeaderThrowsClause has no readable name

ClassTypeList has no readable name

ConstructorHeaderName has no readable name

FormalParameterList has no readable name

ClassTypeElt has no readable name

StaticOnly has no readable name

ExplicitConstructorInvocation has no readable name

ArgumentListopt has no readable name

Primary has no readable name

InterfaceBody has no readable name

InterfaceHeaderName has no readable name

InterfaceHeaderExtendsopt has no readable name

InvalidInterfaceDeclaration has no readable name

InterfaceHeaderExtends has no readable name

InterfaceMemberDeclarationsopt has no readable name

InterfaceMemberDeclarations has no readable name

InterfaceMemberDeclaration has no readable name

InvalidMethodDeclaration has no readable name

ConstantDeclaration has no readable name

InvalidConstructorDeclaration has no readable name

,opt has no readable name

VariableInitializers has no readable name

OpenBlock has no readable name

BlockStatement has no readable name

LocalVariableDeclarationStatement has no readable name

Statement has no readable name

LocalVariableDeclaration has no readable name

PushModifiers has no readable name

StatementWithoutTrailingSubstatement has no readable name

LabeledStatement has no readable name

IfThenStatement has no readable name

IfThenElseStatement has no readable name

WhileStatement has no readable name

ForStatement has no readable name

StatementNoShortIf has no readable name

LabeledStatementNoShortIf has no readable name

IfThenElseStatementNoShortIf has no readable name

WhileStatementNoShortIf has no readable name

ForStatementNoShortIf has no readable name

AssertStatement has no readable name

EmptyStatement has no readable name

ExpressionStatement has no readable name

SwitchStatement has no readable name

DoStatement has no readable name

BreakStatement has no readable name

ContinueStatement has no readable name

ReturnStatement has no readable name

SynchronizedStatement has no readable name

ThrowStatement has no readable name

TryStatement has no readable name

StatementExpression has no readable name

Assignment has no readable name

PreIncrementExpression has no readable name

PreDecrementExpression has no readable name

PostIncrementExpression has no readable name

PostDecrementExpression has no readable name

MethodInvocation has no readable name

ClassInstanceCreationExpression has no readable name

SwitchBlock has no readable name

SwitchBlockStatements has no readable name

SwitchLabels has no readable name

SwitchBlockStatement has no readable name

SwitchLabel has no readable name

ConstantExpression has no readable name

ForInitopt has no readable name

Expressionopt has no readable name

ForUpdateopt has no readable name

ForInit has no readable name

StatementExpressionList has no readable name

ForUpdate has no readable name

OnlySynchronized has no readable name

TryBlock has no readable name

Catches has no readable name

Catchesopt has no readable name

Finally has no readable name

ExitTryBlock has no readable name

CatchClause has no readable name

PushLPAREN has no readable name

PushRPAREN has no readable name

PrimaryNoNewArray has no readable name

ArrayCreationWithArrayInitializer has no readable name

ArrayCreationWithoutArrayInitializer has no readable name

FieldAccess has no readable name

ArrayAccess has no readable name

ClassBodyopt has no readable name

ClassInstanceCreationExpressionName has no readable name

EnterAnonymousClassBody has no readable name

ArgumentList has no readable name

DimWithOrWithOutExprs has no readable name

DimWithOrWithOutExpr has no readable name

DimsLoop has no readable name

OneDimLoop has no readable name

PostfixExpression has no readable name

PushPosition has no readable name

UnaryExpression has no readable name

UnaryExpressionNotPlusMinus has no readable name

CastExpression has no readable name

InsideCastExpression has no readable name

InsideCastExpressionLL1 has no readable name

MultiplicativeExpression has no readable name

AdditiveExpression has no readable name

ShiftExpression has no readable name

RelationalExpression has no readable name

EqualityExpression has no readable name

AndExpression has no readable name

ExclusiveOrExpression has no readable name

InclusiveOrExpression has no readable name

ConditionalAndExpression has no readable name

ConditionalOrExpression has no readable name

ConditionalExpression has no readable name

AssignmentExpression has no readable name

AssignmentOperator has no readable name

InvalidArrayInitializerAssignement has no readable name

NestedType has no readable name

readableNames.properties creation complete

parser22.rsc creation complete

parser23.rsc creation complete

parser24.rsc creation complete

MOVE FILES IN THE Runtime DIRECTORY OF Parser.class


-----
java.lang.ArrayIndexOutOfBoundsException: 6053
at org.eclipse.jdt.internal.compiler.parser.Parser.tAction(Parser.java:830)
at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:8831)
at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:9115)
at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:9072)
at org.eclipse.jdt.internal.compiler.SourceElementParser.parseCompilationUnit(SourceElementParser.java:1519) at org.eclipse.jdt.internal.core.CompilationUnit.buildStructure(CompilationUnit.java:135)
at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:229)
at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:505) at org.eclipse.jdt.internal.core.BecomeWorkingCopyOperation.executeOperation(BecomeWorkingCopyOperation.java:38) at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:720) at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:779) at org.eclipse.jdt.internal.core.CompilationUnit.becomeWorkingCopy(CompilationUnit.java:68) at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider.createFileInfo(CompilationUnitDocumentProvider.java:929) at org.eclipse.ui.editors.text.TextFileDocumentProvider.connect(TextFileDocumentProvider.java:483) at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider.connect(CompilationUnitDocumentProvider.java:1069) at org.eclipse.ui.texteditor.AbstractTextEditor.doSetInput(AbstractTextEditor.java:3319) at org.eclipse.ui.texteditor.StatusTextEditor.doSetInput(StatusTextEditor.java:190) at org.eclipse.ui.texteditor.AbstractDecoratedTextEditor.doSetInput(AbstractDecoratedTextEditor.java:1181) at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.internalDoSetInput(JavaEditor.java:2375) at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.doSetInput(JavaEditor.java:2348) at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.doSetInput(CompilationUnitEditor.java:1408) at org.eclipse.ui.texteditor.AbstractTextEditor$19.run(AbstractTextEditor.java:2604) at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:369)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:313)
at org.eclipse.jface.window.ApplicationWindow$1.run(ApplicationWindow.java:767)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
at org.eclipse.jface.window.ApplicationWindow.run(ApplicationWindow.java:764)
at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:2280)
at org.eclipse.ui.texteditor.AbstractTextEditor.internalInit(AbstractTextEditor.java:2622) at org.eclipse.ui.texteditor.AbstractTextEditor.init(AbstractTextEditor.java:2649)
at org.eclipse.ui.internal.EditorManager.createSite(EditorManager.java:838)
at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:583) at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:372) at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:566) at org.eclipse.ui.internal.EditorAreaHelper.setVisibleEditor(EditorAreaHelper.java:263) at org.eclipse.ui.internal.EditorManager.setVisibleEditor(EditorManager.java:1444)
at org.eclipse.ui.internal.EditorManager$5.run(EditorManager.java:1004)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:850)
at org.eclipse.ui.internal.EditorManager.restoreState(EditorManager.java:999) at org.eclipse.ui.internal.WorkbenchPage.restoreState(WorkbenchPage.java:2819) at org.eclipse.ui.internal.WorkbenchWindow.restoreState(WorkbenchWindow.java:1933)
at org.eclipse.ui.internal.Workbench.doRestoreState(Workbench.java:2857)
at org.eclipse.ui.internal.Workbench.access$14(Workbench.java:2805)
at org.eclipse.ui.internal.Workbench$19.run(Workbench.java:1681)
at org.eclipse.ui.internal.Workbench.runStartupWithProgress(Workbench.java:1421)
at org.eclipse.ui.internal.Workbench.restoreState(Workbench.java:1679)
at org.eclipse.ui.internal.Workbench.access$12(Workbench.java:1650)
at org.eclipse.ui.internal.Workbench$17.run(Workbench.java:1529)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.ui.internal.Workbench.restoreState(Workbench.java:1473)
at org.eclipse.ui.internal.WorkbenchConfigurer.restoreState(WorkbenchConfigurer.java:183) at org.eclipse.ui.application.WorkbenchAdvisor.openWindows(WorkbenchAdvisor.java:702)
at org.eclipse.ui.internal.Workbench.init(Workbench.java:1085)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1847)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:74) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:348) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:165)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:341)
at org.eclipse.core.launcher.Main.basicRun(Main.java:285)
at org.eclipse.core.launcher.Main.run(Main.java:987)
at org.eclipse.core.launcher.Main.main(Main.java:962)





Back to the top