Giannis Georgalis wrote:
The generated scanner is not big (about 300 loc).
A more interesting measure is .class file size.
As you note, generated scanners are faster because they save a lot of function calls, have lookup tables,
Lookup tables are difficult when using Unicode - a simple one-element-per-character table is too wasteful, at least for a non-critical helper class like URI.
and as far as I remember they work like FSMs (finite state machines).
That does not say anything about the implementation. A hand-written scanner is also a FSM.
Additionally don't forget that the URI objects are immutable. That means that as soon as the parsing is complete, the parser object is *dead*.
But you still have to allocate the parser object(s), which a hand-written parser doesn't have to. And object allocation is relatively expensive, in the context of parsing a URI. -- --Per Bothner [EMAIL PROTECTED] http://www.bothner.com/per/ _______________________________________________ Classpath mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/classpath

