Browse Source

Removed unused local variables

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@7870 8c9fc860-2736-0410-a75d-ab315db34111
negelef 7 years ago
parent
commit
0f96d43f45

+ 1 - 1
source/AMD64.FoxArrayBaseOptimized.Mod

@@ -4768,7 +4768,7 @@ VAR
 				 M, N, K, L2BlockM, L2BlockN, L2BlockK: SIZE;
 				 M, N, K, L2BlockM, L2BlockN, L2BlockK: SIZE;
 										  IncA, StrideA, IncB, StrideB, IncC, StrideC: SIZE;
 										  IncA, StrideA, IncB, StrideB, IncC, StrideC: SIZE;
 										  add: BOOLEAN );
 										  add: BOOLEAN );
-	VAR lenA, lenB, len: SIZE; adrA, adrB, adrC: ADDRESS;  m: SIZE;
+	VAR lenA, lenB: SIZE; adrA, adrB, adrC: ADDRESS;  m: SIZE;
 		M1, M2, i: SIZE;  val: REAL;  inc: SIZE;
 		M1, M2, i: SIZE;  val: REAL;  inc: SIZE;
 		obj: POINTER TO ARRAY OF MultiplyObjectR;
 		obj: POINTER TO ARRAY OF MultiplyObjectR;
 		t: HUGEINT;  cache: Cache;
 		t: HUGEINT;  cache: Cache;

+ 2 - 6
source/FoxGlobal.Mod

@@ -1220,7 +1220,7 @@ TYPE
 	END ModuleFileName;
 	END ModuleFileName;
 	
 	
 	PROCEDURE ModuleSectionIdentifier*(name, context: SyntaxTree.Identifier): SyntaxTree.Identifier;
 	PROCEDURE ModuleSectionIdentifier*(name, context: SyntaxTree.Identifier): SyntaxTree.Identifier;
-	VAR s,n: SyntaxTree.IdentifierString; 
+	VAR n: SyntaxTree.IdentifierString; 
 	BEGIN
 	BEGIN
 		IF context # SyntaxTree.invalidIdentifier THEN
 		IF context # SyntaxTree.invalidIdentifier THEN
 			GetModuleSectionName(name, context, n);
 			GetModuleSectionName(name, context, n);
@@ -1255,13 +1255,11 @@ TYPE
 	END ContextFromName;
 	END ContextFromName;
 
 
 	PROCEDURE GetModuleName*(module: SyntaxTree.Module; VAR name: ARRAY OF CHAR);
 	PROCEDURE GetModuleName*(module: SyntaxTree.Module; VAR name: ARRAY OF CHAR);
-	VAR n: SyntaxTree.IdentifierString;
 	BEGIN
 	BEGIN
 		GetModuleSectionName(module.name, module.context, name);
 		GetModuleSectionName(module.name, module.context, name);
 	END GetModuleName;
 	END GetModuleName;
 
 
 	PROCEDURE GetModuleSegmentedName*(module: SyntaxTree.Module; VAR name: Basic.SegmentedName);
 	PROCEDURE GetModuleSegmentedName*(module: SyntaxTree.Module; VAR name: Basic.SegmentedName);
-	VAR moduleName: SyntaxTree.IdentifierString;
 	BEGIN
 	BEGIN
 		name[0] := ModuleSectionIdentifier(module.name, module.context);
 		name[0] := ModuleSectionIdentifier(module.name, module.context);
 		name[1] := -1;
 		name[1] := -1;
@@ -1290,7 +1288,6 @@ TYPE
 		END GetSymbolScope;
 		END GetSymbolScope;
 
 
 		PROCEDURE FindSymbol(name: SyntaxTree.Identifier): SyntaxTree.Symbol;
 		PROCEDURE FindSymbol(name: SyntaxTree.Identifier): SyntaxTree.Symbol;
-		VAR symbols: SyntaxTree.Symbol;
 		BEGIN
 		BEGIN
 			IF scope = scope.ownerModule.moduleScope THEN
 			IF scope = scope.ownerModule.moduleScope THEN
 				symbol := scope.ownerModule.moduleScope.ImportByModuleName(name, scope.ownerModule.context);
 				symbol := scope.ownerModule.moduleScope.ImportByModuleName(name, scope.ownerModule.context);
