private ]b4_location_type[ yylloc (YYStack rhs, int n)
{
if (n > 0)
- return new ]b4_location_type[ (rhs.locationAt (1).begin, rhs.locationAt (n).end);
+ return new ]b4_location_type[ (rhs.locationAt (n-1).begin, rhs.locationAt (0).end);
else
return new ]b4_location_type[ (rhs.locationAt (0).end);
}]])[
}
public final void pop () {
- height--;
+ pop (1);
}
public final void pop (int num) {
// Avoid memory leaks... garbage collection is a white lie!
if (num > 0) {
- java.util.Arrays.fill (valueStack, height - num + 1, height, null);
- ]b4_locations_if([[java.util.Arrays.fill (locStack, height - num + 1, height, null);]])[
+ java.util.Arrays.fill (valueStack, height - num + 1, height + 1, null);
+ ]b4_locations_if([[java.util.Arrays.fill (locStack, height - num + 1, height + 1, null);]])[
}
height -= num;
}
{
out.print ("Stack now");
- for (int i = 0; i < height; i++)
+ for (int i = 0; i <= height; i++)
{
out.print (' ');
out.print (stateStack[i]);