From 0acca04802397ce41cab23ff8a45a289d71bd738 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rafa=C5=82=20D=C5=82ugo=C5=82=C4=99cki?= Date: Mon, 15 Jul 2013 07:07:46 +0200 Subject: [PATCH] vlp-10 using coding style in intdt.c. Prepared comments for Doxygen documentation generator. --- src/int/intdt.c | 302 +++++++++++++++++++++++++++++++++++------------- 1 file changed, 222 insertions(+), 80 deletions(-) diff --git a/src/int/intdt.c b/src/int/intdt.c index 86470b2..1e46b4f 100644 --- a/src/int/intdt.c +++ b/src/int/intdt.c @@ -1,96 +1,238 @@ -#include "depend.h" -#include "genint.h" -#include "int.h" -#include "process.h" -#include "intproto.h" +#include "depend.h" +#include "genint.h" +#include "int.h" +#include "process.h" +#include "intproto.h" -/* Variables common with generator : */ +/** + * \defgroup Variables common with generator : + * @{ + */ + +/** + * prototypes + */ +protdescr *prototype[MAXPROT + 1]; -protdescr *prototype[ MAXPROT+1 ]; /* prototypes */ -word ipradr; /* address of primitive types descriptions */ -word temporary; /* address of global temporary variables */ -word strings; /* base for string constants */ -word lastprot; /* the last used prototype number */ -word freem; /* first free cell in M */ -word currfile = 2; /* current file virtual address */ +/** + * address of primitive types descriptions + */ +word ipradr; -/* Interpreter own variables : */ +/** + * address of global temporary variables + */ +word temporary; -memory M; /* main memory for code and data */ -union value *param; /* for comunication with standard procs */ +/** + * base for string constants + */ +word strings; -/* offset conversion table for compactification */ +/** + * the last used prototype number + */ +word lastprot; + +/** + * first free cell in M + */ +word freem; + +/** + * current file virtual address + */ +word currfile = 2; +/** @} */ + +/** + * Interpreter own variables : + * @{ + **/ + +/** + * main memory for code and data + */ +memory M; + +/** + * for comunication with standard procs + */ +union value *param; +/** @} */ + +/** + * offset conversion table for compactification + */ int offset[] = { DUMMY, SL, DL, CL, CHD, VIRTSC }; -/* signal to number conversion table */ -/* -1 stands for an unrecoverable error which cannot be serviced by handler */ - -int scot[] = -{ - 20, /* RTESLCOF */ - 20, /* RTEUNSTP */ - 20, /* RTEILLAT */ - 20, /* RTEILLDT */ - 20, /* RTECORTM */ - 20, /* RTECORAC */ - 23, /* RTEINVIN */ - 23, /* RTEILLAB */ - 21, /* RTEINCQA */ - 24, /* RTEINCAS */ - 20, /* RTEFTPMS */ - 20, /* RTEILLKL */ - 20, /* RTEILLCP */ - 24, /* RTEINCHS */ - -1, /* RTEHNDNF */ - 22, /* RTEMEMOV */ - 22, /* RTEFHTLG */ - -1, /* RTEILLRT */ - 21, /* RTEREFTN */ - 01, /* RTEDIVBZ */ - 02, /* RTESYSER */ - 02, /* RTEILLIO */ - 02, /* RTEIOERR */ - 02, /* RTECNTOP */ - 02, /* RTEBADFM */ - 20, /* RTEILLRS */ - 02, /* RTETMPRC */ - 02, /* RTEINVND */ - 23, /* RTENEGST */ - -1 /* RTENONGL */ +/** + * signal to number conversion table + * -1 stands for an unrecoverable error which cannot be serviced by handler + */ +int scot[] = { + /** RTESLCOF */ + 20, + /** RTEUNSTP */ + 20, + /** RTEILLAT */ + 20, + /** RTEILLDT */ + 20, + /** RTECORTM */ + 20, + /** RTECORAC */ + 20, + /** RTEINVIN */ + 23, + /** RTEILLAB */ + 23, + /** RTEINCQA */ + 21, + /** RTEINCAS */ + 24, + /** RTEFTPMS */ + 20, + /** RTEILLKL */ + 20, + /** RTEILLCP */ + 20, + /** RTEINCHS */ + 24, + /** RTEHNDNF */ + -1, + /** RTEMEMOV */ + 22, + /** RTEFHTLG */ + 22, + /** RTEILLRT */ + -1, + /** RTEREFTN */ + 21, + /** RTEDIVBZ */ + 01, + /** RTESYSER */ + 02, + /** RTEILLIO */ + 02, + /** RTEIOERR */ + 02, + /** RTECNTOP */ + 02, + /** RTEBADFM */ + 02, + /** RTEILLRS */ + 20, + /** RTETMPRC */ + 02, + /** RTEINVND */ + 02, + /** RTENEGST */ + 23, + /** RTENONGL */ + -1 }; -/* Primitive type appetites for moveparams() : */ - -int primapet[] = -{ - APINT, /* INTEGER */ - APREAL, /* REAL */ - APINT, /* BOOLEAN */ - APINT, /* CHAR */ - APREF, /* COROUTINE */ - APREF, /* PROCESS */ - APINT /* STRING */ +/** + * Primitive type appetites for moveparams() : + */ +int primapet[] = { + /** INTEGER */ + APINT, + /** REAL */ + APREAL, + /** BOOLEAN */ + APINT, + /** CHAR */ + APINT, + /** COROUTINE */ + APREF, + /** PROCESS */ + APREF, + /** STRING */ + APINT }; -word ic; /* instruction counter */ -word lastic; /* previous ic for redecoding after compact. */ -int opcode; /* opcode of L-code instruction */ -word a1, a2, a3; /* arguments of L-code instructions */ +/** + * instruction counter + */ +word ic; + +/** + * previous ic for redecoding after compact. + */ +word lastic; + +/** + * opcode of L-code instruction + */ +int opcode; + +/** + * arguments of L-code instructions + */ +word a1, a2, a3; + +/** + * \defgroup kernel variables for the running system: + */ +/**@{*/ +/** + * code and data memory size + */ +word memorysize = DEFMEMSIZE; + +/** + * pointers to current object + */ +word c1, c2; + +/** + * DISPLAY offset in process object + */ +word dispoff; +/** + * indirect DISPLAY offset in process object + */ +word disp2off; + +/** + * DISPLAY address - physical addresses + */ +word display; +/** + * DISPLAY address - indirect addresses + */ +word display2; + +/** + * main block object + */ +word mainprog; + +/** + * offset of variable main + **/ +word mnoff; -/* kernel variables for the running system: */ +/**@}*/ -word memorysize = DEFMEMSIZE; /* code and data memory size */ -word c1, c2; /* pointers to current object */ -word dispoff; /* DISPLAY offset in process object */ -word disp2off; /* indirect DISPLAY offset in process object */ -word display; /* DISPLAY address - physical addresses */ -word display2; /* DISPLAY address - indirect addresses */ -word mainprog; /* main block object */ -word mnoff; /* offset of variable main */ +/** + * default: no compactification message + */ +bool infmode = FALSE; +/** + * TRUE if trace is printed + */ +bool debug = FALSE; -bool infmode = FALSE; /* default: no compactification message */ -bool debug = FALSE; /* TRUE if trace is printed */ -FILE *tracefile; /* output file for trace */ +/** + * output file for trace + */ +FILE *tracefile; -jmp_buf contenv; /* for continue execution */ +/** + * for continue execution + */ +jmp_buf contenv; -- 2.30.2