Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » A simple error break a whole file: how to avoid?
A simple error break a whole file: how to avoid? [message #1016202] Tue, 05 March 2013 08:29 Go to next message
Victor Noël is currently offline Victor Noël
Messages: 112
Registered: June 2010
Senior Member
Hi,

I have a new question, following my previous one there:
http://www.eclipse.org/forums/index.php/m/1016189/

As a reminder, I have this language:
https://anon:anon@wwwsecu.irit.fr/hg/SMAC/victor-noel-phd/may/may-xtext2/

There is an ecore model, and then an xtext language built on top of it.
The point of interest here is the language description in xtext (in fr.irit.smac.may.speadl), I put some comments when there is things that could seem strange. There is some french comments but they are unimportant.
I'm using xtext 2.4M5.
I only committed the code I changed, for the rest one need to execute both mwe2 workflow in fr.irit.smac.may.spead then fr.irit.smac.may.speadl.

So my problem is as follow:

When editing a file (see the aforementioned thread for an example), if a line is not finished:
bind test4 to a.


Then the file is full of errors and even the second element defined (in the example) is also considered full of error.
This prevent the content assist and the scope to use the type of the "a" element to complete the line!

Is there a way to avoid that?
It seems that if I put ";" at the end of line it could work, but I would prefer to avoid it.
Another solution seems to be to have something in the ComponentPart declaration delimiting the beginning of a new Binding, something like:
ComponentPart returns spead::ComponentPart:
	"part" name=ValidID ":" type=ComponentParameterizedTypeReference ("{"
		('bind' bindings+=Binding)*
 	"}")?;

So that xtext understand that if it sees "bind", it means a new instance of the Binding rule should be consumed, but the problem is in that case I have to keep "bind" in the RequiredPortReference rule, because of the problem we talked in the aforementioned thread...

I guess there should be another solution?

Thank you :)
Re: A simple error break a whole file: how to avoid? [message #1073712 is a reply to message #1016202] Thu, 25 July 2013 06:52 Go to previous message
Victor Noël is currently offline Victor Noël
Messages: 112
Registered: June 2010
Senior Member
Hi, this actually now work (I don't exactly understand why, but it does), but now I have the exact same problem in a wee bit different context.

In the previous thread I gave this example:
namespace Test {
	ecosystem TestE1 {
		provides test: String = a.test
		
		part a: TestE2 {
			bind test4 to a.test3
			bind test to a.test
			bind test2 to this.test2
		}
	}
	ecosystem TestE2 {
		provides test3: String = this.test3
		requires test4: String
	}
}


If I write the line:
provides test: String = 


Errors (starting on the keyword "part" following this line) in the file prevent the scope/contentassist to show me the options available even though there is the keyword "part" just after that should help the parser to understand the error is before it.

Is there a way to prevent that behaviour? Is that a bug in the parser to not see the "part" keyword?

Thanks
Previous Topic:Scope for C# like Attribute-Class
Next Topic:automatic tweaking lexer for semantic predicates
Goto Forum:
  


Current Time: Fri Aug 22 02:08:08 EDT 2014

Powered by FUDForum. Page generated in 0.01534 seconds