Skip to main content



      Home
Home » Modeling » TMF (Xtext) » [TCS] possible bug in ContextIterator
[TCS] possible bug in ContextIterator [message #7352] Mon, 17 March 2008 07:26 Go to next message
Eclipse UserFriend
Hi,

I have no error case for this, but the code looks dodgy to me:
in TCSRuntime.ContextIterator

public boolean hasNext() {
while(importedContexts.hasNext() && (!i.hasNext()) && !finishCurrent){
Context c = (Context)importedContexts.next();
if(!traversed.contains(c)) {
traversed.add(c);
currentIterator = c.iterator(traversed);
i = currentIterator;
} else {
System.out.println("ERROR: recursive contexts");
}
}
return i.hasNext();
}

I don't know for sure, but I guess within if, a break statement would make
sense, such that the code does not ignore all but the last of the imported
contexts.
Re: [TCS] possible bug in ContextIterator [message #7364 is a reply to message #7352] Mon, 17 March 2008 07:30 Go to previous messageGo to next message
Eclipse UserFriend
I can't even see imported Contexts used in any parser I generated, so
maybe it's just leftover code that never gets executed.
Re: [TCS] possible bug in ContextIterator [message #7375 is a reply to message #7364] Mon, 17 March 2008 11:56 Go to previous message
Eclipse UserFriend
Hello Thibault,

> I can't even see imported Contexts used in any parser I generated, so
> maybe it's just leftover code that never gets executed.

Do you use the "importContext" keyword? If not, then it is normal that
no context ever gets imported. If you do use this keyword, then there
may be a problem.


Best regards,

Frédéric Jouault
Previous Topic:[TCS] indexing values in list property
Next Topic:[TCS] unused binary operators
Goto Forum:
  


Current Time: Fri Jul 04 05:19:53 EDT 2025

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

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

Back to the top