Commit 687b09f9 authored by John van Groningen's avatar John van Groningen
Browse files

remove more undefined fields and definitions

parent 4b23867c
...@@ -2539,8 +2539,6 @@ DeclareFunctionC (char *name, int arity, int functionIndex, unsigned int ancesto ...@@ -2539,8 +2539,6 @@ DeclareFunctionC (char *name, int arity, int functionIndex, unsigned int ancesto
newSymbDef->sdef_dcl_icl = NULL; newSymbDef->sdef_dcl_icl = NULL;
newSymbDef->sdef_isused = 0; newSymbDef->sdef_isused = 0;
newSymbDef->sdef_line = 0; /* used in PrintType */
*icl->beicl_depsP = newSymbDef; *icl->beicl_depsP = newSymbDef;
icl->beicl_depsP = &newSymbDef->sdef_next_scc; icl->beicl_depsP = &newSymbDef->sdef_next_scc;
newSymbDef->sdef_arfun = NoArrayFun; newSymbDef->sdef_arfun = NoArrayFun;
...@@ -2660,7 +2658,6 @@ BEDeclareRuleType (int functionIndex, int moduleIndex, CleanString name) ...@@ -2660,7 +2658,6 @@ BEDeclareRuleType (int functionIndex, int moduleIndex, CleanString name)
newSymbDef->sdef_ident = newIdent; newSymbDef->sdef_ident = newIdent;
newSymbDef->sdef_mark = 0; newSymbDef->sdef_mark = 0;
newSymbDef->sdef_isused = 0; newSymbDef->sdef_isused = 0;
newSymbDef->sdef_line = 0; /* used in PrintSymbolOfIdent */
functions [functionIndex].symb_kind = definition; functions [functionIndex].symb_kind = definition;
functions [functionIndex].symb_def = newSymbDef; functions [functionIndex].symb_def = newSymbDef;
......
...@@ -126,7 +126,6 @@ SymbDef MakeNewSymbolDefinition (char * module, Ident name, int arity, SDefKind ...@@ -126,7 +126,6 @@ SymbDef MakeNewSymbolDefinition (char * module, Ident name, int arity, SDefKind
def->sdef_ident = name; def->sdef_ident = name;
def->sdef_arity = arity; def->sdef_arity = arity;
def->sdef_kind = kind; def->sdef_kind = kind;
def->sdef_line = 0;
def->sdef_mark=0; def->sdef_mark=0;
......
...@@ -10,22 +10,6 @@ ...@@ -10,22 +10,6 @@
#include "checker.h" #include "checker.h"
#include <ctype.h> #include <ctype.h>
char
*Earity = "used with wrong arity",
*Ecyclicsyn = "cyclic dependencies between synonym types",
*EwrongdefS = "differs from the symbol of the first rule alternative",
*Einfix_imp_def = "infix specification in the impl module conflicts with the def module",
*EImplandDef1 = "definition in the impl module conflicts with the def module",
*EImplandDef5 = "should have a type specification in the implementation rule",
*Enodeid2 = "multiply defined",
*Enodeid3 = "not defined";
static char
*Etuple = "tuples without type checking not allowed";
unsigned RuleCount,TypeSymbolCount;
SymbDef StackTop;
char *ConvertSymbolKindToString (SymbKind skind) char *ConvertSymbolKindToString (SymbKind skind)
{ {
switch (skind) switch (skind)
...@@ -256,11 +240,3 @@ void CheckSymbolWarningOrError (Bool error,struct symbol *symbol,char *msg) ...@@ -256,11 +240,3 @@ void CheckSymbolWarningOrError (Bool error,struct symbol *symbol,char *msg)
{ {
StaticMessage (error,"%S","%S %s",CurrentSymbol,symbol,msg); StaticMessage (error,"%S","%S %s",CurrentSymbol,symbol,msg);
} }
extern Ident TupleId;
void TupleError (void)
{
CheckError (TupleId->ident_name,Etuple);
}
...@@ -12,24 +12,6 @@ extern void CheckSymbolWarning (struct symbol *symbol,char *msg); ...@@ -12,24 +12,6 @@ extern void CheckSymbolWarning (struct symbol *symbol,char *msg);
extern void CheckWarningOrError (Bool error,char *msg1,char *msg2); extern void CheckWarningOrError (Bool error,char *msg1,char *msg2);
extern void CheckWarningOrError2 (Bool error,char *msg1,char *msg2,char *msg3); extern void CheckWarningOrError2 (Bool error,char *msg1,char *msg2,char *msg3);
extern void CheckSymbolWarningOrError (Bool error,struct symbol *symbol,char *msg); extern void CheckSymbolWarningOrError (Bool error,struct symbol *symbol,char *msg);
extern void TupleError (void);
extern char *Earity,*Enodeid3,*Ecyclicsyn,*Enodeid2,*EwrongdefS,*Einfix_imp_def,
*EImplandDef1,*EImplandDef5;
extern unsigned RuleCount,TypeSymbolCount;
extern SymbDef StackTop;
#define PushOnDepStack(sdef) \
sdef->sdef_parent=StackTop; \
StackTop=sdef
#define PopFromDepStack(sdef) \
sdef=StackTop; \
StackTop=sdef->sdef_parent; \
sdef->sdef_parent=NULL
#define IsOnDepStack(sdef) ((sdef)->sdef_parent!=NULL)
#define NameOfSymbol(symb) ((symb)->symb_def ->sdef_ident->ident_name) #define NameOfSymbol(symb) ((symb)->symb_def ->sdef_ident->ident_name)
......
...@@ -673,7 +673,7 @@ static void CodeRule (ImpRuleP rule) ...@@ -673,7 +673,7 @@ static void CodeRule (ImpRuleP rule)
GenFunctionDescriptorAndExportNodeAndDescriptor (rule_sdef); GenFunctionDescriptorAndExportNodeAndDescriptor (rule_sdef);
if (DoTimeProfiling) if (DoTimeProfiling)
GenPB_ident (rule_sdef->sdef_ident,rule_sdef->sdef_line); GenPB_ident (rule_sdef->sdef_ident,0 /*rule_sdef->sdef_line*/);
if (rule_sdef->sdef_exported && rule_sdef->sdef_calledwithrootnode && ExpectsResultNode (resultstate)) if (rule_sdef->sdef_exported && rule_sdef->sdef_calledwithrootnode && ExpectsResultNode (resultstate))
MakeSymbolLabel (&ea_lab,CurrentModule,ea_pref,rule_sdef,0); MakeSymbolLabel (&ea_lab,CurrentModule,ea_pref,rule_sdef,0);
......
...@@ -943,7 +943,6 @@ static void CodeNormalRootNode (Node root,NodeId rootid,int asp,int bsp,CodeGenN ...@@ -943,7 +943,6 @@ static void CodeNormalRootNode (Node root,NodeId rootid,int asp,int bsp,CodeGenN
Assume (case_ident_s.ident_name != NULL, "codegen3", "CodeNormalRootNode (fail_symb)"); Assume (case_ident_s.ident_name != NULL, "codegen3", "CodeNormalRootNode (fail_symb)");
case_def_s.sdef_ident = &case_ident_s; case_def_s.sdef_ident = &case_ident_s;
case_def_s.sdef_line = 0;
StaticMessage (FunctionMayFailIsError, "%D", "case may fail", &case_def_s); StaticMessage (FunctionMayFailIsError, "%D", "case may fail", &case_def_s);
......
...@@ -355,7 +355,7 @@ void PrintSymbol (Symbol symbol, File file) ...@@ -355,7 +355,7 @@ void PrintSymbol (Symbol symbol, File file)
break; break;
case definition: case definition:
symb_id = symbol -> symb_def -> sdef_ident; symb_id = symbol -> symb_def -> sdef_ident;
line_nr = symbol -> symb_def -> sdef_line; line_nr = 0;
break; break;
case int_denot: case int_denot:
FPutS (symbol->symb_int, file); FPutS (symbol->symb_int, file);
...@@ -499,7 +499,7 @@ void StaticMessage (Bool error, char *symbol_format, char *message_format, ...) ...@@ -499,7 +499,7 @@ void StaticMessage (Bool error, char *symbol_format, char *message_format, ...)
case 'D': case 'D':
{ {
SymbDef def = va_arg (ap, SymbDef); SymbDef def = va_arg (ap, SymbDef);
PrintSymbolOfIdent (def->sdef_ident, def->sdef_line, StdError); PrintSymbolOfIdent (def->sdef_ident, 0, StdError);
break; break;
} }
case 'S': case 'S':
......
...@@ -3883,7 +3883,7 @@ void GenNoMatchError (SymbDef sdef,int asp,int bsp,int string_already_generated) ...@@ -3883,7 +3883,7 @@ void GenNoMatchError (SymbDef sdef,int asp,int bsp,int string_already_generated)
if (!desc_needed && !string_already_generated){ if (!desc_needed && !string_already_generated){
put_directive_ (Dstring); put_directive_ (Dstring);
FPrintF (OutFile, "x_%u \"",sdef->sdef_number); FPrintF (OutFile, "x_%u \"",sdef->sdef_number);
PrintSymbolOfIdent (sdef->sdef_ident, sdef->sdef_line,OutFile); PrintSymbolOfIdent (sdef->sdef_ident,0,OutFile);
FPutS ("\"", OutFile); FPutS ("\"", OutFile);
} }
} }
...@@ -3907,7 +3907,7 @@ void GenCaseNoMatchError (SymbDefP case_def,int asp,int bsp) ...@@ -3907,7 +3907,7 @@ void GenCaseNoMatchError (SymbDefP case_def,int asp,int bsp)
put_directive_ (Dstring); put_directive_ (Dstring);
FPrintF (OutFile, "case_fail%u \"",CaseFailNumber); FPrintF (OutFile, "case_fail%u \"",CaseFailNumber);
PrintSymbolOfIdent (case_def->sdef_ident,case_def->sdef_line,OutFile); PrintSymbolOfIdent (case_def->sdef_ident,0,OutFile);
FPrintF (OutFile, "\""); FPrintF (OutFile, "\"");
CaseFailNumber++; CaseFailNumber++;
......
...@@ -517,7 +517,6 @@ STRUCT (rule_alt,RuleAlt){ ...@@ -517,7 +517,6 @@ STRUCT (rule_alt,RuleAlt){
RuleAlts alt_next; RuleAlts alt_next;
unsigned alt_line; unsigned alt_line;
unsigned alt_kind:3; /* RhsKind */ unsigned alt_kind:3; /* RhsKind */
Bool alt_may_fail:1;
}; };
#define alt_rhs_root alt_rhs.rhs_root #define alt_rhs_root alt_rhs.rhs_root
...@@ -565,7 +564,6 @@ STRUCT (imp_rule,ImpRule){ ...@@ -565,7 +564,6 @@ STRUCT (imp_rule,ImpRule){
#endif #endif
unsigned rule_line; unsigned rule_line;
unsigned rule_mark; unsigned rule_mark;
unsigned rule_ref_count;
}; };
#define RULE_CAF_MASK 2 #define RULE_CAF_MASK 2
...@@ -620,11 +618,9 @@ STRUCT (symbol_def,SymbDef){ ...@@ -620,11 +618,9 @@ STRUCT (symbol_def,SymbDef){
struct symbol_def * sdef_next_scc; struct symbol_def * sdef_next_scc;
union { union {
struct symbol_def * sdef_u2_parent;
struct symbol_def * sdef_u2_next_version; /* for IMPRULES */ struct symbol_def * sdef_u2_next_version; /* for IMPRULES */
} sdef_u2; } sdef_u2;
unsigned sdef_line;
int sdef_mark; int sdef_mark;
unsigned sdef_kind:SDefKindSize; unsigned sdef_kind:SDefKindSize;
...@@ -660,9 +656,6 @@ STRUCT (symbol_def,SymbDef){ ...@@ -660,9 +656,6 @@ STRUCT (symbol_def,SymbDef){
/* some macros to reuse bit fields */ /* some macros to reuse bit fields */
#define sdef_group_number sdef_ancestor #define sdef_group_number sdef_ancestor
#define sdef_has_instance_info sdef_used_as_instance
#define sdef_parent sdef_u2.sdef_u2_parent
#define sdef_next_version sdef_u2.sdef_u2_next_version #define sdef_next_version sdef_u2.sdef_u2_next_version
...@@ -698,7 +691,6 @@ typedef struct { ...@@ -698,7 +691,6 @@ typedef struct {
Types im_types; Types im_types;
ImpRules im_rules; ImpRules im_rules;
struct symbol_def * im_start; struct symbol_def * im_start;
Bool im_main;
DefMod im_def_module; DefMod im_def_module;
#if IMPORT_OBJ_AND_LIB #if IMPORT_OBJ_AND_LIB
struct string_list * im_imported_objs; struct string_list * im_imported_objs;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment