parse.h: parse.c
expr.c: y.tab.h
-$(filter-out scan.o parse.o,$(OBJECTS)): CFLAGS+=-ffunction-sections
+$(filter-out scan.o parse.o,$(OBJECTS)): CFLAGS+=-ffunction-sections -fdata-sections
clean:
$(RM) $(OBJECTS) y.output parse.h scan.h scan.c parse.c expr a.c
- $(MAKE) -C test clean
[plus] = "+", [minus] = "-", [times] = "*", [divide] = "/",
[modulo] = "%", [power] = "^",
};
-const char *fieldspec_str[] = {
- [fst] = "fst", [snd] = "snd", [hd] = "hd", [tl] = "tl"};
const char *unop_str[] = { [inverse] = "!", [negate] = "-", };
struct ast *ast(struct list *decls, YYLTYPE l)
{
struct decl *res = xalloc(1, struct decl);
res->loc = l;
- res->loc = l;
res->type = dfundecl;
res->data.dfun = fundecl;
return res;
{
struct decl *res = xalloc(1, struct decl);
res->loc = l;
- res->loc = l;
res->type = dvardecl;
res->data.dvar = vardecl;
return res;
struct ast;
#include "parse.h"
-extern const char *fieldspec_str[];
extern const char *binop_str[];
extern const char *unop_str[];
void expr_genc(struct expr *expr, FILE *cout);
-void binop_genc(char *fun, struct expr *l, struct expr *r, FILE *cout)
+static void binop_genc(char *fun, struct expr *l, struct expr *r, FILE *cout)
{
safe_fprintf(cout, "%s(", fun);
expr_genc(l, cout);