|
Re: Let statements for collection of collections [message #1713073 is a reply to message #1713063] |
Fri, 30 October 2015 15:27 |
Ed Willink Messages: 7655 Registered: July 2009 |
Senior Member |
|
|
Hi Yves
[I really dislike the Complete OCL syntax; it has no {} or ; to help a
parser recover, consequently it can be really obscure where an error
actually occurs. I have to delete chunks of source text until the error
goes away rather too often. Occasionally I have to do this with Java too
to localize a mismatched }.]
Your problem, once you remove the comment, is in:
def: aTest(): String =
let y : Set(Sequence(uml::Transition)) =
self.GetAllTransitionPaths(Set(Sequence(uml::Transition)){{self}}) in
doSomething(y)
Perhaps you thought "{{self}}" was a nested literal. It isn't. "{self}"
works. Unfortunately the error is "mismatched input 'def' expecting
'(''" about three "def" constructs earlier.
Similar source text in OCLinEcore gives "no viable alternative at input
'{'" and "mismatched input '}' expecting 'in'" both at the error.
----
Maybe one day I'll provide a better Complete OCL syntax.
Maybe once I apply incremental update technology to the editor I'll
learn how to do better error recovery with Xtext or whatever.
Sorry; not a high priority.
Had a couple of ideas:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=481129 raised.
Regards
Ed Willink
On 30/10/2015 14:13, Yves BERNARD wrote:
> At the end of the attached test file, there is the following query definition:
>
> def: aTest(): String =
> --let y : Set(Sequence(uml::Transition)) = self.GetAllTransitionPaths(Set(Sequence(uml::Transition)){{self}}) in
> doSomething(y)
>
> As is, there is an error because of the "let" statement hidden in a comment, leaving "y" undefined. However, the whole file is correctly parsed and its structure displayed on the outline view.
>
> Now, if I activate this let statement (line 34) in order to define "y", the file cannot be parsed anymore.
>
> I don't see what is wrong in my let statement on line 34 that prevents the entire file to be parsed.
>
> Is it a bug?
>
> Yves
>
> Eclipse Modeling Tools
> Version: Mars.1 Release (4.5.1) Build id: 20150924-1200
>
> OCL All-In-One SDK
> Version: 6.0.1.v20150908-1239
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02562 seconds