Start with Basic entity Lang

add the following productions to common.sdf3

EndOfLine      = [\n\r] 
EndOfLine      = [\n][\r] {prefer}	
DelimitedString = "q\"" Delimiter EndOfLine ~[\"]* EndOfLine MatchingDelimiter "\""
Delimiter = ID
MatchingDelimiter = ID

change
NewLineEOF = [\n\r]
to
NewLineEOF = EndOfLine

add the following production to entity.sdf3

Definition.eString = <
	eString <ID> = <DelimitedString>
>

Save and build the project

Add the following test to test-example.spt

test Delimited Strings [[

	eString twentysix = q"EOS
This
is a multi-line
heredoc string
 EOS"
]] fail

There is a space in front of EOS which should cause it to fail.

On saving the test file is marked at the head with the following error.

Internal parsing error: java.lang.NullPointerException (recovery failed)

If the fail suffix is removed the test fails with a parse failure but the NPE is not triggered.

The following Exceptions where logged in the Error Log.
java.lang.NullPointerException
at org.spoofax.jsglr.client.imploder.ImploderAttachment.getLeftToken(ImploderAttachment.java:108)
at org.spoofax.jsglr.client.imploder.ImploderAttachment.getTokenizer(ImploderAttachment.java:151)
at org.strategoxt.imp.testing.SpoofaxTestingJSGLRI.parseTestedFragments(SpoofaxTestingJSGLRI.java:101)
at org.strategoxt.imp.testing.SpoofaxTestingJSGLRI.doParse(SpoofaxTestingJSGLRI.java:97)
at org.strategoxt.imp.runtime.parser.AbstractSGLRI.parse(AbstractSGLRI.java:113)
at org.strategoxt.imp.runtime.parser.SGLRParseController.doParse(SGLRParseController.java:371)
at org.strategoxt.imp.runtime.parser.SGLRParseController.parse(SGLRParseController.java:299)
at org.strategoxt.imp.runtime.parser.SGLRParseController.parse(SGLRParseController.java:1)
at org.strategoxt.imp.runtime.dynamicloading.DynamicParseController.parse(DynamicParseController.java:206)
at org.eclipse.imp.editor.ParserScheduler.run(ParserScheduler.java:86)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

java.lang.NullPointerException
… same as above
at org.strategoxt.imp.runtime.parser.SGLRParseController.parse(SGLRParseController.java:299)
at org.strategoxt.imp.runtime.services.StrategoObserverBackgroundUpdateJob.analyzeFile(StrategoObserverBackgroundUpdateJob.java:112)
at org.strategoxt.imp.runtime.services.StrategoObserverBackgroundUpdateJob.analyze(StrategoObserverBackgroundUpdateJob.java:64)
at org.strategoxt.imp.runtime.services.StrategoAnalysisQueue$UpdateJob.run(StrategoAnalysisQueue.java:82)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

org.spoofax.interpreter.core.InterpreterException: Exception during evaluation
at org.spoofax.interpreter.core.Interpreter.evaluate(Interpreter.java:117)
at org.spoofax.interpreter.core.Interpreter.invoke(Interpreter.java:82)
at org.strategoxt.HybridInterpreter.invoke(HybridInterpreter.java:442)
at org.strategoxt.imp.debug.core.str.launching.DebuggableHybridInterpreter.invoke(DebuggableHybridInterpreter.java:150)
at org.strategoxt.imp.runtime.services.StrategoObserver.invoke(StrategoObserver.java:637)
at org.strategoxt.imp.runtime.services.StrategoObserver.invokeSilent(StrategoObserver.java:695)
at org.strategoxt.imp.runtime.services.StrategoObserver.update(StrategoObserver.java:399)
at org.strategoxt.imp.runtime.services.StrategoObserverBackgroundUpdateJob.analyzeFile(StrategoObserverBackgroundUpdateJob.java:118)
at org.strategoxt.imp.runtime.services.StrategoObserverBackgroundUpdateJob.analyze(StrategoObserverBackgroundUpdateJob.java:64)
at org.strategoxt.imp.runtime.services.StrategoAnalysisQueue$UpdateJob.run(StrategoAnalysisQueue.java:82)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: org.spoofax.interpreter.core.InterpreterErrorExit: Internal error: with clause failed unexpectedly in ‘editor-analyze’
((),“test/test-example.spt”,“/home/pmiess/workspace4.4/entity”)
at org.strategoxt.lang.InteropSDefT.evaluate(InteropSDefT.java:194)
at org.strategoxt.lang.InteropSDefT.evaluate(InteropSDefT.java:183)
at org.strategoxt.lang.InteropSDefT$StrategyBody.evaluate(InteropSDefT.java:245)
at org.spoofax.interpreter.core.Interpreter.evaluate(Interpreter.java:109)
… 10 more
Caused by: org.strategoxt.lang.StrategoErrorExit: Internal error: with clause failed unexpectedly in ‘editor-analyze’
((),“test/test-example.spt”,“/workspace4.4/entity”)
report_with_failure_0_1
editor_analyze_0_0
editor_analyze_0_0
at org.strategoxt.lang.SRTS_EXT_fatal_err_0_3.invoke(SRTS_EXT_fatal_err_0_3.java:28)
at org.strategoxt.lang.compat.override.java_integration.SRTS_EXT_fatal_err_0_2.invoke(SRTS_EXT_fatal_err_0_2.java:33)
at org.strategoxt.lang.compat.override.java_integration.report_failure_0_2_override.invoke(report_failure_0_2_override.java:27)
at org.strategoxt.stratego_lib.report_with_failure_0_1.invoke(report_with_failure_0_1.java:32)
at trans.editor_analyze_0_0.invoke(editor_analyze_0_0.java:174)
at org.strategoxt.lang.Strategy.invokeDynamic(Strategy.java:30)
at org.strategoxt.lang.InteropSDefT.evaluate(InteropSDefT.java:192)
… 13 more

java.io.FileNotFoundException: L/home/pmiess/workspace4.4/entity/test/test-example.spt
at org.strategoxt.imp.runtime.parser.ast.AstMessageHandler.addMarker(AstMessageHandler.java:119)
at org.strategoxt.imp.runtime.parser.ast.AstMessageHandler.addMarkerNoLocation(AstMessageHandler.java:194)
at org.strategoxt.imp.runtime.parser.ast.AstMessageHandler.addMarkerFirstLine(AstMessageHandler.java:146)
at org.strategoxt.imp.runtime.services.StrategoObserver.update(StrategoObserver.java:410)
at org.strategoxt.imp.runtime.services.StrategoObserverBackgroundUpdateJob.analyzeFile(StrategoObserverBackgroundUpdateJob.java:118)
at org.strategoxt.imp.runtime.services.StrategoObserverBackgroundUpdateJob.analyze(StrategoObserverBackgroundUpdateJob.java:64)
at org.strategoxt.imp.runtime.services.StrategoAnalysisQueue$UpdateJob.run(StrategoAnalysisQueue.java:82)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

Submitted by Philip Miess on 12 February 2015 at 01:07

Log in to post comments