Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Issue with generator
Issue with generator [message #701483] Mon, 25 July 2011 07:11 Go to next message
Arun  is currently offline Arun Friend
Messages: 26
Registered: July 2011
Junior Member
Hi,

All of a sudden, i could not generate any files from the generator. Eclipse console displays the following lines for a while. Any inputs on this?

0 [main] DEBUG org.eclipse.xtext.mwe.Reader - Resource Pathes : [src/model]
0 [main] INFO org.eclipse.xpand2.Generator - No meta models configured, using JavaBeans as default.

Thanks,
Arun

  • Attachment: console.bmp
    (Size: 445.40KB, Downloaded 76 times)
Re: Issue with generator [message #701494 is a reply to message #701483] Mon, 25 July 2011 07:26 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13591
Registered: July 2009
Senior Member
Hi, just from this I cannot tell what is wrong, can you post your
workflow.~Christian


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Issue with generator [message #701500 is a reply to message #701494] Mon, 25 July 2011 07:34 Go to previous messageGo to next message
Arun  is currently offline Arun Friend
Messages: 26
Registered: July 2011
Junior Member
Christian,

No update in the workflow. Any way posting here,

module workflow.AtgDslGenerator

import org.eclipse.emf.mwe.utils.*

var targetDir = "src-gen"
var fileEncoding = "Cp1252"
var modelPath = "src/model"

Workflow {

component = org.eclipse.xtext.mwe.Reader {
// lookup all resources on the classpath
// useJavaClassPath = true

// or define search scope explicitly
path = modelPath

// this class will be generated by the xtext generator
register = com.atg.atgdsl.AtgDslStandaloneSetup {}
load = {
slot = "models"
type = "Model"
}
}

component = org.eclipse.xpand2.Generator {
expand = "templates::Template::main FOREACH models"
outlet = {
path = targetDir
postprocessor = org.eclipse.xpand2.output.JavaBeautifier{}
}
fileEncoding = fileEncoding
}
}
Re: Issue with generator [message #701513 is a reply to message #701500] Mon, 25 July 2011 07:36 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13591
Registered: July 2009
Senior Member
Hi, the workflow looks nice, are you sure that your templates in
combination with your models produce any files? Christian


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Issue with generator [message #701514 is a reply to message #701500] Mon, 25 July 2011 07:36 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13591
Registered: July 2009
Senior Member
Hi, the workflow looks nice, are you sure that your templates in
combination with your models produce any files? Christian


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Issue with generator [message #701521 is a reply to message #701514] Mon, 25 July 2011 08:13 Go to previous messageGo to next message
Arun  is currently offline Arun Friend
Messages: 26
Registered: July 2011
Junior Member
Christian,

I drilled down further to debug the issue. Actually the generator stops working when i updated my model.

My model as follows

grammar org.xtext.example.mydsl.MessageDsl with org.eclipse.xtext.common.Terminals

generate messageDsl "http://www.xtext.org/example/mydsl/MessageDsl"

Model :
name=ID
(packages+=Package)*;

Package:
"package" name=STRING '{'
(types+=Type)*
'}';

Type:
MessageConfig ;

MessageConfig:

"MessageConfig" name=ID "{"
(messageSourceConfig+=MessageSourceConfig)*
"}"
;

MessageSourceConfig:
"MessageSourceConfig" name=ID "sends" "(a)" "message(s)" "{"
( ("via" "port" portname+=PortName)? | (destination+=Destination (',' destination+=Destination)*))+
//(("via port" portname+=ID)? destination+=Destination (',' destination+=Destination)* )*
"}"
;

PortName:
name=ID (destination+=Destination (',' destination+=Destination)*)*;

Destination:
"to" "the" "destination(s)" name=ID "of" "type" ((dmsType+=DMSTYPE|ID) "managed" "by" ( (providerType+=ProviderType) | (thirdpartyProviderName+=ID)))*
;

enum DMSTYPE:
TOPIC="topic" | QUEUE="queue";

enum ProviderType:
LOCAL="local" | SQLDMS="sqldms";



MessageSource can have any number of destinations (without port name)

If port name has been mentioned, it can have any number of destinations.

Example.mydsl

package "messaging" {

MessageConfig fdf {

MessageSourceConfig TestSource sends (a) message(s) {
to the destination(s) normalmsgtpoic of type topic managed by local
to the destination(s) emergencymsgtpoic of type topic managed by ibm
via port high to the destination(s) hightopic of type topic managed by sqldms
}
}
}

Re: Issue with generator [message #701532 is a reply to message #701521] Mon, 25 July 2011 08:19 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13591
Registered: July 2009
Senior Member
Hi, just make sure that your templates generate something out of this
grammar / model. E.f.by starting generating a file foreach model.


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Issue with generator [message #701535 is a reply to message #701532] Mon, 25 July 2011 08:29 Go to previous messageGo to next message
Arun  is currently offline Arun Friend
Messages: 26
Registered: July 2011
Junior Member
Nope. The generator hangs while running. No files were generated.
Re: Issue with generator [message #701542 is a reply to message #701535] Mon, 25 July 2011 08:31 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13591
Registered: July 2009
Senior Member
As said before: strip down the generator

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Issue with generator [message #701549 is a reply to message #701542] Mon, 25 July 2011 08:47 Go to previous messageGo to next message
Arun  is currently offline Arun Friend
Messages: 26
Registered: July 2011
Junior Member
Sorry christian Sad . I didn't get you on "Strip down the generator".
BTW, Do you find any issue in my grammar. Because, it is working an hour before with this grammar ,

(("via port" portname+=ID)? destination+=Destination (',' destination+=Destination)* )*

it stopped working after i changed to

( ("via" "port" portname+=PortName)? | (destination+=Destination (',' destination+=Destination)*))+

What's wrong in the grammar ?
Re: Issue with generator [message #701559 is a reply to message #701549] Mon, 25 July 2011 08:53 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13591
Registered: July 2009
Senior Member
Hi,

no i have no idea.

PortName is now an object and you might have to handle this in the generator.

with stipping down in mean:
(1)do not walk over the model in the generator.
(2) walk a few steps over the model in the generator.
(3) walk a more steps over the model in the generator.
....

~Christian


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:LWC2011 document, "Using the manually maintained Ecore model"
Next Topic:"static initializer is exceeding the 65535 bytes limit" with xtext2.0
Goto Forum:
  


Current Time: Sat Sep 19 19:29:19 GMT 2020

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

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

Back to the top