ack/util/topgen
George Koehler 51e34acab1 Add a syntax to declare functions in a top table
Use the new syntax in the mips, pdp, powerpc tables to declare
functions before calling them.  These declarations prevent compiler
warnings about implicitly declaring functions.  They also provide
prototypes of the function parameters.

Also fix a warning in the powerpc table: use `bsearch(...) != NULL` to
avoid converting the pointer from bsearch() to an int.

The syntax for topgen is a block `{...}` among the parameters in the
top table.  It looks like the syntax of LLgen, but topgen doesn't
allow nested blocks, so declarations like `struct whatever {...};`
don't work.  The token OPEN_BRACKET that begins a declaration_block
doesn't conflict with the LETTER that begins a parameter_line or the
'%' that begins a separator.

Because a block writes a #line command to gen.h, a parameter line now
also writes a #line command to gen.h, so it doesn't get a wrong line
number from a previous block.
2019-10-30 18:36:55 -04:00
..
build.lua Biggish refactor to break cycles; my build rules were full of them. cpm builds, 2016-08-14 01:39:40 +02:00
hash.c Better ANSI C compatibility and portability: 2019-02-19 00:54:24 +08:00
hash.h Better ANSI C compatibility and portability: 2019-02-19 00:54:24 +08:00
LLlex.c Better ANSI C compatibility and portability: 2019-02-19 00:54:24 +08:00
main.c Include more headers to declare functions. 2019-03-22 15:59:35 -04:00
misc.h Header --> Id 1994-06-24 11:31:16 +00:00
pattern.c Better ANSI C compatibility and portability: 2019-02-19 00:54:24 +08:00
pattern.h Better ANSI C compatibility and portability: 2019-02-19 00:54:24 +08:00
symtab.c ANSI C conversion. 2019-05-11 01:18:01 +08:00
symtab.h Header --> Id 1994-06-24 11:31:16 +00:00
token.h Header --> Id 1994-06-24 11:31:16 +00:00
topgen.g Add a syntax to declare functions in a top table 2019-10-30 18:36:55 -04:00
tunable.h Header --> Id 1994-06-24 11:31:16 +00:00