Menu

#1 BacktrackingParser: Parsing an empty stream leads Exception

open
nobody
None
5
2006-07-20
2006-07-20
Uwe Voigt
No

java.lang.ArrayIndexOutOfBoundsException: 0
at lpg.lpgjavaruntime.IntTuple.add(IntTuple.java:75)
at
lpg.lpgjavaruntime.BacktrackingParser.parse(BacktrackingParser.java:129)

adding one to the size of the newly created array would
smoothly fix this issue

System.arraycopy(array, 0, array = new int[i * 2 + 1],
0, i);
----

Discussion


Log in to post a comment.