I have translated all of the ST4 runtime (excepting  gui) into ObjC. However, I 
don't understand this line of Java code from ST.java.

locals = Arrays.copyOf(locals, impl.formalArguments.size())

I am working on the Test-ing. In TestCoreBasics, in TestaChainAttr (numbers are 
because OCTest sorts the functions alphabetically)

- (void) test02aChainAttr
{
   NSString * template = @"<x>:<names>!";
   ST *st = [ST newSTWithTemplate:template];
   [[[st add:@"names" value:@"Ter"] add:@"names" value:@"Tom"] addInt:@"x" 
value:1];
   NSString * expected = @"1:TerTom!";
   NSString * result = [st render];
   STAssertTrue( [expected isEqualTo:result], @"Expected \"%@\" but got 
\"%@\"", expected, result );
}

"[expected isEqualTo:result]" should be true. Expected "1:TerTom!" but got 
"1names!"

I have stepped through the whole thing in the debugger "Ter" and "Tom" are in 
the dictionary but st render never looks up "names" in the dictionary. However, 
it is obviously looking up 'x' in the dictionary and getting the object "1". It 
is just being treated as a raw attribute. Any ideas what the likely culprit is?

I am suspicious that it relates to the line of code that I referenced above. In 
locals I have "Tom" and "Ter" in an array the pointer to which is at index 0 in 
locals, "1" is stored as a pointer to string at index 1 in locals. Does this 
sound correct or should the whole list "Ter", "Tom", and "1" be in one list in 
locals?

It is passing tests 1, 2, but failing 2a and 3, then passing 4, 5, 6 after 6 it 
fails everything until it just bombs.

Alan

---

Alan Condit
1085 Tierra Ct.
Woodburn, OR 97071

Email -- [email protected]
Home-Office (503) 982-0906

_______________________________________________
antlr-dev mailing list
[email protected]
http://www.antlr.org/mailman/listinfo/antlr-dev

Reply via email to