Paste: parser
Author: | j |
Mode: | text |
Date: | Sun, 15 Aug 2010 23:09:05 |
Plain Text |
expr(a, iter) { throw BadParse; }
overload expr(a: Int, iter) = expr1(*nextToken(iter), iter, Expression(a));
overload expr(a: OpenParen, iter) {
var ret = expr(*nextToken(iter), iter);
expectToken(iter, CloseParen);
return ret;
}
expr1(b, iter, a) { throw BadParse; }
overload expr1(b: Plus, iter, a) = Expression(PlusNode(a, expr(*nextToken(iter), iter)));
overload expr1(b: Times, iter, a) = Expression(TimesNode(a, expr(*nextToken(iter), iter)));
New Annotation