[Yhc] Re: YHI Loader ...generated bytecode as C but some errors.

Tom Shackell shackell at cs.york.ac.uk
Wed Aug 29 05:51:32 EDT 2007


Hi Alexis,

Sorry for the slow reply but I've been on holiday for the last week and 
a half I'll try to answer all your questions ;-)

Most of these errors I suspect are lack of forward declarations. As well 
as generating a .c file you also need to generate a .h file declaring 
all the things you are going to define. This is so they can all link to 
each other properly. For example

// --------------------------------------------------------------
// program.h
// --------------------------------------------------------------

extern UInt8 bytecode_Main_2Emain[];
extern UByte ctypes_Main_2Emain[];
extern PInfo pinfo_Main_2Emain[];
extern FInfo finfo_Main_2Emain;
extern ConstItem ctable_Main_2Emain[];
extern Word node_0x18720024[];
extern UInt8 bytecode_Main_2Efac[];
extern UByte ctypes_Main_2Efac[];
extern PInfo pinfo_Main_2Efac[];
extern FInfo finfo_Main_2Efac;
extern ConstItem ctable_Main_2Efac[];
extern Word node_0x18720490[];

//-------------------------------------------------------------

now at the top of your generate .c file you would have

	#include "program.h"

You should easily be able to generate the .h file at the same time as 
you generate the .c file.

That should hopefully fix a lot of the problems.

Thanks

Tom


More information about the Yhc mailing list