Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Re: [OCL] AstNode - startPosition is a transient attribute
Re: [OCL] AstNode - startPosition is a transient attribute [message #56574] Fri, 23 May 2008 13:27 Go to next message
Eclipse User
Originally posted by: cdamus.zeligsoft.com

--=-JPqi7hPmMlHglIwWVn+n
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi, Jonathan,

As Eike indicated, the OCL component has its own newsgroup (which I have
copied in the reply).

This attribute is transient because it supports the parsing process, but
is not semantically relevant to OCL expressions. Traceability to the
source text doesn't belong in the abstract syntax model, but rather in
the concrete-syntax model. This attribute actually pre-dates the CST
implementation and is retained only for API compatibility reasons. A
better solution would use a mapping of AST nodes to the CST nodes from
which they were parsed.

Cheers,

Christian


On Fri, 2008-05-23 at 14:45 +0200, Jonathan MUSSET wrote:

> Hi everybody
> Do you know why the "startPosition" attribute (in the EClass ASTNode) is
> transient? I would like to know the position of each OCL expression in
> my AST model. Is it possible?
> Thank you
>
> Jonathan

--=-JPqi7hPmMlHglIwWVn+n
Content-Type: text/html; charset=utf-8

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.16.1">
</HEAD>
<BODY>
Hi, Jonathan,<BR>
<BR>
As Eike indicated, the OCL component has its own newsgroup (which I have copied in the reply).<BR>
<BR>
This attribute is transient because it supports the parsing process, but is not semantically relevant to OCL expressions.&nbsp; Traceability to the source text doesn't belong in the abstract syntax model, but rather in the concrete-syntax model.&nbsp; This attribute actually pre-dates the CST implementation and is retained only for API compatibility reasons.&nbsp; A better solution would use a mapping of AST nodes to the CST nodes from which they were parsed.<BR>
<BR>
Cheers,<BR>
<BR>
Christian<BR>
<BR>
<BR>
On Fri, 2008-05-23 at 14:45 +0200, Jonathan MUSSET wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Hi everybody</FONT>
<FONT COLOR="#000000">Do you know why the &quot;startPosition&quot; attribute (in the EClass ASTNode) is </FONT>
<FONT COLOR="#000000">transient? I would like to know the position of each OCL expression in </FONT>
<FONT COLOR="#000000">my AST model. Is it possible?</FONT>
<FONT COLOR="#000000">Thank you</FONT>

<FONT COLOR="#000000">Jonathan</FONT>
</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>

--=-JPqi7hPmMlHglIwWVn+n--
Re: [OCL] AstNode - startPosition is a transient attribute [message #56599 is a reply to message #56574] Fri, 23 May 2008 14:48 Go to previous messageGo to next message
Jonathan MUSSET is currently offline Jonathan MUSSET
Messages: 43
Registered: July 2009
Member
Hi Christian,

I agree with your choice.

Where can I find this information?

I'm using an an helper -> OCLHelper<EClassifier, EOperation,
EStructuralFeature, Constraint>

The method "createQuery" returns an OCL expression
Is there a way to find the CST information? perhaps "helper.getOCL()"?

Cheers,

Jonathan




Christian W. Damus a écrit :
> Hi, Jonathan,
>
> As Eike indicated, the OCL component has its own newsgroup (which I have
> copied in the reply).
>
> This attribute is transient because it supports the parsing process, but
> is not semantically relevant to OCL expressions. Traceability to the
> source text doesn't belong in the abstract syntax model, but rather in
> the concrete-syntax model. This attribute actually pre-dates the CST
> implementation and is retained only for API compatibility reasons. A
> better solution would use a mapping of AST nodes to the CST nodes from
> which they were parsed.
>
> Cheers,
>
> Christian
>
>
> On Fri, 2008-05-23 at 14:45 +0200, Jonathan MUSSET wrote:
>> Hi everybody
>> Do you know why the "startPosition" attribute (in the EClass ASTNode) is
>> transient? I would like to know the position of each OCL expression in
>> my AST model. Is it possible?
>> Thank you
>>
>> Jonathan
Re: [OCL] AstNode - startPosition is a transient attribute [message #56626 is a reply to message #56599] Fri, 23 May 2008 15:30 Go to previous messageGo to next message
Jonathan MUSSET is currently offline Jonathan MUSSET
Messages: 43
Registered: July 2009
Member
I found the following map :
helper.getOCL().getEnvironment()).getASTNodeToCSTNodeMap()

Is it the only way?


Jonathan MUSSET a écrit :
> Hi Christian,
>
> I agree with your choice.
>
> Where can I find this information?
>
> I'm using an an helper -> OCLHelper<EClassifier, EOperation,
> EStructuralFeature, Constraint>
>
> The method "createQuery" returns an OCL expression
> Is there a way to find the CST information? perhaps "helper.getOCL()"?
>
> Cheers,
>
> Jonathan
>
>
>
>
> Christian W. Damus a écrit :
>> Hi, Jonathan,
>>
>> As Eike indicated, the OCL component has its own newsgroup (which I
>> have copied in the reply).
>>
>> This attribute is transient because it supports the parsing process,
>> but is not semantically relevant to OCL expressions. Traceability to
>> the source text doesn't belong in the abstract syntax model, but
>> rather in the concrete-syntax model. This attribute actually
>> pre-dates the CST implementation and is retained only for API
>> compatibility reasons. A better solution would use a mapping of AST
>> nodes to the CST nodes from which they were parsed.
>>
>> Cheers,
>>
>> Christian
>>
>>
>> On Fri, 2008-05-23 at 14:45 +0200, Jonathan MUSSET wrote:
>>> Hi everybody
>>> Do you know why the "startPosition" attribute (in the EClass ASTNode)
>>> is transient? I would like to know the position of each OCL
>>> expression in my AST model. Is it possible?
>>> Thank you
>>>
>>> Jonathan
Re: [OCL] AstNode - startPosition is a transient attribute [message #56788 is a reply to message #56626] Mon, 26 May 2008 13:22 Go to previous message
Eclipse User
Originally posted by: cdamus.zeligsoft.com

Hi, Jonathan,

Yes, that is the way to access the AST-to-CST mapping.

Cheers,

Christian

On Fri, 2008-05-23 at 17:30 +0200, Jonathan MUSSET wrote:
> I found the following map :
> helper.getOCL().getEnvironment()).getASTNodeToCSTNodeMap()
>
> Is it the only way?
>
>
> Jonathan MUSSET a écrit :
> > Hi Christian,
> >
> > I agree with your choice.
> >
> > Where can I find this information?
> >
> > I'm using an an helper -> OCLHelper<EClassifier, EOperation,
> > EStructuralFeature, Constraint>
> >
> > The method "createQuery" returns an OCL expression
> > Is there a way to find the CST information? perhaps "helper.getOCL()"?
> >
> > Cheers,
> >
> > Jonathan
> >
> >
> >
> >
> > Christian W. Damus a écrit :
> >> Hi, Jonathan,
> >>
> >> As Eike indicated, the OCL component has its own newsgroup (which I
> >> have copied in the reply).
> >>
> >> This attribute is transient because it supports the parsing process,
> >> but is not semantically relevant to OCL expressions. Traceability to
> >> the source text doesn't belong in the abstract syntax model, but
> >> rather in the concrete-syntax model. This attribute actually
> >> pre-dates the CST implementation and is retained only for API
> >> compatibility reasons. A better solution would use a mapping of AST
> >> nodes to the CST nodes from which they were parsed.
> >>
> >> Cheers,
> >>
> >> Christian
> >>
> >>
> >> On Fri, 2008-05-23 at 14:45 +0200, Jonathan MUSSET wrote:
> >>> Hi everybody
> >>> Do you know why the "startPosition" attribute (in the EClass ASTNode)
> >>> is transient? I would like to know the position of each OCL
> >>> expression in my AST model. Is it possible?
> >>> Thank you
> >>>
> >>> Jonathan
Previous Topic:OCL expression for return type
Next Topic:Iterate over Associations
Goto Forum:
  


Current Time: Sat Oct 25 00:10:30 GMT 2014

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

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