@@ -1366,7 +1363,7 @@ TYPE
 	END GetSymbolName;
 	END GetSymbolName;
 
 
 	PROCEDURE GetSymbolSegmentedNameInScope*(symbol: SyntaxTree.Symbol; inScope: SyntaxTree.Scope; VAR pooledName: Basic.SegmentedName);
 	PROCEDURE GetSymbolSegmentedNameInScope*(symbol: SyntaxTree.Symbol; inScope: SyntaxTree.Scope; VAR pooledName: Basic.SegmentedName);
-	VAR n: SyntaxTree.String; td: SyntaxTree.TypeDeclaration; i: LONGINT;
+	VAR td: SyntaxTree.TypeDeclaration; i: LONGINT;
 		PROCEDURE Scope(scope: SyntaxTree.Scope);
 		PROCEDURE Scope(scope: SyntaxTree.Scope);
 		BEGIN
 		BEGIN
 			IF scope = NIL THEN (* do nothing, locally declared temporary symbol *)
 			IF scope = NIL THEN (* do nothing, locally declared temporary symbol *)
@@ -1465,7 +1462,6 @@ TYPE
 	END MinFloat;
 	END MinFloat;
 
 
 	PROCEDURE ConvertSet*(this: Basic.Set; bits: LONGINT): Basic.Set;
 	PROCEDURE ConvertSet*(this: Basic.Set; bits: LONGINT): Basic.Set;
-	VAR i: LONGINT;
 	BEGIN
 	BEGIN
 		WHILE bits <= MAX (Basic.Set) DO EXCL (this, bits); INC (bits) END;
 		WHILE bits <= MAX (Basic.Set) DO EXCL (this, bits); INC (bits) END;
 		RETURN this;
 		RETURN this;

+ 3 - 8
source/FoxParser.Mod

@@ -289,7 +289,6 @@ TYPE
 
 
 		(** Get next symbol from scanner and store it in object-local variable 'symbol' *)
 		(** Get next symbol from scanner and store it in object-local variable 'symbol' *)
 		PROCEDURE NextSymbol*;
 		PROCEDURE NextSymbol*;
