[TCS] possible bug in ContextIterator [message #7352] |
Mon, 17 March 2008 07:26  |
Eclipse User |
|
|
|
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 #7375 is a reply to message #7364] |
Mon, 17 March 2008 11:56  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.03301 seconds