Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Issue with generator
Issue with generator [message #701483] Mon, 25 July 2011 03:11 Go to next message
Eclipse UserFriend
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 123 times)
Re: Issue with generator [message #701494 is a reply to message #701483] Mon, 25 July 2011 03:26 Go to previous messageGo to next message
Eclipse UserFriend
Hi, just from this I cannot tell what is wrong, can you post your
workflow.~Christian
Re: Issue with generator [message #701500 is a reply to message #701494] Mon, 25 July 2011 03:34 Go to previous messageGo to next message
Eclipse UserFriend
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 03:36 Go to previous messageGo to next message
Eclipse UserFriend
Hi, the workflow looks nice, are you sure that your templates in
combination with your models produce any files? Christian
Re: Issue with generator [message #701514 is a reply to message #701500] Mon, 25 July 2011 03:36 Go to previous messageGo to next message
Eclipse UserFriend
Hi, the workflow looks nice, are you sure that your templates in
combination with your models produce any files? Christian
Re: Issue with generator [message #701521 is a reply to message #701514] Mon, 25 July 2011 04:13 Go to previous messageGo to next message
Eclipse UserFriend
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 04:19 Go to previous messageGo to next message
Eclipse UserFriend
Hi, just make sure that your templates generate something out of this
grammar / model. E.f.by starting generating a file foreach model.
Re: Issue with generator [message #701535 is a reply to message #701532] Mon, 25 July 2011 04:29 Go to previous messageGo to next message
Eclipse UserFriend
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 04:31 Go to previous messageGo to next message
Eclipse UserFriend
As said before: strip down the generator
Re: Issue with generator [message #701549 is a reply to message #701542] Mon, 25 July 2011 04:47 Go to previous messageGo to next message
Eclipse UserFriend
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 04:53 Go to previous message
Eclipse UserFriend
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
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: Thu Nov 06 14:08:48 EST 2025

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

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

Back to the top