-		VAR comment: SyntaxTree.Comment;
 		BEGIN
 		BEGIN
 			(*
 			(*
 				error := ~scanner.GetNextSymbol(symbol) OR error;
 				error := ~scanner.GetNextSymbol(symbol) OR error;
@@ -327,14 +326,12 @@ TYPE
 
 
 		(** Check if current symbol equals sym. If yes then return true, return false otherwise *)
 		(** Check if current symbol equals sym. If yes then return true, return false otherwise *)
 		PROCEDURE PeekB*(token: Scanner.Token): BOOLEAN;
 		PROCEDURE PeekB*(token: Scanner.Token): BOOLEAN;
-		VAR comment: SyntaxTree.Comment;
 		BEGIN
 		BEGIN
 			RETURN TokenB() = token
 			RETURN TokenB() = token
 		END PeekB;
 		END PeekB;
 
 
 		(** Check if current symbol equals sym. If yes then return true, return false otherwise *)
 		(** Check if current symbol equals sym. If yes then return true, return false otherwise *)
 		PROCEDURE Peek*(token: Scanner.Token): BOOLEAN;
 		PROCEDURE Peek*(token: Scanner.Token): BOOLEAN;
-		VAR comment: SyntaxTree.Comment;
 		BEGIN
 		BEGIN
 			SkipComments(FALSE);
 			SkipComments(FALSE);
 			RETURN Token() = token
 			RETURN Token() = token
@@ -1257,8 +1254,7 @@ TYPE
 		(** Code = {  any \ 'end' \ 'with' } ['with' {('in'|'out') StatementSequence}] . **)
 		(** Code = {  any \ 'end' \ 'with' } ['with' {('in'|'out') StatementSequence}] . **)
 		PROCEDURE Code(outer: SyntaxTree.Statement): SyntaxTree.Code;
 		PROCEDURE Code(outer: SyntaxTree.Statement): SyntaxTree.Code;
 		VAR startPos: Position; endPos, i ,len: LONGINT; codeString: Scanner.StringType; code: SyntaxTree.Code;
 		VAR startPos: Position; endPos, i ,len: LONGINT; codeString: Scanner.StringType; code: SyntaxTree.Code;
-			end: Scanner.Token; in, out: BOOLEAN; left, right: SyntaxTree.Identifier;
-			statements, rules: SyntaxTree.StatementSequence;
+			end: Scanner.Token; in, out: BOOLEAN; statements, rules: SyntaxTree.StatementSequence;
 		BEGIN
 		BEGIN
 			startPos := symbol.position;
 			startPos := symbol.position;
 			end := scanner.SkipToEndOfCode(startPos.start, endPos, symbol);
 			end := scanner.SkipToEndOfCode(startPos.start, endPos, symbol);
@@ -1359,7 +1355,6 @@ TYPE
 			qualifiedIdentifier: SyntaxTree.QualifiedIdentifier;
 			qualifiedIdentifier: SyntaxTree.QualifiedIdentifier;
 			baseType: SyntaxTree.Type;
 			baseType: SyntaxTree.Type;
 			identifier: SyntaxTree.Identifier;
 			identifier: SyntaxTree.Identifier;
-			str: Scanner.StringType;
 			type: SyntaxTree.Type;
 			type: SyntaxTree.Type;
 			modifiers: SyntaxTree.Modifier;
 			modifiers: SyntaxTree.Modifier;
 		BEGIN
 		BEGIN
@@ -2002,7 +1997,7 @@ TYPE
 			procedureType: SyntaxTree.ProcedureType;
 			procedureType: SyntaxTree.ProcedureType;
 			operator: SyntaxTree.Operator;
 			operator: SyntaxTree.Operator;
 			access: SET;
 			access: SET;
-			i: LONGINT; ch: CHAR; position: Position;
+			i: LONGINT; position: Position;
 			modifiers: SyntaxTree.Modifier; (* nopov *)
 			modifiers: SyntaxTree.Modifier; (* nopov *)
 			isInline, forward: BOOLEAN;
 			isInline, forward: BOOLEAN;
 		BEGIN
 		BEGIN
@@ -2238,7 +2233,7 @@ TYPE
 
 
 		PROCEDURE Module*(): SyntaxTree.Module;
 		PROCEDURE Module*(): SyntaxTree.Module;
 		VAR moduleName, context: SyntaxTree.Identifier;  module: SyntaxTree.Module;  position: Position; isCellNet: BOOLEAN;
 		VAR moduleName, context: SyntaxTree.Identifier;  module: SyntaxTree.Module;  position: Position; isCellNet: BOOLEAN;
-			scannerDiagnostics: Diagnostics.Diagnostics; modifiers: SyntaxTree.Modifier; c: SyntaxTree.Comment;
+			scannerDiagnostics: Diagnostics.Diagnostics; modifiers: SyntaxTree.Modifier; (* c: SyntaxTree.Comment; *)
 		BEGIN
 		BEGIN
 			IF Trace THEN S( "Module" ) END;
 			IF Trace THEN S( "Module" ) END;
 			position := symbol.position;
 			position := symbol.position;

+ 2 - 3
source/FoxScanner.Mod

@@ -122,7 +122,6 @@ TYPE
 		END InitTable;
 		END InitTable;
 
 
 		PROCEDURE IndexByIdentifier*(identifier: IdentifierType): LONGINT;
 		PROCEDURE IndexByIdentifier*(identifier: IdentifierType): LONGINT;
-		VAR stringPoolIndex: LONGINT;
 		BEGIN
 		BEGIN
 			IF Has(identifier) THEN
 			IF Has(identifier) THEN
 				RETURN GetInt(identifier)
 				RETURN GetInt(identifier)
@@ -528,7 +527,7 @@ TYPE
 		(* multiline indicates that a string may occupy more than one lines, either concatenated or via multi-strings " "  " "
 		(* multiline indicates that a string may occupy more than one lines, either concatenated or via multi-strings " "  " "
 		*)
 		*)
 		PROCEDURE GetString(VAR symbol: Symbol; multiLine, multiString, useControl: BOOLEAN);
 		PROCEDURE GetString(VAR symbol: Symbol; multiLine, multiString, useControl: BOOLEAN);
-		VAR och: CHAR; error: BOOLEAN; done: BOOLEAN;
+		VAR och: CHAR; error: BOOLEAN;
 		CONST control = '\';
 		CONST control = '\';
 
 
 			PROCEDURE Append(ch :CHAR);
 			PROCEDURE Append(ch :CHAR);
@@ -1002,7 +1001,7 @@ TYPE
 		(** set the diagnostics mode of the scanner (diagnostics = NIL ==> no report) and reset the error state
 		(** set the diagnostics mode of the scanner (diagnostics = NIL ==> no report) and reset the error state
 			intended for silent symbol peeeking after the end of a module *)
 			intended for silent symbol peeeking after the end of a module *)
 		PROCEDURE ResetErrorDiagnostics*(VAR diagnostics: Diagnostics.Diagnostics);
 		PROCEDURE ResetErrorDiagnostics*(VAR diagnostics: Diagnostics.Diagnostics);
-		VAR b: BOOLEAN; d: Diagnostics.Diagnostics;
+		VAR d: Diagnostics.Diagnostics;
 		BEGIN
 		BEGIN
 			error := FALSE;
 			error := FALSE;
 			d := SELF.diagnostics; SELF.diagnostics := diagnostics; diagnostics := d;
 			d := SELF.diagnostics; SELF.diagnostics := diagnostics; diagnostics := d;

+ 0 - 3
source/FoxSemanticChecker.Mod

@@ -1148,8 +1148,6 @@ TYPE
 			str: Scanner.StringType;
 			str: Scanner.StringType;
 			atype: SyntaxTree.ArrayType;
 			atype: SyntaxTree.ArrayType;
 			prev: SyntaxTree.Scope;
 			prev: SyntaxTree.Scope;
-			skip: BOOLEAN;
-			svalue: ARRAY 32 OF CHAR;
 			
 			
 		BEGIN
 		BEGIN
 			IF TypeNeedsResolution(x) THEN
 			IF TypeNeedsResolution(x) THEN
@@ -6892,7 +6890,6 @@ TYPE
 		PROCEDURE VisitProcedure*(procedure: SyntaxTree.Procedure);
 		PROCEDURE VisitProcedure*(procedure: SyntaxTree.Procedure);
 		VAR super,proc: SyntaxTree.Procedure; record: SyntaxTree.RecordType;
 		VAR super,proc: SyntaxTree.Procedure; record: SyntaxTree.RecordType;
 			procedureType: SyntaxTree.ProcedureType;
 			procedureType: SyntaxTree.ProcedureType;
-			type: SyntaxTree.Type;
 			selfParameter: SyntaxTree.Parameter; qualifiedIdentifier: SyntaxTree.QualifiedIdentifier;
 			selfParameter: SyntaxTree.Parameter; qualifiedIdentifier: SyntaxTree.QualifiedIdentifier;
 			qualifiedType: SyntaxTree.QualifiedType;
 			qualifiedType: SyntaxTree.QualifiedType;
 			value: Basic.Integer;
 			value: Basic.Integer;

+ 2 - 2
source/GenericLinker.Mod

@@ -513,7 +513,7 @@ BEGIN
 END Header;
 END Header;
 
 
 PROCEDURE OffersRequires*(reader: Streams.Reader; VAR offers, requires: ObjectFile.NameList);
 PROCEDURE OffersRequires*(reader: Streams.Reader; VAR offers, requires: ObjectFile.NameList);
-VAR section: ObjectFile.Section; binary: BOOLEAN; poolMap: ObjectFile.PoolMap;  version: LONGINT;
+VAR binary: BOOLEAN; poolMap: ObjectFile.PoolMap;  version: LONGINT;
 BEGIN
 BEGIN
 	version := Header(reader, NIL, binary, poolMap, offers, requires);
 	version := Header(reader, NIL, binary, poolMap, offers, requires);
 END OffersRequires;
 END OffersRequires;
@@ -532,4 +532,4 @@ END Process;
 END GenericLinker.
 END GenericLinker.
 
 
 
 
-Compiler.Compile --objectFile=Generic --newObjectFile GenericLinker.Mod   ~~~
+Compiler.Compile --objectFile=Generic --newObjectFile GenericLinker.Mod   ~~~

+ 1 - 1
source/I386.FoxArrayBaseOptimized.Mod

@@ -4770,7 +4770,7 @@ VAR
 				 M, N, K, L2BlockM, L2BlockN, L2BlockK: SIZE;
 				 M, N, K, L2BlockM, L2BlockN, L2BlockK: SIZE;
 										  IncA, StrideA, IncB, StrideB, IncC, StrideC: SIZE;
 										  IncA, StrideA, IncB, StrideB, IncC, StrideC: SIZE;
 										  add: BOOLEAN );
 										  add: BOOLEAN );
-	VAR lenA, lenB, len: SIZE; adrA, adrB, adrC: ADDRESS;  m: SIZE;
+	VAR lenA, lenB: SIZE; adrA, adrB, adrC: ADDRESS;  m: SIZE;
 		M1, M2, i: SIZE;  val: REAL;  inc: SIZE;
 		M1, M2, i: SIZE;  val: REAL;  inc: SIZE;
 		obj: POINTER TO ARRAY OF MultiplyObjectR;
 		obj: POINTER TO ARRAY OF MultiplyObjectR;
 		t: HUGEINT;  cache: Cache;
 		t: HUGEINT;  cache: Cache;