Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMT (Generative Modeling Technologies) » [TCS] More than one syntax construction per class AND optional keywords
[TCS] More than one syntax construction per class AND optional keywords [message #611113] Tue, 08 January 2008 10:09
Gustavo Cabral is currently offline Gustavo Cabral
Messages: 20
Registered: July 2009
Junior Member
Hi everyone,

Is it possible to define more than one syntax definition per class
of the DSL metamodel. For example, something like this:

-- KM3
class NounNamePlural {
attribute name : String;
attribute plural : String;
}

-- TCS (Solution 2)
template NounNamePlural addToContext
: name "is a noun and its plural form is" plural "."
;

template NounNamePlural addToContext
: name "is a noun; its plural form is" plural "."
;

-- TCS (Solution 2)
template NounNamePlural addToContext
: name "is a noun and its plural form is" plural "."
| name "is a noun; its plural form is" plural "."
;

I know the code\syntax above doesn't work! Is there any alternative syntax
I can use? In ANTLR, I would use the | constructor. What would it be in
TCS?

The second question is: is it possible to have optional constructor? In
ANTLT it would be ( "optional terminal or nonterminal" )?. In TCS? I would
like to have:

template NounNamePlural addToContext
: name "is a noun and its plural" ("form")? is" plural "."
;

for instance.

Best regards and thank you,
Gustavo Cabral
Previous Topic:[AM3] Am3 installation problem
Next Topic:[TCS] More than one syntax construction per class AND optional keywords
Goto Forum:
  


Current Time: Fri Sep 19 19:53:57 GMT 2014

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

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