aniatbr / spray

Automatically exported from code.google.com/p/spray
0 stars 0 forks source link

XExpression cannot be compiled with Xtext 2.4.2 #277

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Grammar:

ShapePropertyAssignment: 
    (attribute=[ecore::EAttribute] 'into' key = ShapeDslKey ('(' value=XExpression ')')?) |
    ('constant' value=XExpression 'into' key = ShapeDslKey)
;

SprayScopeProvider#createLocalVarScope
http://code.google.com/a/eclipselabs.org/p/spray/source/browse/plugins/org.eclip
selabs.spray.xtext/src/org/eclipselabs/spray/xtext/scoping/SprayScopeProvider.ja
va#692

SprayJvmModelInferrer#infer
http://code.google.com/a/eclipselabs.org/p/spray/source/browse/plugins/org.eclip
selabs.spray.xtext/src/org/eclipselabs/spray/xtext/jvmmodel/SprayJvmModelInferre
r.xtend#39

SprayCompiler#compileForPropertyAssignement
http://code.google.com/a/eclipselabs.org/p/spray/source/browse/plugins/org.eclip
selabs.spray.generator.graphiti/src/org/eclipselabs/spray/generator/graphiti/uti
l/SprayCompiler.java#33

Examples:
* name into textId2 ( name + " : " + dataType )
* name into uniqueRuleName ( "Rule: " + name )

