[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [pdf-devel] Error management in type 4 functions
From: |
jemarch |
Subject: |
Re: [pdf-devel] Error management in type 4 functions |
Date: |
Thu, 05 Feb 2009 23:36:15 +0100 |
User-agent: |
Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.6 Emacs/23.0.60 (i686-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) |
Hi David.
On the one hand, we need a list of syntax errors and a way to
report them in `pdf_fp_func_4_new'. I think that a PDF_BADSYNTAX
return value would works fine. But if more defailed errors are
required, an extra argument is valid.
A detailed report about the error is required by the standard. In this
case we can use some kind of struct to get the syntax errors.
Anyway, the syntax
constructions in the language are `if' and 'ifelse'. They seem
like:
{ ... } if
{ ... } { ... } ifelse
Indeed, whole PostScript code should be wrapped with braces
too. So, we could report bad balanced braces and missing { ... }
construct.
Right.
On the other hand, we can use the same way to report errors to
caller from `pdf_fp_func_eval'. In this case, we suggest the
following generic interpretation errors:
- Bad number of inputs
- Bad number of outputs
- Math error
- Internal error
Math error consists of division-by-zero, negative square root, etc,
and internal error would be arised, for example, when the stack of
a type 4 function overflows.
Would be useful to return more detailed information: it would be
really difficult to fix a buggy function facing something like
"Internal error". But it would be quite difficult to do it in a
generic way.
What about adding a new specific `pdf_fp_func_4_eval' function? It
would break the generic function application schema, but we can always
expand the API to ask a function its type.
What do you think?
--
Jose E. Marchesi <address@hidden>
http://www.jemarch.net
GNU Project http://www.gnu.org