Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » method generateFile undefined for the type MyDslGenerator
method generateFile undefined for the type MyDslGenerator [message #1748801] Mon, 28 November 2016 19:06 Go to next message
Aran A is currently offline Aran AFriend
Messages: 30
Registered: January 2011
Member
Hello,

I'm working with a simple grammar, and I have problems with the xTend code, in the doGenerate() method. This is the code ...
import org.eclipse.emf.ecore.resource.Resource
import org.eclipse.xtext.generator.IGenerator
import org.eclipse.xtext.generator.IFileSystemAccess
...
class MyDslGenerator implements IGenerator {
	override void doGenerate(Resource res, IFileSystemAccess fsa) {
		fsa.generateFile('myfile.txt', res.compile);
	}
	
	def compile (Resource r) '''
	something
        '''


The error says "The method generateFile is undefined for the type MyDslGenerator"

I've compared this code with other examples I have, and I don't see any difference. Even more, I think this code worked some weeks ago, and now when I try to work with it again, that compilation error appears, and I don't know how to erase it.

Any clue would be appreciated. Thanks in advance.

Regards,

Aran
Re: method generateFile undefined for the type MyDslGenerator [message #1748803 is a reply to message #1748801] Mon, 28 November 2016 19:26 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14664
Registered: July 2009
Senior Member
can you please share the complete file.
are you sure the filesystemaccess file is found?


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Mon, 28 November 2016 19:29]

Report message to a moderator

Re: method generateFile undefined for the type MyDslGenerator [message #1748875 is a reply to message #1748803] Tue, 29 November 2016 16:03 Go to previous message
Aran A is currently offline Aran AFriend
Messages: 30
Registered: January 2011
Member
Hello,

Before sending the file I've just tried a last test. I've renamed the file and I've created a new one with exactly the same content as the old one. And now .... it works!!!!!

I promise, I haven't changed any letter in the file, it's exactly the same content, and now there isn't any error. I can't believe it!!! how much time I lost yesterday!!!

Thank you for your interest.

Best regards,

Aran
Previous Topic:Addictional Optional Argument Recognition
Next Topic:screen recorder to demo DSL
Goto Forum:
  


Current Time: Tue Apr 16 05:41:43 GMT 2024

Powered by FUDForum. Page generated in 0.35653 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top