Stacktrace:
[ERROR] 8970 [main] ERROR org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher  - 
Problems running workflow org.eclipselabs.
spray.example.one.SprayGenerator: null
[INFO] java.lang.RuntimeException: Problems running workflow 
org.eclipselabs.spray.example.one.SprayGenerator: null
[ERROR]         at 
org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:104)
[ERROR]         at 
org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:79)
[ERROR]         at 
org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:71)
[ERROR]         at 
org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:76)
[ERROR]         at 
org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:35)
[INFO] Caused by: java.lang.NullPointerException
[ERROR]         at 
org.eclipse.xtext.xbase.compiler.TypeReferenceSerializer.serialize(TypeReference
Serializer.java:90)
[ERROR]         at 
org.eclipse.xtext.xbase.compiler.AbstractXbaseCompiler.serialize(AbstractXbaseCo
mpiler.java:342)
[ERROR]         at 
org.eclipse.xtext.xbase.compiler.AbstractXbaseCompiler.serialize(AbstractXbaseCo
mpiler.java:338)
[ERROR]         at 
org.eclipse.xtext.xbase.compiler.AbstractXbaseCompiler.serialize(AbstractXbaseCo
mpiler.java:334)
[ERROR]         at 
org.eclipse.xtext.xbase.compiler.AbstractXbaseCompiler.declareFreshLocalVariable
(AbstractXbaseCompile
r.java:443)
[ERROR]         at 
org.eclipse.xtext.xbase.compiler.FeatureCallCompiler._toJavaStatement(FeatureCal
lCompiler.java:253)
[ERROR]         at 
org.eclipse.xtext.xbase.compiler.FeatureCallCompiler._toJavaStatement(FeatureCal
lCompiler.java:275)
[ERROR]         at 
org.eclipse.xtext.xbase.compiler.FeatureCallCompiler.doInternalToJavaStatement(F
eatureCallCompiler.ja
va:121)
[ERROR]         at 
org.eclipse.xtext.xbase.compiler.XbaseCompiler.doInternalToJavaStatement(XbaseCo
mpiler.java:462)
[ERROR]         at 
org.eclipse.xtext.xbase.compiler.AbstractXbaseCompiler.internalToJavaStatement(A
bstractXbaseCompiler.
java:297)
[ERROR]         at 
org.eclipse.xtext.xbase.compiler.FeatureCallCompiler.prepareExpression(FeatureCa
llCompiler.java:388)
[ERROR]         at 
org.eclipse.xtext.xbase.compiler.FeatureCallCompiler._toJavaStatement(FeatureCal
lCompiler.java:177)
[ERROR]         at 
org.eclipse.xtext.xbase.compiler.FeatureCallCompiler.doInternalToJavaStatement(F
eatureCallCompiler.ja
va:123)
[ERROR]         at 
org.eclipse.xtext.xbase.compiler.XbaseCompiler.doInternalToJavaStatement(XbaseCo
mpiler.java:462)
[ERROR]         at 
org.eclipse.xtext.xbase.compiler.AbstractXbaseCompiler.internalToJavaStatement(A
bstractXbaseCompiler.
java:297)
[ERROR]         at 
org.eclipse.xtext.xbase.compiler.FeatureCallCompiler.prepareExpression(FeatureCa
llCompiler.java:388)
[ERROR]         at 
org.eclipse.xtext.xbase.compiler.FeatureCallCompiler._toJavaStatement(FeatureCal
lCompiler.java:177)
[ERROR]         at 
org.eclipse.xtext.xbase.compiler.FeatureCallCompiler.doInternalToJavaStatement(F
eatureCallCompiler.ja
va:123)
[ERROR]         at 
org.eclipse.xtext.xbase.compiler.XbaseCompiler.doInternalToJavaStatement(XbaseCo
mpiler.java:462)
[ERROR]         at 
org.eclipse.xtext.xbase.compiler.AbstractXbaseCompiler.internalToJavaStatement(A
bstractXbaseCompiler.
java:297)
[ERROR]         at 
org.eclipse.xtext.xbase.compiler.AbstractXbaseCompiler.compile(AbstractXbaseComp
iler.java:236)
[ERROR]         at 
org.eclipse.xtext.xbase.compiler.AbstractXbaseCompiler.compile(AbstractXbaseComp
iler.java:107)
[ERROR]         at 
org.eclipselabs.spray.generator.graphiti.util.SprayCompiler.compileForPropertyAs
signement(SprayCompil
er.java:33)
[ERROR]         at 
org.eclipselabs.spray.generator.graphiti.templates.features.DirectEditFeature.pr
opertyAssignmentFunct
ion(DirectEditFeature.java:569)
[ERROR]         at 
org.eclipselabs.spray.generator.graphiti.templates.features.DirectEditFeature.ge
nerate_initialValue(D
irectEditFeature.java:367)
[ERROR]         at 
org.eclipselabs.spray.generator.graphiti.templates.features.DirectEditFeature.ge
nerate_getInitalValue
(DirectEditFeature.java:241)
[ERROR]         at 
org.eclipselabs.spray.generator.graphiti.templates.features.DirectEditFeature.ma
inFile(DirectEditFeat
ure.java:148)
[ERROR]         at 
org.eclipselabs.spray.generator.graphiti.templates.features.DirectEditFeature.ge
nerateBaseFile(Direct
EditFeature.java:43)
[ERROR]         at 
org.eclipselabs.spray.generator.graphiti.templates.features.DirectEditFeature.ge
nerateBaseFile(Direct
EditFeature.java:1)
[ERROR]         at 
org.eclipselabs.spray.xtext.generator.FileGenerator.generate(FileGenerator.java:
95)
[ERROR]         at 
org.eclipselabs.spray.generator.graphiti.SprayGraphitiGenerator.generateDirectEd
itFeature(SprayGraphi
tiGenerator.java:668)
[ERROR]         at 
org.eclipselabs.spray.generator.graphiti.SprayGraphitiGenerator.doGenerate(Spray
GraphitiGenerator.jav
a:223)
[ERROR] ExitStatusException occurred while running workflow: Java returned: 1

investigation:
* the feature of XFeatureCall is just an eProxy (but should be for example the 
name feature of mod4j's StringProperty)

current diagnose:
* XbaseScopeProvider.THIS is not properly bound resp. mod4j not properly loaded 
/ resolved inside model inferer

Work around: do not use XExpressions, to get the examples above woking again 
you have to write:
* name into textId2
* name into uniqueRuleName

Original issue reported on code.google.com by de.abg.r...@gmail.com on 23 Jun 2013 at 12:13

GoogleCodeExporter commented 8 years ago

Original comment by de.abg.r...@gmail.com on 19 Jul 2013 at 11:28