#include <assert.h>
#include "strict3rd.h"
-#include "dbsymtab.h"
#include "idf.h"
#include "LLlex.h"
#include "def.h"
{ ++proclevel; }
ProcedureHeading(&df, D_PROCEDURE)
{
-#ifdef DBSYMTAB
- if (options['g']) stb_string(df, D_PROCEDURE);
-#endif /* DBSYMTAB */
}
';'
block(&(df->prc_body))
IDENT
{
-#ifdef DBSYMTAB
- if (options['g']) stb_string(df, D_PEND);
-#endif /* DBSYMTAB */
EndProc(df, dot.TOK_IDF);
--proclevel;
}
df->con_const = nd->nd_token;
df->df_type = nd->nd_type;
FreeNode(nd);
-#ifdef DBSYMTAB
- if (options['g']) stb_string(df, D_CONST);
-#endif /* DBSYMTAB */
}
;
C_ina_dnam(df->var_name);
}
}
-#ifdef DBSYMTAB
- if (options['g']) stb_string(df, D_VARIABLE);
-#endif /* DBSYMTAB */
}
FreeNode(Idlist);
}
}
#endif
+void
No_Mem()
{
fatal("out of memory");
}
+void
C_failed()
{
fatal("write failed");
#include <em_code.h>
#include <stb.h>
-#include "strict3rd.h"
#include "dbsymtab.h"
+#include "strict3rd.h"
#include "main.h"
#include "idf.h"
#include "LLlex.h"
';'
import(1)*
export(&qualified, &exportlist)
- {
-#ifdef DBSYMTAB
- if (options['g']) stb_string(df, D_MODULE);
-#endif /* DBSYMTAB */
- }
block(&(df->mod_body))
IDENT { EnterExportList(exportlist, qualified);
-#ifdef DBSYMTAB
- if (options['g']) stb_string(df, D_END);
-#endif /* DBSYMTAB */
close_scope(SC_CHKFORW|SC_CHKPROC|SC_REVERSE);
match_id(df->df_idf, dot.TOK_IDF);
}
DefinitionModule++;
if (!Defined) {
Defined = df;
-#ifdef DBSYMTAB
- if (options['g']) stb_string(df, D_MODULE);
-#endif /* DBSYMTAB */
}
}
';'
df->df_type = construct_type(T_HIDDEN, NULLTYPE);
}
]
- ';'
{
#ifdef DBSYMTAB
- if (options['g']) stb_string(df, D_TYPE);
-#endif /* DBSYMTAB */
+ if (options['g']) stb_string(df, D_TYPE);
+#endif
}
+ ';'
]*
|
VAR [ %persistent VariableDeclaration ';' ]*
df->mod_vis = CurrVis;
CurrentScope->sc_name = "__M2M_";
CurrentScope->sc_definedby = df;
-#ifdef DBSYMTAB
- if (options['g']) stb_string(df, D_MODULE);
-#endif /* DBSYMTAB */
}
}
priority(&(df->mod_priority))
';' import(0)*
block(&(df->mod_body)) IDENT
{
-#ifdef DBSYMTAB
- if (options['g']) {
- if (state == PROGRAM) {
- C_ms_stb_cst(df->df_idf->id_text,
- N_MAIN,
- 0,
- (arith) 0);
- }
- stb_string(df, D_END);
- }
-#endif /* DBSYMTAB */
close_scope(SC_CHKFORW|SC_CHKPROC|SC_REVERSE);
match_id(df->df_idf, dot.TOK_IDF);
}
static int RegisterMessage();
static int WalkDef();
+#ifdef DBSYMTAB
+static int stabdef();
+#endif
static int MkCalls();
static int UseWarnings();
text_label = 1; /* label at end of initialization routine */
TmpOpen(sc); /* Initialize for temporaries */
C_pro_narg(sc->sc_name);
+#ifdef DBSYMTAB
+ if (options['g']) {
+ stb_string(module, D_MODULE);
+ WalkDefList(sc->sc_def, stabdef);
+ if (state == PROGRAM && module == Defined) {
+ C_ms_stb_cst(module->df_idf->id_text,
+ N_MAIN,
+ 0,
+ (arith) 0);
+ }
+ stb_string(module, D_END);
+ }
+#endif
DoPriority();
if (module == Defined) {
/* Body of implementation or program module.
C_pro_narg(procedure->prc_name);
#ifdef DBSYMTAB
if (options['g']) {
+ stb_string(procedure, D_PROCEDURE);
+ WalkDefList(procscope->sc_def, stabdef);
+ stb_string(procedure, D_PEND);
C_ms_std((char *) 0, N_LBRAC, proclevel);
}
#endif /* DBSYMTAB */
C_pro(procedure->prc_name, -procscope->sc_off);
#ifdef DBSYMTAB
if (options['g']) {
+ stb_string(procedure, D_PROCEDURE);
+ WalkDefList(procscope->sc_def, stabdef);
+ stb_string(procedure, D_PEND);
C_ms_std((char *) 0, N_LBRAC, proclevel);
}
#endif /* DBSYMTAB */
(*proc)(df);
}
}
+
+#ifdef DBSYMTAB
+static int
+stabdef(df)
+ t_def *df;
+{
+ switch(df->df_kind) {
+ case D_CONST:
+ case D_VARIABLE:
+ stb_string(df, df->df_kind);
+ break;
+ }
+}
+#endif