Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Semantic Models X AST's(Are Semantic Models and AST's similar concepts for Xtext?)
Semantic Models X AST's [message #1402492] Thu, 17 July 2014 04:18 Go to next message
Fernando Costa is currently offline Fernando CostaFriend
Messages: 5
Registered: June 2014
Location: Brazil
Junior Member
Hi, I'm a newbie on Xtext and I have a theorical question about the relationship between Semantic Models and AST's (Abstract Syntax Trees). Reading the Martin Folwer's book "Domain-Specific Languages", I have found the following understanding:

Quote:

3.2 The Workings of a Parser:

...Effectively, people can use the syntax tree as a semantic model. Most of the time I would not do that, because the syntax tree is very tied to the syntax of the DSL script and thus couples the processing of the DSL to its syntax...

[Page 1447, kindle edition]


On the other hand, the Xtext Web documentation states:

Quote:

Parser Rules

...parser rules are handled as kind of a building plan for the creation of the EObjects (src) that form the semantic model (the linked abstract syntax graph or AST)...


Therefore, I think that for the Xtext language workbench, Semantic Models and AST's are treated almost interchangeably. So, I'd like to know. Do you share the Folwer's opinion? Does this really produce an undesirable level of coupling? It seems that in his point of view, they should be considered separately. Indeed there are other chapters of the above referenced book where he says that it's possible to use the concept of Semantic Models even out of the DSL context. For this reason, it would be valuable to avoid such a coupling.

Thanks in advance for any answer.

[Updated on: Thu, 17 July 2014 04:19]

Report message to a moderator

Re: Semantic Models X AST's [message #1402600 is a reply to message #1402492] Thu, 17 July 2014 07:59 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

When you have the simplicity and freedom to make semantic (Concrete
Syntax) and Abstract Syntax models the same, Xtext gives you an
excellent solution.

When things get more complicated, Xtext is still very useful but you
have to work harder. Eclipse OCL has an extensible framework that uses
Xtext for CS and partially for AS. Increased auto-generation is under
active development,. See
http://www.eclipse.org/modeling/mdt/ocl/docs/publications/MODELS2010OCLWorkshop/oclxtext.pdf
and
http://www.eclipse.org/modeling/mdt/ocl/docs/publications/OMG2011Dec/OMG2011Dec.pdf.

Regards

Ed Willink


On 17/07/2014 05:18, Fernando Costa wrote:
> Hi,I'm a newbie on Xtext and I have a theorical question about the
> relationship between Semantic Models and AST's (Abstract Syntax
> Trees). Reading the Martin Folwer's book "Domain-Specific Languages",
> I have found the following understanding:
>
> Quote:
>> 3.2 The Workings of a Parser:
>>
>> ...Effectively, people can use the syntax tree as a semantic model.
>> Most of the time I would not do that, because the syntax tree is very
>> tied to the syntax of the DSL script and thus couples the processing
>> of the DSL to its syntax...
>>
>> [Page 1447, kindle edition]
>
>
> On the other hand, the Xtext Web documentation states:
>
> Quote:
>> Parser Rules
>>
>> ...parser rules are handled as kind of a building plan for the
>> creation of the EObjects (src) that form the semantic model (the
>> linked abstract syntax graph or AST)...
>
>
> Therefore, I think that for the Xtext language workbench, Semantic
> Models and AST's are treated almost interchangeably. So, I'd like to
> know. Do you share the Folwer's opinion? Does this really produce an
> undesirable level of coupling? It seems that in his point of view,
> they should be considered separately. Indeed there are other chapters
> of the above referenced book where he says that it's possible to use
> the concept of Semantic Models even out of the DSL context. For this
> reason, it would be valuable to avoid such a coupling.
>
> Thanks in advance for any answer.
Previous Topic:Weird behavior using "Project/Clean.." in Eclipse
Next Topic:Integrating GMF into Xtext
Goto Forum:
  


Current Time: Thu Apr 25 20:16:34 GMT 2024

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

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

Back to the top