Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » <MyDSL>TerminalsValidator class not being generated(Houston, we have a problem with the generated code.)
<MyDSL>TerminalsValidator class not being generated [message #1770569] Mon, 14 August 2017 15:01 Go to next message
David BlackFriend
Messages: 33
Registered: June 2017
Member
Hi,

as in the subject: some types are missing in the generated code.

For example, my MyDSLValidator generated class is supposed to extend MyDSLTerminalsValidator, but the latter is missing. I don't think it's been generated, because it's not only missing as a type, but also as an Eclipse resource.

Any clues what to tweak to generate the artifacts properly?

Thanks in advance.

David
Re: <MyDSL>TerminalsValidator class not being generated [message #1770571 is a reply to message #1770569] Mon, 14 August 2017 15:11 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Can you give any steps to reproduce? How does the header of the grammar look like, how the workflow

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: <MyDSL>TerminalsValidator class not being generated [message #1770572 is a reply to message #1770571] Mon, 14 August 2017 15:23 Go to previous messageGo to next message
David BlackFriend
Messages: 33
Registered: June 2017
Member
Sure.

As for the head of the grammar, it's this:

grammar org.instrumenteddreams.lang.Sable with org.instrumenteddreams.lang.SableTerminals

generate sable "http://www.instrumenteddreams.org/lang/Sable"

Sable:
	source+=Statement*;


The workflow (which I am running as an almost-default run config, just with two parameters for tweaking VM's memory) is this:
module org.instrumenteddreams.lang.GenerateSable

import org.eclipse.xtext.xtext.generator.*
import org.eclipse.xtext.xtext.generator.model.project.*

var rootPath = ".."

Workflow {
	
	component = XtextGenerator {
		configuration = {
			project = StandardProjectConfig {
				baseName = "org.instrumenteddreams.sable.context"
				rootPath = rootPath
				runtimeTest = {
					enabled = true
				}
				eclipsePlugin = {
					enabled = true
				}
				eclipsePluginTest = {
					enabled = true
				}
				createEclipseMetaData = true
			}
			code = {
				encoding = "UTF-8"
				fileHeader = "/*\n * generated by Xtext \${version}\n */"
			}
		}
		language = StandardLanguage {
			parserGenerator = {
				options = {
					backtrack = false
				}
			}
			name = "org.instrumenteddreams.lang.Sable"
			fileExtensions = "Sable,sable"

			serializer = {
				generateStub = false
			}
			validator = {
				// composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
			}
		}
	}
}


Re: <MyDSL>TerminalsValidator class not being generated [message #1770577 is a reply to message #1770572] Mon, 14 August 2017 15:47 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
can you please share a complete reproducible sample projects i can simply import/clone and run

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: <MyDSL>TerminalsValidator class not being generated [message #1770579 is a reply to message #1770577] Mon, 14 August 2017 15:48 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
for me it looks line you use a supergrammar without any language section in the workflow.
this makes no sense to me.
the code in the fragments does not expect that


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: <MyDSL>TerminalsValidator class not being generated [message #1770587 is a reply to message #1770579] Mon, 14 August 2017 16:38 Go to previous messageGo to next message
David BlackFriend
Messages: 33
Registered: June 2017
Member
I've just used the wizard to generate the workflow from a sample DSL project, and then I developed the example language day by day until got a working grammar.

Should I have added manual chunks into the workflow? What sections are missing?
Re: <MyDSL>TerminalsValidator class not being generated [message #1770589 is a reply to message #1770587] Mon, 14 August 2017 16:42 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
First why do you have a own Terminals grammar at all

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: <MyDSL>TerminalsValidator class not being generated [message #1770600 is a reply to message #1770589] Mon, 14 August 2017 20:00 Go to previous messageGo to next message
David BlackFriend
Messages: 33
Registered: June 2017
Member
Christian Dietrich wrote on Mon, 14 August 2017 16:42
First why do you have a own Terminals grammar at all


To make things modular and have lesser files.
Re: <MyDSL>TerminalsValidator class not being generated [message #1770601 is a reply to message #1770600] Mon, 14 August 2017 20:08 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Just inline everything into your grammar
(No super grammar)
That's the easiest way


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

[Updated on: Mon, 14 August 2017 20:09]

Report message to a moderator

Re: <MyDSL>TerminalsValidator class not being generated [message #1770647 is a reply to message #1770601] Tue, 15 August 2017 14:32 Go to previous messageGo to next message
David BlackFriend
Messages: 33
Registered: June 2017
Member
Christian Dietrich wrote on Mon, 14 August 2017 20:08
Just inline everything into your grammar
(No super grammar)
That's the easiest way


Thanks for your hint. It seems to help. Now I have only one missing class, SableTerminalsQuickfixProvider. I assume the easiest way to fix this is just implementing it manually.

[Updated on: Tue, 15 August 2017 14:37]

Report message to a moderator

Re: <MyDSL>TerminalsValidator class not being generated [message #1770656 is a reply to message #1770647] Tue, 15 August 2017 18:00 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
simply delete the existing provider and let it generate again.
then this problem should be gone


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: <MyDSL>TerminalsValidator class not being generated [message #1770764 is a reply to message #1770656] Wed, 16 August 2017 22:17 Go to previous message
David BlackFriend
Messages: 33
Registered: June 2017
Member
It has indeed helped! Thanks again.
Previous Topic:How to use EOL to grammar
Next Topic:Infer local variable inside a method
Goto Forum:
  


Current Time: Thu Apr 25 05:38:54 GMT 2024

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

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

Back to the top