Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #37807

Re: Two exceptions

From Kiwi User <martin@mydomain.invalid> (Kiwi User)
Newsgroups comp.lang.java.programmer
Subject Re: Two exceptions
Date 2017-12-10 21:50 +1200
Organization fsxNet Usenet Gateway | bbs.geek.nz/#fsxNet
Message-ID <742769493@f38.n261.z1.binkp.net> (permalink)
References <596732943@f38.n261.z1.binkp.net>

Show all headers | View raw


On Sun, 10 Dec 2017 00:52:14 +1200, Kiwi User wrote:

> On Sun, 10 Dec 2017 02:39:33 +0200, Victor Porton wrote:
>
>> I haven't considered this perhaps because Ada does not allow a class to
>> be a member of object (without wrapping it into something called
>> Indefinite_Wrapper or something similar). So in Ada this would be
>> inconvenient.
>>
> This looks like the best solution suggested so far, particularly if it
> is expanded to include an error message and provide a boolean isError()
> method.

Gaaaagh: Misplaced comment: I meant to say that I thought Eric's ParseResult
class looked, to me anyway, like the best solution I've seen so far.

It deals with all possible results neatly and doesn't need to use exception
handling for unexceptional results (matched, didn't match, unrecognised input)
so it leaves Exceptions free to handle parser internal errors AND, if extended
to hold error descriptions, it provides a neat way of returning error messages
without having to pass an error reporting channel reference to every operation
on the recursive parse stack.


--
Martin    | martin at
Gregorie  | gregorie
          | dot org

Back to comp.lang.java.programmer | Previous | Next | Find similar | Unroll thread


Thread

Re: Two exceptions Kiwi User <martin@mydomain.invalid> (Kiwi User) - 2017-12-10 21:50 +1200

csiph-web