diff --git a/c/dsls/Makefile.am b/c/dsls/Makefile.am index ea4236c84..6528d200a 100644 --- a/c/dsls/Makefile.am +++ b/c/dsls/Makefile.am @@ -20,6 +20,8 @@ lemon_SOURCES= lemon.c \ lemon_plink.h \ lemon_report.c \ lemon_report.h \ + lemon_set.c \ + lemon_set.h \ lemon_string.c \ lemon_string.h \ lemon_structs.h \ diff --git a/c/dsls/Makefile.no-autoconfig b/c/dsls/Makefile.no-autoconfig index 2840480b4..a3ecd9666 100644 --- a/c/dsls/Makefile.no-autoconfig +++ b/c/dsls/Makefile.no-autoconfig @@ -112,6 +112,8 @@ lemon: lemon.c \ lemon_error.c \ lemon_string.h \ lemon_string.c \ + lemon_set.h \ + lemon_set.c \ lemon_memory.h \ lemon_memory.c \ lemon_option.h \ @@ -127,7 +129,7 @@ lemon: lemon.c \ lemon_parse.c \ lemon_report.h \ lemon_report.c - $(DSLCC) -o lemon lemon.c lemon_assert.c lemon_error.c lemon_string.c lemon_memory.c lemon_option.c lemon_action.c lemon_symbol.c lemon_plink.c lemon_parse.c lemon_report.c + $(DSLCC) -o lemon lemon.c lemon_assert.c lemon_error.c lemon_string.c lemon_set.c lemon_memory.c lemon_option.c lemon_action.c lemon_symbol.c lemon_plink.c lemon_parse.c lemon_report.c # ---------------------------------------------------------------- clean: diff --git a/c/dsls/lemon.c b/c/dsls/lemon.c index 6b2f90b5a..304019e4c 100644 --- a/c/dsls/lemon.c +++ b/c/dsls/lemon.c @@ -21,6 +21,7 @@ #include "lemon_structs.h" #include "lemon_action.h" #include "lemon_string.h" +#include "lemon_set.h" #include "lemon_report.h" #include "lemon_symbol.h" #include "lemon_plink.h" @@ -48,21 +49,6 @@ struct config *Configlist_basis(/* void */); void Configlist_eat(/* struct config * */); void Configlist_reset(/* void */); -/********** From the file "set.h" ****************************************/ -void SetSize(/* int N */); /* All sets will be of size N */ -char *SetNew(/* void */); /* A new set for element 0..N */ -void SetFree(/* char* */); /* Deallocate a set */ - -int SetAdd(/* char*,int */); /* Add element to a set */ -int SetUnion(/* char *A,char *B */); /* A <- A U B, thru element N */ - -#define SetFind(X,Y) (X[Y]) /* True if Y is in set X */ - -/********** From the file "struct.h" *************************************/ -/* -** Principal data structures for the LEMON parser generator. -*/ - /**************** From the file "table.h" *********************************/ /* ** All code in this file has been automatically generated @@ -1041,66 +1027,6 @@ char *msort(char *list, char **next, int (*cmp)()) return ep; } -/***************** From the file "set.c" ************************************/ - -/* -** Set manipulation routines for the LEMON parser generator. -*/ - -static int size = 0; - -/* Set the set size */ -void SetSize(n) -int n; -{ - size = n+1; -} - -/* Allocate a new set */ -char *SetNew(){ - char *s; - int i; - s = (char*)malloc (size) ; - if (s==0) { - extern void memory_error(); - memory_error(); - } - for(i=0; i +#include +#include + +#include "lemon_set.h" + +/* +** Set manipulation routines for the LEMON parser generator. +*/ + +static int size = 0; + +/* Set the set size */ +void SetSize(int n) { + size = n+1; +} + +/* Allocate a new set */ +char *SetNew() { + char *s; + int i; + s = (char*)malloc (size) ; + if (s==0) { + extern void memory_error(); + memory_error(); + } + for(i=0; i