Yes, I should complete the example on that page a bit more. Don't
now why it's missing certain methods, must be a mistake when doing
copy-paste from the real source code that is distributed in the
download package. Have you checked the examples in the directory
test/src/java/net/percederberg/grammatica/test? You should file
the complete ArithmeticCalculator there with all the omitted
methods filled out with working code. The grammar file is stored
in the test/src/grammar directory.
Cheers,
/Per
On mon, 2005-03-28 at 23:22 -0300, Leonardo Kenji Shikida wrote:
this seems to be a great software, but I simply can't use the documentation.
see http://www.nongnu.org/grammatica/doc/manual/example.html
ArithmeticCalculator example is incomplete and even if I complete it (to make
it compile), it does not work, raising the following exception right here
protected Node exitTerm(Production node) {
ArrayList values = getChildValues(node);
Integer value1;
Integer value2;
String op;
int result;
if (values.size() == 1) {
result = ((Integer) values.get(0)).intValue();
} else {
value1 = (Integer) values.get(0); <== here
value2 = (Integer) values.get(2);
op = (String) values.get(1);
result = operate(op, value1, value2);
}
node.addValue(new Integer(result));
return node;
}
too sad :( a single complete example even in the distribution tarball
would be great
K.
_______________________________________________
Grammatica-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/grammatica-users