Re: New Euphoria to C translator

new topic     » topic index » view thread      » older message » newer message

Bob Springett writes:
> If a candidate euphoria program is translated to C
> prior to compiling and it has errors in it, where in
> the process will the errors be reported? In the translation
> stage where the error messages will be familiar to a
> euphoria programmer or in the compilation stage
> where the error messages will be familiar to a C programmer?

Syntax errors, symbol-not-declared, include file missing, etc.
in your Euphoria program will be caught by the translator at
translation time. The translator uses
exactly the same parser as the interpreter and issues the
same error messages.

After a (syntax error free) translation, the generated C code
should compile and link without errors.
You don't have to know anything about C to debug your program.

In generating C code, the translator assumes that your program
is free of run-time errors. i.e. that your program can be run
by the interpreter without triggering any run-time error reports.
The translator provides no run-time checks for subscript
out of bounds, uninitialized variables, assigning the wrong type
of data to a variable, etc. although some of the run-time routines
will detect and report certain errors into ex.err before
halting your program.

If your program has (say) a subscript error in it, you will likely see
some kind of machine-level exception on your screen.
Try the same test again using the interpreter.

The registered version of the
translator does have a facility for reporting the last
100 Euphoria statements that were performed (by the C code)
before a machine-exception occurred. You activate this
facility by specifying "with trace" and "trace(1)" in your program.
The registered version also inserts your Euphoria statements
as comments in the C source.

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu