snc: re-factored and polished function definitions
This came out of the desire to allow function definitions intermixed with c code and other definitions, and not only at the end of the program but also in the initial definition section. Some amount of re-factoring was necessary in the analysis part to make this possible, since previously we had only one definition list per scope and now the program has two. More changes were needed in the code generation, mostly to pick apart the stuff that the parser now mixes together, and also to beautify the generated code. The separate declarations for function definitions are no longer in the header file; they are static anyway. One difference in behaviour is that now the extra escaped C code sections at the end of a program are paced *before* the state set code. The advantage is that extra prototypes are no longer needed (except if the functions call each other resursively). This change should not break existing programs, since C functions cannot call state set functions.
Showing
- src/snc/analysis.c 91 additions, 83 deletionssrc/snc/analysis.c
- src/snc/analysis.h 1 addition, 1 deletionsrc/snc/analysis.h
- src/snc/gen_code.c 45 additions, 31 deletionssrc/snc/gen_code.c
- src/snc/gen_ss_code.c 18 additions, 9 deletionssrc/snc/gen_ss_code.c
- src/snc/snl.lem 23 additions, 21 deletionssrc/snc/snl.lem
- src/snc/types.h 3 additions, 4 deletionssrc/snc/types.h
Loading
Please register or sign in to comment