Skip to main content



      Home
Home » Modeling » TMF (Xtext) » [TCS] Context and leaveContext
[TCS] Context and leaveContext [message #618] Tue, 19 February 2008 04:08 Go to next message
Eclipse UserFriend
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 12:34 Go to previous message
Eclipse UserFriend
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: Mon May 12 00:36:45 EDT 2025

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

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

Back to the top