Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMT (Generative Modeling Technologies) » [MOFScript] Java Integration - Parse Error
[MOFScript] Java Integration - Parse Error [message #378270] Tue, 26 June 2007 15:26 Go to next message
Eclipse User
Originally posted by: chhirsch.rumms.uni-mannheim.de

Hi everybody,

i'm getting a Parse Error, when trying to parse a MOFScript Transformation
using the MOFScript Java API.
Somehow the imports declared in the transformation can not be found.
When executing the transformation within Eclipse, everything is fine.
I also tried to convert the imported transformations into model-format
before executing the program.

I have the three following m2t-files in the same folder:

OMEGA.m2t
Web.m2t
CMS.m2t


OMEGA.m2t contains the following code:

texttransformation OMEGA (in uml:"http://www.eclipse.org/uml2/2.0.0/UML") {
access library aName "Web.m2t"
access library aName "CMS.m2t"
uml.Class::main () {
self.mapWebClasses()
self.mapCMSClasses()
}
}

The transformation rules mapWebClasses() and mapCMSClasses()
are declared in the imported transformations.

By using the following java code, i'm trying to parse this file:

MOFScriptSpecification spec = parserUtil.parse(new File(
" C:\\eclipse\\workspace\\omega.test.plugin.codegeneratorMOFSc ript\\src\\temp
lates\\OMEGA.m2t"), true);

I'm getting the following errors:

Parsing result: 4 errors
2007-06-26 20:49:57,202 [Worker-2] ERROR
(omega.test.plugin.codegeneratorMOFScript.base.MOFScriptCode Generator:76)
: Error: MTTParseError: Cannot find import: Web.m2t, line: 10, column: 9
2007-06-26 20:49:57,202 [Worker-2] ERROR
(omega.test.plugin.codegeneratorMOFScript.base.MOFScriptCode Generator:76)
: Error: MTTParseError: Cannot find import: CMS.m2t, line: 16, column: 6
2007-06-26 20:49:57,202 [Worker-2] ERROR
(omega.test.plugin.codegeneratorMOFScript.base.MOFScriptCode Generator:76)
: Error: MTTParseError: Undefined function call: mapWebClasses, line: 20,
column: 7
2007-06-26 20:49:57,202 [Worker-2] ERROR
(omega.test.plugin.codegeneratorMOFScript.base.MOFScriptCode Generator:76)
: Error: MTTParseError: Undefined function call: mapCMSClasses, line: 22,
column: 4

Does anybody have any ideas, what could be wrong here?

Thanks,
Christian
Re: [MOFScript] Java Integration - Parse Error [message #378272 is a reply to message #378270] Wed, 27 June 2007 08:17 Go to previous messageGo to next message
Eclipse User
Originally posted by: angel.calvo.centic.es

Hi,

Try this before call parseUtil.parse:

parserUtil.setCompilePath(templatesDir);

Where templatesDir is a string with templates dir path,

Regards.

Christian Hirsch escribió:
> Hi everybody,
>
> i'm getting a Parse Error, when trying to parse a MOFScript Transformation
> using the MOFScript Java API.
> Somehow the imports declared in the transformation can not be found.
> When executing the transformation within Eclipse, everything is fine.
> I also tried to convert the imported transformations into model-format
> before executing the program.
>
> I have the three following m2t-files in the same folder:
>
> OMEGA.m2t
> Web.m2t
> CMS.m2t
>
>
> OMEGA.m2t contains the following code:
>
> texttransformation OMEGA (in uml:"http://www.eclipse.org/uml2/2.0.0/UML") {
> access library aName "Web.m2t"
> access library aName "CMS.m2t"
> uml.Class::main () {
> self.mapWebClasses()
> self.mapCMSClasses()
> }
> }
>
> The transformation rules mapWebClasses() and mapCMSClasses()
> are declared in the imported transformations.
>
> By using the following java code, i'm trying to parse this file:
>
> MOFScriptSpecification spec = parserUtil.parse(new File(
> " C:\\eclipse\\workspace\\omega.test.plugin.codegeneratorMOFSc ript\\src\\temp
> lates\\OMEGA.m2t"), true);
>
> I'm getting the following errors:
>
> Parsing result: 4 errors
> 2007-06-26 20:49:57,202 [Worker-2] ERROR
> (omega.test.plugin.codegeneratorMOFScript.base.MOFScriptCode Generator:76)
> : Error: MTTParseError: Cannot find import: Web.m2t, line: 10, column: 9
> 2007-06-26 20:49:57,202 [Worker-2] ERROR
> (omega.test.plugin.codegeneratorMOFScript.base.MOFScriptCode Generator:76)
> : Error: MTTParseError: Cannot find import: CMS.m2t, line: 16, column: 6
> 2007-06-26 20:49:57,202 [Worker-2] ERROR
> (omega.test.plugin.codegeneratorMOFScript.base.MOFScriptCode Generator:76)
> : Error: MTTParseError: Undefined function call: mapWebClasses, line: 20,
> column: 7
> 2007-06-26 20:49:57,202 [Worker-2] ERROR
> (omega.test.plugin.codegeneratorMOFScript.base.MOFScriptCode Generator:76)
> : Error: MTTParseError: Undefined function call: mapCMSClasses, line: 22,
> column: 4
>
> Does anybody have any ideas, what could be wrong here?
>
> Thanks,
> Christian
>
>
Re: [MOFScript] Java Integration - Parse Error [message #378415 is a reply to message #378272] Thu, 28 June 2007 05:09 Go to previous messageGo to next message
Eclipse User
Originally posted by: chhirsch.rumms.uni-mannheim.de

Thanks, it's working now.

By the way, is there a MOFScript Java API Documentation available somewhere?
I didn't find one through Google Search.

Greetings, Christian


"Angel Luis Calvo Ortega" <angel.calvo@centic.es> schrieb im Newsbeitrag
news:f5tkg2$2ap$1@build.eclipse.org...
> Hi,
>
> Try this before call parseUtil.parse:
>
> parserUtil.setCompilePath(templatesDir);
>
> Where templatesDir is a string with templates dir path,
>
> Regards.
>
> Christian Hirsch escribi
Re: [MOFScript] Java Integration - Parse Error [message #378416 is a reply to message #378415] Thu, 28 June 2007 06:14 Go to previous message
Gøran K. Olsen is currently offline Gøran K. Olsen
Messages: 184
Registered: July 2009
Senior Member
Hello Christian,
The Javadoc is available from eclipse help->mofscript->reference->API

/G
Re: [MOFScript] Java Integration - Parse Error [message #602124 is a reply to message #378270] Wed, 27 June 2007 08:17 Go to previous message
Eclipse User
Originally posted by: angel.calvo.centic.es

Hi,

Try this before call parseUtil.parse:

parserUtil.setCompilePath(templatesDir);

Where templatesDir is a string with templates dir path,

Regards.

Christian Hirsch escribió:
> Hi everybody,
>
> i'm getting a Parse Error, when trying to parse a MOFScript Transformation
> using the MOFScript Java API.
> Somehow the imports declared in the transformation can not be found.
> When executing the transformation within Eclipse, everything is fine.
> I also tried to convert the imported transformations into model-format
> before executing the program.
>
> I have the three following m2t-files in the same folder:
>
> OMEGA.m2t
> Web.m2t
> CMS.m2t
>
>
> OMEGA.m2t contains the following code:
>
> texttransformation OMEGA (in uml:"http://www.eclipse.org/uml2/2.0.0/UML") {
> access library aName "Web.m2t"
> access library aName "CMS.m2t"
> uml.Class::main () {
> self.mapWebClasses()
> self.mapCMSClasses()
> }
> }
>
> The transformation rules mapWebClasses() and mapCMSClasses()
> are declared in the imported transformations.
>
> By using the following java code, i'm trying to parse this file:
>
> MOFScriptSpecification spec = parserUtil.parse(new File(
> " C:\\eclipse\\workspace\\omega.test.plugin.codegeneratorMOFSc ript\\src\\temp
> lates\\OMEGA.m2t"), true);
>
> I'm getting the following errors:
>
> Parsing result: 4 errors
> 2007-06-26 20:49:57,202 [Worker-2] ERROR
> (omega.test.plugin.codegeneratorMOFScript.base.MOFScriptCode Generator:76)
> : Error: MTTParseError: Cannot find import: Web.m2t, line: 10, column: 9
> 2007-06-26 20:49:57,202 [Worker-2] ERROR
> (omega.test.plugin.codegeneratorMOFScript.base.MOFScriptCode Generator:76)
> : Error: MTTParseError: Cannot find import: CMS.m2t, line: 16, column: 6
> 2007-06-26 20:49:57,202 [Worker-2] ERROR
> (omega.test.plugin.codegeneratorMOFScript.base.MOFScriptCode Generator:76)
> : Error: MTTParseError: Undefined function call: mapWebClasses, line: 20,
> column: 7
> 2007-06-26 20:49:57,202 [Worker-2] ERROR
> (omega.test.plugin.codegeneratorMOFScript.base.MOFScriptCode Generator:76)
> : Error: MTTParseError: Undefined function call: mapCMSClasses, line: 22,
> column: 4
>
> Does anybody have any ideas, what could be wrong here?
>
> Thanks,
> Christian
>
>
Re: [MOFScript] Java Integration - Parse Error [message #602194 is a reply to message #378272] Thu, 28 June 2007 05:09 Go to previous message
Eclipse User
Originally posted by: chhirsch.rumms.uni-mannheim.de

Thanks, it's working now.

By the way, is there a MOFScript Java API Documentation available somewhere?
I didn't find one through Google Search.

Greetings, Christian


"Angel Luis Calvo Ortega" <angel.calvo@centic.es> schrieb im Newsbeitrag
news:f5tkg2$2ap$1@build.eclipse.org...
> Hi,
>
> Try this before call parseUtil.parse:
>
> parserUtil.setCompilePath(templatesDir);
>
> Where templatesDir is a string with templates dir path,
>
> Regards.
>
> Christian Hirsch escribi
Re: [MOFScript] Java Integration - Parse Error [message #602200 is a reply to message #378415] Thu, 28 June 2007 06:14 Go to previous message
Gøran K. Olsen is currently offline Gøran K. Olsen
Messages: 184
Registered: July 2009
Senior Member
Hello Christian,
The Javadoc is available from eclipse help->mofscript->reference->API

/G
Previous Topic:[MOFScript] Doesn't anyone have MOFScript install details?
Next Topic:[TCS] Transformation files in TCSToolkit
Goto Forum:
  


Current Time: Sat Aug 30 10:23:35 EDT 2014

Powered by FUDForum. Page generated in 0.08533 seconds