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


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

Re: Two exceptions

Path csiph.com!news.bbs.geek.nz!.POSTED.agency.bbs.geek.nz!not-for-mail
From Kiwi User <martin@mydomain.invalid> (Kiwi User)
Newsgroups comp.lang.java.programmer
Subject Re: Two exceptions
Date Sun, 10 Dec 2017 21:50:34 +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>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
Injection-Info news.bbs.geek.nz; posting-host="M6YmRdZYyc42DJk0lNlt/X4dpP4dzvceBNabSmESN3E"; logging-data="22966"; mail-complaints-to="abuse@news.bbs.geek.nz"
User-Agent VSoup v1.2.9.47Beta [95/NT]
X-MailConverter SoupGate-Win32 v1.05
X-Comment-To Kiwi User
Xref csiph.com comp.lang.java.programmer:37807

Show key headers only | 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