diff options
Diffstat (limited to 'gcc/m2/gm2-compiler')
-rw-r--r-- | gcc/m2/gm2-compiler/M2GenGCC.mod | 5 | ||||
-rw-r--r-- | gcc/m2/gm2-compiler/M2Range.mod | 2 | ||||
-rw-r--r-- | gcc/m2/gm2-compiler/M2Students.def | 2 | ||||
-rw-r--r-- | gcc/m2/gm2-compiler/M2Students.mod | 16 | ||||
-rw-r--r-- | gcc/m2/gm2-compiler/P1SymBuild.mod | 45 | ||||
-rw-r--r-- | gcc/m2/gm2-compiler/P2SymBuild.mod | 28 | ||||
-rw-r--r-- | gcc/m2/gm2-compiler/P3SymBuild.mod | 2 | ||||
-rw-r--r-- | gcc/m2/gm2-compiler/PCSymBuild.mod | 6 | ||||
-rw-r--r-- | gcc/m2/gm2-compiler/SymbolTable.def | 6 | ||||
-rw-r--r-- | gcc/m2/gm2-compiler/SymbolTable.mod | 87 |
10 files changed, 86 insertions, 113 deletions
diff --git a/gcc/m2/gm2-compiler/M2GenGCC.mod b/gcc/m2/gm2-compiler/M2GenGCC.mod index 4a9ced3..2507c53 100644 --- a/gcc/m2/gm2-compiler/M2GenGCC.mod +++ b/gcc/m2/gm2-compiler/M2GenGCC.mod @@ -2903,9 +2903,6 @@ END CheckStop ; *) PROCEDURE FoldBecomes (p: WalkAction; bb: BasicBlock; quad: CARDINAL) ; -VAR - op : QuadOperator ; - des, op2, expr: CARDINAL ; BEGIN IF DeclaredOperandsBecomes (p, quad) THEN @@ -8154,8 +8151,6 @@ VAR rightpos, typepos, indrxpos : CARDINAL ; - length, - newstr : tree ; location : location_t ; BEGIN GetQuadOtok (quad, indrxpos, op, left, type, right, diff --git a/gcc/m2/gm2-compiler/M2Range.mod b/gcc/m2/gm2-compiler/M2Range.mod index dcac2ba..f1516d3 100644 --- a/gcc/m2/gm2-compiler/M2Range.mod +++ b/gcc/m2/gm2-compiler/M2Range.mod @@ -1869,14 +1869,12 @@ END FoldTypeAssign ; PROCEDURE FoldTypeIndrX (q: CARDINAL; tokenNo: CARDINAL; des, expr: CARDINAL; r: CARDINAL) ; VAR - desType, exprType: CARDINAL ; BEGIN (* Need to skip over a variable or temporary in des and expr so long as expr is not a procedure. In the case of des = *expr, both expr and des will be variables due to the property of indirection. *) - desType := GetType (des) ; IF IsProcedure (expr) THEN (* Must not GetType for a procedure as it gives the return type. *) diff --git a/gcc/m2/gm2-compiler/M2Students.def b/gcc/m2/gm2-compiler/M2Students.def index 7d67a0a..a3ecdcd 100644 --- a/gcc/m2/gm2-compiler/M2Students.def +++ b/gcc/m2/gm2-compiler/M2Students.def @@ -39,7 +39,7 @@ EXPORT QUALIFIED StudentVariableCheck, CheckVariableAgainstKeyword ; as a keyword except for its case. *) -PROCEDURE CheckVariableAgainstKeyword (name: Name) ; +PROCEDURE CheckVariableAgainstKeyword (tok: CARDINAL; name: Name) ; (* diff --git a/gcc/m2/gm2-compiler/M2Students.mod b/gcc/m2/gm2-compiler/M2Students.mod index e539eb0..3df160a 100644 --- a/gcc/m2/gm2-compiler/M2Students.mod +++ b/gcc/m2/gm2-compiler/M2Students.mod @@ -25,7 +25,7 @@ IMPLEMENTATION MODULE M2Students ; FROM SymbolTable IMPORT FinalSymbol, IsVar, IsProcedure, IsModule, GetMainModule, IsType, NulSym, IsRecord, GetSymName, GetNth, GetNthProcedure, GetDeclaredMod, NoOfParam ; FROM NameKey IMPORT GetKey, WriteKey, MakeKey, IsSameExcludingCase, NulName, makekey, KeyToCharStar ; -FROM M2MetaError IMPORT MetaErrorString0, MetaError2 ; +FROM M2MetaError IMPORT MetaErrorStringT0, MetaError2 ; FROM Lists IMPORT List, InitList, IsItemInList, IncludeItemIntoList ; FROM M2Reserved IMPORT IsReserved, toktype ; FROM DynamicStrings IMPORT String, InitString, KillString, ToUpper, InitStringCharStar, string, Mark, ToUpper, Dup ; @@ -78,11 +78,11 @@ END IsNotADuplicateName ; as a keyword except for its case. *) -PROCEDURE CheckVariableAgainstKeyword (name: Name) ; +PROCEDURE CheckVariableAgainstKeyword (tok: CARDINAL; name: Name) ; BEGIN IF StyleChecking THEN - PerformVariableKeywordCheck (name) + PerformVariableKeywordCheck (tok, name) END END CheckVariableAgainstKeyword ; @@ -91,7 +91,7 @@ END CheckVariableAgainstKeyword ; PerformVariableKeywordCheck - performs the check and constructs the metaerror notes if appropriate. *) -PROCEDURE PerformVariableKeywordCheck (name: Name) ; +PROCEDURE PerformVariableKeywordCheck (tok: CARDINAL; name: Name) ; VAR upper : Name ; token : toktype ; @@ -105,9 +105,11 @@ BEGIN THEN IF IsNotADuplicateName (name) THEN - MetaErrorString0 (Sprintf2 (Mark (InitString ('either the identifier has the same name as a keyword or alternatively a keyword has the wrong case ({%%K%s} and {!%%O:{%%K%s}})')), - upperS, orig)) ; - MetaErrorString0 (Sprintf1 (Mark (InitString ('the symbol name {!%%O:{%%K%s}} is legal as an identifier, however as such it might cause confusion and is considered bad programming practice')), orig)) + MetaErrorStringT0 (tok, + Sprintf2 (Mark (InitString ('either the identifier has the same name as a keyword or alternatively a keyword has the wrong case ({%%K%s} and {!%%O:{%%K%s}})')), + upperS, orig)) ; + MetaErrorStringT0 (tok, + Sprintf1 (Mark (InitString ('the symbol name {!%%O:{%%K%s}} is legal as an identifier, however as such it might cause confusion and is considered bad programming practice')), orig)) END END ; upperS := KillString (upperS) ; diff --git a/gcc/m2/gm2-compiler/P1SymBuild.mod b/gcc/m2/gm2-compiler/P1SymBuild.mod index 02d4ac7..08a0fc3 100644 --- a/gcc/m2/gm2-compiler/P1SymBuild.mod +++ b/gcc/m2/gm2-compiler/P1SymBuild.mod @@ -79,7 +79,6 @@ FROM SymbolTable IMPORT NulSym, MakeSubscript, PutSubscript, PutArray, GetType, IsArray, IsProcType, MakeProcType, - PutProcTypeVarParam, PutProcTypeParam, PutProcedureBuiltin, PutProcedureInline, GetSymName, ResolveImports, PutDeclared, @@ -109,42 +108,6 @@ VAR (* - CheckFileName - checks to see that the module name matches the file name. -*) - -(* -PROCEDURE CheckFileName (tok: CARDINAL; name: Name; ModuleType: ARRAY OF CHAR) ; -VAR - ext, - basename: INTEGER ; - s, - FileName: String ; -BEGIN - FileName := GetFileName() ; - basename := RIndex(FileName, '/', 0) ; - IF basename=-1 - THEN - basename := 0 - END ; - ext := RIndex(FileName, '.', 0) ; - IF ext=-1 - THEN - ext := 0 - END ; - FileName := Slice(FileName, basename, ext) ; - IF EqualCharStar(FileName, KeyToCharStar(name)) - THEN - FileName := KillString(FileName) - ELSE - s := ConCat (InitString (ModuleType), - Mark (InitString (" module name {%1Ea} is inconsistant with the filename {%F{%2a}}"))) ; - MetaErrorString2 (s, MakeError (tok, name), MakeErrorS (tok, FileName)) - END -END CheckFileName ; -*) - - -(* StartBuildDefinitionModule - Creates a definition module and starts a new scope. @@ -227,7 +190,7 @@ BEGIN END ; IF NameStart#NameEnd THEN - MetaError1 ('inconsistant definition module name {%1Wa}', MakeError (start, NameStart)) + MetaError1 ('inconsistent definition module name {%1Wa}', MakeError (start, NameStart)) END ; LeaveBlock END P1EndBuildDefinitionModule ; @@ -301,7 +264,7 @@ BEGIN IF NameStart#NameEnd THEN MetaErrorT1 (end, - 'inconsistant implementation module name {%1Wa}', MakeError (start, NameStart)) + 'inconsistent implementation module name {%1Wa}', MakeError (start, NameStart)) END ; LeaveBlock END P1EndBuildImplementationModule ; @@ -381,7 +344,7 @@ BEGIN IF NameStart#NameEnd THEN MetaErrorT1 (end, - 'inconsistant program module name {%1Wa}', MakeError (start, NameStart)) + 'inconsistent program module name {%1Wa}', MakeError (start, NameStart)) END ; LeaveBlock END P1EndBuildProgramModule ; @@ -446,7 +409,7 @@ BEGIN IF NameStart#NameEnd THEN MetaErrorT1 (end, - 'inconsistant inner module name {%1Wa}', MakeError (start, NameStart)) + 'inconsistent inner module name {%1Wa}', MakeError (start, NameStart)) END ; LeaveBlock END EndBuildInnerModule ; diff --git a/gcc/m2/gm2-compiler/P2SymBuild.mod b/gcc/m2/gm2-compiler/P2SymBuild.mod index 5c82ec8..54e624f 100644 --- a/gcc/m2/gm2-compiler/P2SymBuild.mod +++ b/gcc/m2/gm2-compiler/P2SymBuild.mod @@ -356,7 +356,7 @@ BEGIN END ; IF NameStart#NameEnd THEN - WriteFormat2('inconsistant definition module name, module began as (%a) and ended with (%a)', NameStart, NameEnd) + WriteFormat2('inconsistent definition module name, module began as (%a) and ended with (%a)', NameStart, NameEnd) END ; M2Error.LeaveErrorScope END P2EndBuildDefModule ; @@ -425,7 +425,7 @@ BEGIN PopT (NameEnd) ; IF NameStart#NameEnd THEN - WriteFormat1('inconsistant implementation module name %a', NameStart) + WriteFormat1('inconsistent implementation module name %a', NameStart) END ; M2Error.LeaveErrorScope END P2EndBuildImplementationModule ; @@ -499,7 +499,7 @@ BEGIN END ; IF NameStart#NameEnd THEN - WriteFormat2('inconsistant program module name %a does not match %a', NameStart, NameEnd) + WriteFormat2('inconsistent program module name %a does not match %a', NameStart, NameEnd) END ; M2Error.LeaveErrorScope END P2EndBuildProgramModule ; @@ -564,7 +564,7 @@ BEGIN PopT(NameEnd) ; IF NameStart#NameEnd THEN - WriteFormat2('inconsistant inner module name %a does not match %a', + WriteFormat2('inconsistent inner module name %a does not match %a', NameStart, NameEnd) END ; M2Error.LeaveErrorScope @@ -1179,8 +1179,8 @@ BEGIN PopT (n) ; i := 1 ; WHILE i <= n DO - CheckVariableAgainstKeyword (OperandT (n+1-i)) ; tok := OperandTok (n+1-i) ; + CheckVariableAgainstKeyword (tok, OperandT (n+1-i)) ; Var := MakeVar (tok, OperandT (n+1-i)) ; AtAddress := OperandA (n+1-i) ; IF AtAddress # NulSym @@ -1835,13 +1835,13 @@ BEGIN (* WarnStringAt (InitString ('parampos?'), OperandTok (pi)) ; *) IF Unbounded AND (NOT IsUnboundedParam (ProcSym, prevkind, ParamTotal+i)) THEN - ParameterError ('declaration of procedure {%%1a} in the %s differs from the %s, {%%2N} parameter is inconsistant, %s', + ParameterError ('declaration of procedure {%%1a} in the %s differs from the %s, {%%2N} parameter is inconsistent, %s', 'the parameter {%3EHa} was not declared as an ARRAY OF type', 'the parameter {%3EVa} was declared as an ARRAY OF type', ParamTotal+i, ProcSym, curkind, prevkind) ELSIF (NOT Unbounded) AND IsUnboundedParam (ProcSym, prevkind, ParamTotal+i) THEN - ParameterError ('declaration of procedure {%%1a} in the %s differs from the %s, {%%2N} parameter is inconsistant, %s', + ParameterError ('declaration of procedure {%%1a} in the %s differs from the %s, {%%2N} parameter is inconsistent, %s', 'the parameter {%3EHa} was declared as an ARRAY OF type', 'the parameter {%3EVa} was not declared as an ARRAY OF type', ParamTotal+i, ProcSym, curkind, prevkind) @@ -1850,7 +1850,7 @@ BEGIN THEN IF GetDimension (GetNthParam (ProcSym, prevkind, ParamTotal+1)) # ndim THEN - ParameterError ('declaration of procedure {%%1a} in the %s differs from the %s, {%%2N} parameter is inconsistant, %s', + ParameterError ('declaration of procedure {%%1a} in the %s differs from the %s, {%%2N} parameter is inconsistent, %s', 'the dynamic array parameter {%3EHa} was declared with a different of dimensions', 'the dynamic array parameter {%3EVa} was declared with a different of dimensions', ParamTotal+i, ProcSym, curkind, prevkind) @@ -1859,14 +1859,14 @@ BEGIN IF isVarParam AND (NOT IsVarParam (ProcSym, prevkind, ParamTotal+i)) THEN (* Expecting non VAR parameter. *) - ParameterError ('declaration of procedure {%%1a} in the %s differs from the %s, {%%2N} parameter is inconsistant, %s', + ParameterError ('declaration of procedure {%%1a} in the %s differs from the %s, {%%2N} parameter is inconsistent, %s', '{%3EHa} was not declared as a {%kVAR} parameter', '{%3EVa} was declared as a {%kVAR} parameter', ParamTotal+i, ProcSym, curkind, prevkind) ELSIF (NOT isVarParam) AND IsVarParam (ProcSym, prevkind, ParamTotal+i) THEN (* Expecting VAR pamarater. *) - ParameterError ('declaration of procedure {%%1a} in the %s differs from the %s, {%%2N} parameter is inconsistant, %s', + ParameterError ('declaration of procedure {%%1a} in the %s differs from the %s, {%%2N} parameter is inconsistent, %s', '{%3EHa} was declared as a {%kVAR} parameter', '{%3EVa} was not declared as a {%kVAR} parameter', ParamTotal+i, ProcSym, curkind, prevkind) @@ -1877,7 +1877,7 @@ BEGIN IF GetSymName (ParamI) # OperandT (pi) THEN (* Different parameter names. *) - ParameterError ('procedure {%%1a} in the %s differs from the %s, {%%2N} parameter name is inconsistant, %s', + ParameterError ('procedure {%%1a} in the %s differs from the %s, {%%2N} parameter name is inconsistent, %s', 'named as {%3EVa}', 'named as {%3EVa}', ParamTotal+i, ProcSym, curkind, prevkind) @@ -1897,7 +1897,7 @@ BEGIN (NOT IsUnknown(SkipType(ParamIType))) THEN (* Different parameter types. *) - ParameterError ('declaration in the %s differs from the %s, {%%2N} parameter is inconsistant, %s', + ParameterError ('declaration in the %s differs from the %s, {%%2N} parameter is inconsistent, %s', 'the parameter {%3EHa} was declared with a different type', 'the parameter {%3EVa} was declared with a different type', ParamTotal+i, ProcSym, curkind, prevkind) @@ -3072,10 +3072,10 @@ BEGIN IF Var=VarTok THEN (* VAR parameter *) - PutProcTypeVarParam(ProcTypeSym, TypeSym, IsUnbounded(TypeSym)) + PutProcTypeVarParam (tok, ProcTypeSym, TypeSym, IsUnbounded (TypeSym)) ELSE (* Non VAR parameter *) - PutProcTypeParam(ProcTypeSym, TypeSym, IsUnbounded(TypeSym)) + PutProcTypeParam (tok, ProcTypeSym, TypeSym, IsUnbounded (TypeSym)) END ; PushT(ProcTypeSym) ; Annotate("%1s(%1d)||proc type") diff --git a/gcc/m2/gm2-compiler/P3SymBuild.mod b/gcc/m2/gm2-compiler/P3SymBuild.mod index c4877f7..096057e 100644 --- a/gcc/m2/gm2-compiler/P3SymBuild.mod +++ b/gcc/m2/gm2-compiler/P3SymBuild.mod @@ -126,7 +126,7 @@ BEGIN PopT(NameStart) ; IF NameStart#NameEnd THEN - WriteFormat2('inconsistant definition module was named (%a) and concluded as (%a)', + WriteFormat2('inconsistent definition module was named (%a) and concluded as (%a)', NameStart, NameEnd) END ; M2Error.LeaveErrorScope diff --git a/gcc/m2/gm2-compiler/PCSymBuild.mod b/gcc/m2/gm2-compiler/PCSymBuild.mod index 3bffe86..4db2730 100644 --- a/gcc/m2/gm2-compiler/PCSymBuild.mod +++ b/gcc/m2/gm2-compiler/PCSymBuild.mod @@ -269,7 +269,7 @@ BEGIN PopT(NameStart) ; IF NameStart#NameEnd THEN - WriteFormat2('inconsistant definition module was named (%a) and concluded as (%a)', + WriteFormat2('inconsistent definition module was named (%a) and concluded as (%a)', NameStart, NameEnd) END ; M2Error.LeaveErrorScope @@ -1168,9 +1168,9 @@ BEGIN par := GetParam (p, i) ; IF IsParameterVar (par) THEN - PutProcTypeVarParam (t, GetType (par), IsParameterUnbounded (par)) + PutProcTypeVarParam (tok, t, GetType (par), IsParameterUnbounded (par)) ELSE - PutProcTypeParam (t, GetType (par), IsParameterUnbounded (par)) + PutProcTypeParam (tok, t, GetType (par), IsParameterUnbounded (par)) END ; INC(i) END ; diff --git a/gcc/m2/gm2-compiler/SymbolTable.def b/gcc/m2/gm2-compiler/SymbolTable.def index 2a9865a..5b93f29 100644 --- a/gcc/m2/gm2-compiler/SymbolTable.def +++ b/gcc/m2/gm2-compiler/SymbolTable.def @@ -2650,7 +2650,8 @@ PROCEDURE MakeProcType (tok: CARDINAL; ProcTypeName: Name) : CARDINAL ; ParamType into ProcType Sym. *) -PROCEDURE PutProcTypeParam (Sym: CARDINAL; +PROCEDURE PutProcTypeParam (tok: CARDINAL; + Sym: CARDINAL; ParamType: CARDINAL; isUnbounded: BOOLEAN) ; @@ -2659,7 +2660,8 @@ PROCEDURE PutProcTypeParam (Sym: CARDINAL; ParamType into ProcType Sym. *) -PROCEDURE PutProcTypeVarParam (Sym: CARDINAL; +PROCEDURE PutProcTypeVarParam (tok: CARDINAL; + Sym: CARDINAL; ParamType: CARDINAL; isUnbounded: BOOLEAN) ; diff --git a/gcc/m2/gm2-compiler/SymbolTable.mod b/gcc/m2/gm2-compiler/SymbolTable.mod index ff661dc..00946e5 100644 --- a/gcc/m2/gm2-compiler/SymbolTable.mod +++ b/gcc/m2/gm2-compiler/SymbolTable.mod @@ -463,9 +463,11 @@ TYPE (* of param. *) Type : CARDINAL ; (* Index to the type of param. *) IsUnbounded : BOOLEAN ; (* Is it an ARRAY OF Type? *) + Scope : CARDINAL ; (* Procedure declaration. *) ShadowVar : CARDINAL ; (* The local variable used to *) (* shadow this parameter. *) - At : Where ; (* Where was sym declared/used *) + FullTok, (* name: type virtual token. *) + At : CARDINAL ; (* Where was sym declared. *) END ; SymVarParam = RECORD @@ -476,9 +478,11 @@ TYPE HeapVar : CARDINAL ;(* The pointer value on heap. *) (* Only used by static *) (* analysis. *) + Scope : CARDINAL ;(* Procedure declaration. *) ShadowVar : CARDINAL ;(* The local variable used to *) (* shadow this parameter. *) - At : Where ; (* Where was sym declared/used *) + FullTok, (* name: type virtual token. *) + At : CARDINAL ;(* Where was sym declared. *) END ; ConstStringVariant = (m2str, cstr, m2nulstr, cnulstr) ; @@ -4456,9 +4460,19 @@ BEGIN pSym := GetPsym (sym) ; IF IsParameterVar (sym) THEN - RETURN GetVarDeclTok (pSym^.VarParam.ShadowVar) + IF pSym^.VarParam.ShadowVar = NulSym + THEN + RETURN pSym^.VarParam.At + ELSE + RETURN GetVarDeclTok (pSym^.VarParam.ShadowVar) + END ELSE - RETURN GetVarDeclTok (pSym^.Param.ShadowVar) + IF pSym^.Param.ShadowVar = NulSym + THEN + RETURN pSym^.Param.At + ELSE + RETURN GetVarDeclTok (pSym^.Param.ShadowVar) + END END ELSIF IsVar (sym) THEN @@ -4549,9 +4563,9 @@ BEGIN THEN IF IsParameterVar (sym) THEN - RETURN GetVarDeclFullTok (pSym^.VarParam.ShadowVar) + RETURN pSym^.VarParam.FullTok ELSE - RETURN GetVarDeclFullTok (pSym^.Param.ShadowVar) + RETURN pSym^.Param.FullTok END ELSIF IsVar (sym) THEN @@ -10651,8 +10665,10 @@ BEGIN name := ParamName ; Type := ParamType ; IsUnbounded := isUnbounded ; + Scope := Sym ; ShadowVar := NulSym ; - InitWhereDeclaredTok(tok, At) + FullTok := MakeVirtual2Tok (tok, typetok) ; + At := tok END END ; AddParameter (Sym, kind, ParSym) ; @@ -10671,7 +10687,7 @@ BEGIN pSym^.Param.ShadowVar := VariableSym END END ; - AddProcedureProcTypeParam (Sym, ParamType, isUnbounded, FALSE) + AddProcedureProcTypeParam (tok, Sym, ParamType, isUnbounded, FALSE) END ; RETURN( TRUE ) END PutParam ; @@ -10708,9 +10724,11 @@ BEGIN name := ParamName ; Type := ParamType ; IsUnbounded := isUnbounded ; + Scope := Sym ; ShadowVar := NulSym ; HeapVar := NulSym ; (* Will contain a pointer value. *) - InitWhereDeclaredTok(tok, At) + FullTok := MakeVirtual2Tok (tok, typetok) ; + At := tok END END ; AddParameter (Sym, kind, ParSym) ; @@ -10729,7 +10747,7 @@ BEGIN pSym^.VarParam.ShadowVar := VariableSym END END ; - AddProcedureProcTypeParam (Sym, ParamType, isUnbounded, TRUE) + AddProcedureProcTypeParam (tok, Sym, ParamType, isUnbounded, TRUE) END ; RETURN( TRUE ) END PutVarParam ; @@ -10816,7 +10834,8 @@ END AddParameter ; associated with procedure Sym. *) -PROCEDURE AddProcedureProcTypeParam (Sym, ParamType: CARDINAL; +PROCEDURE AddProcedureProcTypeParam (tok: CARDINAL; + Sym, ParamType: CARDINAL; isUnbounded, isVarParam: BOOLEAN) ; VAR pSym: PtrToSymbol ; @@ -10829,10 +10848,12 @@ BEGIN THEN IF isVarParam THEN - PutProcTypeVarParam (Procedure.ProcedureType, + PutProcTypeVarParam (tok, + Procedure.ProcedureType, ParamType, isUnbounded) ELSE - PutProcTypeParam (Procedure.ProcedureType, + PutProcTypeParam (tok, + Procedure.ProcedureType, ParamType, isUnbounded) END END @@ -13027,18 +13048,8 @@ BEGIN ConstLitSym : RETURN( ConstLit.Scope ) | ConstStringSym : RETURN( ConstString.Scope ) | ConstVarSym : RETURN( ConstVar.Scope ) | - ParamSym : IF Param.ShadowVar = NulSym - THEN - RETURN NulSym - ELSE - RETURN( GetScope (Param.ShadowVar) ) - END | - VarParamSym : IF VarParam.ShadowVar = NulSym - THEN - RETURN NulSym - ELSE - RETURN( GetScope (VarParam.ShadowVar) ) - END | + ParamSym : RETURN( Param.Scope ) | + VarParamSym : RETURN( VarParam.Scope ) | UndefinedSym : RETURN( NulSym ) | PartialUnboundedSym: InternalError ('should not be requesting the scope of a PartialUnbounded symbol') @@ -13186,7 +13197,8 @@ END MakeProcType ; ParamType into ProcType Sym. *) -PROCEDURE PutProcTypeParam (Sym: CARDINAL; +PROCEDURE PutProcTypeParam (tok: CARDINAL; + Sym: CARDINAL; ParamType: CARDINAL; isUnbounded: BOOLEAN) ; VAR pSym : PtrToSymbol ; @@ -13201,7 +13213,8 @@ BEGIN Type := ParamType ; IsUnbounded := isUnbounded ; ShadowVar := NulSym ; - InitWhereDeclared(At) + FullTok := tok ; + At := tok END END ; AddParameter (Sym, ProperProcedure, ParSym) @@ -13213,7 +13226,8 @@ END PutProcTypeParam ; ParamType into ProcType Sym. *) -PROCEDURE PutProcTypeVarParam (Sym: CARDINAL; +PROCEDURE PutProcTypeVarParam (tok: CARDINAL; + Sym: CARDINAL; ParamType: CARDINAL; isUnbounded: BOOLEAN) ; VAR pSym : PtrToSymbol ; @@ -13228,7 +13242,8 @@ BEGIN Type := ParamType ; IsUnbounded := isUnbounded ; ShadowVar := NulSym ; - InitWhereDeclared(At) + FullTok := tok ; + At := tok END END ; AddParameter (Sym, ProperProcedure, ParSym) @@ -13918,8 +13933,8 @@ BEGIN UnboundedSym : RETURN( Unbounded.At.DefDeclared ) | ProcedureSym : RETURN( Procedure.At.DefDeclared ) | ProcTypeSym : RETURN( ProcType.At.DefDeclared ) | - ParamSym : RETURN( Param.At.DefDeclared ) | - VarParamSym : RETURN( VarParam.At.DefDeclared ) | + ParamSym : RETURN( Param.At ) | + VarParamSym : RETURN( VarParam.At ) | ConstStringSym : RETURN( ConstString.At.DefDeclared ) | ConstLitSym : RETURN( ConstLit.At.DefDeclared ) | ConstVarSym : RETURN( ConstVar.At.DefDeclared ) | @@ -13968,8 +13983,8 @@ BEGIN UnboundedSym : RETURN( Unbounded.At.ModDeclared ) | ProcedureSym : RETURN( Procedure.At.ModDeclared ) | ProcTypeSym : RETURN( ProcType.At.ModDeclared ) | - ParamSym : RETURN( Param.At.ModDeclared ) | - VarParamSym : RETURN( VarParam.At.ModDeclared ) | + ParamSym : RETURN( Param.At ) | + VarParamSym : RETURN( VarParam.At ) | ConstStringSym : RETURN( ConstString.At.ModDeclared ) | ConstLitSym : RETURN( ConstLit.At.ModDeclared ) | ConstVarSym : RETURN( ConstVar.At.ModDeclared ) | @@ -14019,8 +14034,6 @@ BEGIN UnboundedSym : Unbounded.At.DefDeclared := tok | ProcedureSym : Procedure.At.DefDeclared := tok | ProcTypeSym : ProcType.At.DefDeclared := tok | - ParamSym : Param.At.DefDeclared := tok | - VarParamSym : VarParam.At.DefDeclared := tok | ConstStringSym : ConstString.At.DefDeclared := tok | ConstLitSym : ConstLit.At.DefDeclared := tok | ConstVarSym : ConstVar.At.DefDeclared := tok | @@ -14067,8 +14080,6 @@ BEGIN UnboundedSym : Unbounded.At.ModDeclared := tok | ProcedureSym : Procedure.At.ModDeclared := tok | ProcTypeSym : ProcType.At.ModDeclared := tok | - ParamSym : Param.At.ModDeclared := tok | - VarParamSym : VarParam.At.ModDeclared := tok | ConstStringSym : ConstString.At.ModDeclared := tok | ConstLitSym : ConstLit.At.ModDeclared := tok | ConstVarSym : ConstVar.At.ModDeclared := tok | @@ -14323,8 +14334,10 @@ BEGIN UnboundedSym : RETURN( Unbounded.At.FirstUsed ) | ProcedureSym : RETURN( Procedure.At.FirstUsed ) | ProcTypeSym : RETURN( ProcType.At.FirstUsed ) | + (* ParamSym : RETURN( Param.At.FirstUsed ) | VarParamSym : RETURN( VarParam.At.FirstUsed ) | + *) ConstStringSym : RETURN( ConstString.At.FirstUsed ) | ConstLitSym : RETURN( ConstLit.At.FirstUsed ) | ConstVarSym : RETURN( ConstVar.At.FirstUsed ) | |