Attached find a cleaned up preprocessor. Though
it doesn't plug straight into the public version
of NASM, it might be useful as a reference.
There are pp_nasm (the real thing), pp_null (the
null preprocesor), manuals.txt (with the relevant
documentation), stdmac.inc (standard macros), as
well as todo.txt (a collection of comments).
The only part of the code that I'm not too happy
with is the PP_ASSIGN & Co handling (inside the
do_directive() function) -- unfortunately all the
variants got added one by one... which shows.
user manual
NASM preprocessor (source)
Logged In: YES
user_id=804543
Originator: YES
File Added: pp_nasm.c
Logged In: YES
user_id=804543
Originator: YES
File Added: pp_nasm.h
NASM preprocessor (header)
NULL preprocessor (source)
Logged In: YES
user_id=804543
Originator: YES
File Added: pp_null.c
Logged In: YES
user_id=804543
Originator: YES
File Added: pp_null.h
NULL preprocessor (header)
Logged In: YES
user_id=804543
Originator: YES
File Added: stdmac.inc
standard macros
Logged In: YES
user_id=804543
Originator: YES
File Added: todo.txt
to-do list, comments, etc.
Logged In: YES
user_id=804543
Originator: YES
In an attempt to mate this with NASM 2.x, I made
a bare minimum set of changes (e.g. type defs),
and got to the point where I had these problems:
error: 'evalresult' undeclared (first use in this function)
error: 'expr_t' undeclared (first use in this function)
error: 'FLOAT_DAZ_DEFAULT' undeclared (first use in this function)
error: 'FLOAT_DAZ_OFF' undeclared (first use in this function)
error: 'FLOAT_DAZ_ON' undeclared (first use in this function)
error: 'FLOAT_RC_DEFAULT' undeclared (first use in this function)
error: 'GI_INC' undeclared (first use in this function)
error: 'LIST_INPUT' undeclared (first use in this function)
error: 'LIST_STRING' undeclared (first use in this function)
error: 'private' undeclared (first use in this function)
error: 'stdmac_main' undeclared (first use in this function)
error: 'TOKEN_OFF' undeclared (first use in this function)
error: 'TOKEN_ROL' undeclared (first use in this function)
error: 'TOKEN_ROR' undeclared (first use in this function)
error: 'TOKEN_SAL' undeclared (first use in this function)
error: 'TOKEN_SAR' undeclared (first use in this function)
error: 'TOKEN_SIZE' undeclared (first use in this function)
error: 'TOKEN_WPOS' undeclared (first use in this function)
error: 'tokval' undeclared (first use in this function)
error: 'tokval_t' undeclared (first use in this function)
error: (Each undeclared identifier is reported only once
error: called object 'eval' is not a function
error: for each function it appears in.)
error: parse error before '*' token
error: parse error before 'eval'
error: parse error before 'pass'
error: parse error before 'pp_nasm'
error: parse error before 'tokval'
error: parse error before 'tokval_t'
error: request for member 'dec' in something not a structure or union
error: request for member 'inc' in something not a structure or union
error: request for member 'info' in something not a structure or union
error: request for member 'out_num' in something not a structure or union
error: request for member 'out_str' in something not a structure or union
error: stdmac.h: No such file or directory
error: too few arguments to function 'float_const'
warning: implicit declaration of function 'src_clr_macro_error_line'
warning: implicit declaration of function 'src_get_input_error_line'
warning: implicit declaration of function 'src_set_input_error_line'
warning: implicit declaration of function 'src_set_macro_error_line'
I'll keep you posted as I get further.
This patch is no longer relevant considering the preprocessor rewrite that is occuring. I am officially marking this as rejected.