Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[photran] Refactoring parseLiteralProgramUnit Question

Hi,

I'm new to Fortran refactoring and we are attempting to surround a
block of code with and if-then statement. We're attempting to use
parseLiteralProgramUnit on a String and cast it to an
ASTIfConstructNode in DoCreateChange. I'm attaching our code to this
email. Any help would be appreciated.

When running our test suite, we get the attached failure trace.

-- 
Thanks,
Dave Henke
java.lang.Error: org.eclipse.photran.internal.core.SyntaxException: Syntax error: Unexpected end of input (?, line 6, column 1).  Expected one of the following: block, close, contains, abstract, class, identifier, return, interface, call, end of statement, go, print, subroutine, stop, allocatable, end, private, doubleprecision, all, implicit, if, end of input, dimension, goto, write, data, submodule, where, recursive, blockdata, select, allstop, codimension, import, use, intent, pause, backspace, endfile, selectcase, open, associate, elemental, character, nullify, rewind, bind, do, pointer, syncall, program, syncimages, syncmemory, wait, unlock, optional, double, module, read, allocate, equivalence, integer, entry, real, cycle, procedure, pure, integer constant, lock, intrinsic, format, namelist, asynchronous, critical, value, logical, forall, save, sync, inquire, assign, external, volatile, complex, protected, common, endprogram, public, enddo, contiguous, impure, enum, parameter, target, doublecomplex, type, deallocate, function, continue, exit
	at org.eclipse.photran.internal.core.refactoring.infrastructure.FortranResourceRefactoring.parseLiteralProgramUnit(FortranResourceRefactoring.java:311)
	at org.eclipse.photran.internal.core.refactoring.SurroundIfRefactoring.doCreateChange(SurroundIfRefactoring.java:81)
	at org.eclipse.rephraserengine.core.vpg.refactoring.VPGRefactoring.createChange(VPGRefactoring.java:196)
	at org.eclipse.photran.internal.tests.PhotranRefactoringTestSuiteFromMarkers$IndividualRefactoringTestCase.performChange(PhotranRefactoringTestSuiteFromMarkers.java:255)
	at org.eclipse.photran.internal.tests.PhotranRefactoringTestSuiteFromMarkers$IndividualRefactoringTestCase.test(PhotranRefactoringTestSuiteFromMarkers.java:202)
	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:597)
	at junit.framework.TestCase.runTest(TestCase.java:168)
	at junit.framework.TestCase.runBare(TestCase.java:134)
	at junit.framework.TestResult$1.protect(TestResult.java:110)
	at junit.framework.TestResult.runProtected(TestResult.java:128)
	at junit.framework.TestResult.run(TestResult.java:113)
	at junit.framework.TestCase.run(TestCase.java:124)
	at junit.framework.TestSuite.runTest(TestSuite.java:232)
	at junit.framework.TestSuite.run(TestSuite.java:227)
	at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:62)
	at org.eclipse.pde.internal.junit.runtime.UITestApplication$1.run(UITestApplication.java:116)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3586)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3279)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
	at org.eclipse.pde.internal.junit.runtime.UITestApplication.start(UITestApplication.java:47)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	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:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
Caused by: org.eclipse.photran.internal.core.SyntaxException: Syntax error: Unexpected end of input (?, line 6, column 1).  Expected one of the following: block, close, contains, abstract, class, identifier, return, interface, call, end of statement, go, print, subroutine, stop, allocatable, end, private, doubleprecision, all, implicit, if, end of input, dimension, goto, write, data, submodule, where, recursive, blockdata, select, allstop, codimension, import, use, intent, pause, backspace, endfile, selectcase, open, associate, elemental, character, nullify, rewind, bind, do, pointer, syncall, program, syncimages, syncmemory, wait, unlock, optional, double, module, read, allocate, equivalence, integer, entry, real, cycle, procedure, pure, integer constant, lock, intrinsic, format, namelist, asynchronous, critical, value, logical, forall, save, sync, inquire, assign, external, volatile, complex, protected, common, endprogram, public, enddo, contiguous, impure, enum, parameter, target, doublecomplex, type, deallocate, function, continue, exit
	at org.eclipse.photran.internal.core.parser.Parser.syntaxError(Parser.java:353)
	at org.eclipse.photran.internal.core.parser.Parser.parse(Parser.java:253)
	at org.eclipse.photran.internal.core.parser.Parser.parseExecutableProgram(Parser.java:185)
	at org.eclipse.photran.internal.core.parser.Parser.parse(Parser.java:180)
	at org.eclipse.photran.internal.core.refactoring.infrastructure.FortranResourceRefactoring.parseLiteralProgramUnit(FortranResourceRefactoring.java:306)
	... 50 more

Attachment: SurroundIfRefactoring.java
Description: Binary data


Back to the top