Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » [TCS] Context and leaveContext
[TCS] Context and leaveContext [message #618] Tue, 19 February 2008 09:08 Go to next message
T Kruse is currently offline T KruseFriend
Messages: 73
Registered: July 2009
Member
Hi,

I noticed in generated ANTLR3 grammars, that certain elements look like
this:
name ...
: ...
{
ei.leaveContext(false);
}
;

now the leaveContextmethod looks like this:

public void leaveContext(boolean leave) {
if(leave) currentContext = currentContext.parent();
}

So I cannot see the point of calling leaveContext with false. So I wonder,
what is the reason for this (Or is it something historical)?

regards,
Thibault
Re: [TCS] Context and leaveContext [message #642 is a reply to message #618] Tue, 19 February 2008 17:34 Go to previous message
Frédéric Jouault is currently offline Frédéric JouaultFriend
Messages: 572
Registered: July 2009
Senior Member
Hello,

> I noticed in generated ANTLR3 grammars, that certain elements look like
> this:
> name ...
> : ...
> { ei.leaveContext(false);
> }
> ;
>
> now the leaveContextmethod looks like this:
>
> public void leaveContext(boolean leave) {
> if(leave) currentContext = currentContext.parent();
> }
>
> So I cannot see the point of calling leaveContext with false. So I
> wonder, what is the reason for this (Or is it something historical)?

It is something historical ;-).


Regards,

Frédéric Jouault
Previous Topic:slightly off topic
Next Topic:[TCS] Discarding tokens
Goto Forum:
  


Current Time: Sat Jul 13 17:08:47 GMT 2024

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

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

Back to the top