From f1a897cec0c239d55500c8b42d134841b5e97f22 Mon Sep 17 00:00:00 2001 From: kaashoek Date: Wed, 25 Nov 1987 14:41:10 +0000 Subject: [PATCH] Comments added --- util/ceg/EM_parser/common/action.c | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/util/ceg/EM_parser/common/action.c b/util/ceg/EM_parser/common/action.c index cecbd1dc1..628f7c6f9 100644 --- a/util/ceg/EM_parser/common/action.c +++ b/util/ceg/EM_parser/common/action.c @@ -1,14 +1,26 @@ #include "decl.h" #include - -int quantum = 0, nr_instr, block_saved, first_action, last_action; extern char *malloc(), *realloc(), *Salloc(); -char **as_instructions; + +/* This file contains some routines needed in "pars.g" to handle the action- + * grammarrule. The assembler-instructions are handeld in blocks rather than + * one at a time. So these routines provide saving and removing of assembler- + * instructions. + */ + +char **as_instructions; /* The buffer(?) where the instructions are saved */ + +int quantum = 0, /* Max. nr. of instructions in as_instructions[] */ + nr_instr, /* Number of saved instructions */ + first_action, /* Is this block of assembler-instr. the first after + * a '==>' or '::=' ? + */ + last_action; /* Is this block followed by a '.' ? */ + init_as_block() { nr_instr = 0; - block_saved = TRUE; if ( quantum == 0) { quantum = 16; @@ -19,6 +31,9 @@ init_as_block() save_as( instr) char *instr; + +/* Save a copy of 'instr' + */ { if ( nr_instr == quantum) { quantum *= 2; @@ -33,13 +48,11 @@ do_block_assemble() { int i; - if ( block_saved) { + if ( nr_instr > 0) { block_assemble( as_instructions, nr_instr, first_action, last_action); for ( i=0; i