Day 1. Assembly code is being generated, on a monkey see, monkey do basis;

but it doesn't link because of a missing library; and having moved source
files around the Makefile currently doesn't work.
This commit is contained in:
Simon Brooke 2026-04-06 09:48:44 +01:00
parent 8e9ad73229
commit 882f991db4
13 changed files with 206 additions and 36 deletions

45
src/c/error.h Normal file
View file

@ -0,0 +1,45 @@
/**
* error.h
*
* Grendel: a compiling Beowulf reimplementation.
*
* The error handling subsystem.
*
* Error codes are detailed in section 6.3, page 32, of the
* Lisp 1.5 Programmer's Manual. I shall in so far as possible follow
* those codes.
*
* (c) 2026 Simon Brooke <simon@journeyman.cc>
* Licensed under GPL version 2.0, or, at your option, any later version.
*/
#ifndef __grendel_error_h
#define __grendel_error_h
#include <stdint.h>
uint32_t make_error( char* code);
/**
* @brief error codes
*
* Error codes are detailed in section 6.3, page 32, of the
* Lisp 1.5 Programmer's Manual. I shall in so far as possible follow
* those codes.
*
* Error codes comprise a one or two alphabetic character category, followed
* by a single digit number. A space is shown in the manual between the
* category and the number, but I have not followed that here for reasons.
*/
#define APPLIED_FUNCTION_CALLED_ERROR (make_error( "A1"))
#define UNDEFINED_FUNCTION_APPLY_ERROR (make_error( "A2"))
#define COND_UNSATISFIED_ERROR (make_error( "A3"))
#define SETQ_ON_NONEXISTANT_VAR_ERROR (make_error( "A4"))
#define SET_ON_NONEXISTANT_VAR_ERROR (make_error( "A5"))
#define NO_TARGET_FOR_GO_ERROR (make_error( "A6"))
#define TOO_MANY_ARGUMENTS_ERROR (make_error( "A7"))
#define UNBOUND_VARIABLE_ERROR (make_error( "A8"))
#define UNDEFINED_FUNCTION_EVAL_ERROR (make_error( "A9"))
#endif