2
0
Эх сурвалжийг харах

Unified whitespace

git-svn-id: https://svn-dept.inf.ethz.ch/svn/lecturers/a2/trunk@8732 8c9fc860-2736-0410-a75d-ab315db34111
negelef 6 жил өмнө
parent
commit
72406ae9e0
53 өөрчлөгдсөн 904 нэмэгдсэн , 1571 устгасан
  1. 1 3
      source/FoxA2Interface.Mod
  2. 6 26
      source/FoxAMD64Assembler.Mod
  3. 17 31
      source/FoxAMD64InstructionSet.Mod
  4. 79 92
      source/FoxAMDBackend.Mod
  5. 0 2
      source/FoxARMAssembler.Mod
  6. 76 92
      source/FoxARMBackend.Mod
  7. 129 137
      source/FoxARMInstructionSet.Mod
  8. 55 72
      source/FoxActiveCells.Mod
  9. 101 128
      source/FoxArrayBase.Mod
  10. 38 42
      source/FoxAssembler.Mod
  11. 1 4
      source/FoxBackend.Mod
  12. 20 28
      source/FoxBasic.Mod
  13. 22 30
      source/FoxBinaryCode.Mod
  14. 0 3
      source/FoxCSharpParser.Mod
  15. 1 1
      source/FoxCSharpScanner.Mod
  16. 3 12
      source/FoxCodeGenerators.Mod
  17. 3 10
      source/FoxDisassembler.Mod
  18. 1 16
      source/FoxDocumentationBackend.Mod
  19. 7 10
      source/FoxDocumentationHtml.Mod
  20. 1 2
      source/FoxDocumentationParser.Mod
  21. 0 3
      source/FoxDocumentationScanner.Mod
  22. 1 8
      source/FoxDocumentationTree.Mod
  23. 16 23
      source/FoxFingerprinter.Mod
  24. 1 1
      source/FoxFormats.Mod
  25. 6 12
      source/FoxGenericObjectFile.Mod
  26. 0 15
      source/FoxGlobal.Mod
  27. 0 3
      source/FoxInterfaceComparison.Mod
  28. 0 7
      source/FoxIntermediateAssembler.Mod
  29. 51 166
      source/FoxIntermediateBackend.Mod
  30. 6 20
      source/FoxIntermediateCode.Mod
  31. 4 23
      source/FoxIntermediateLinker.Mod
  32. 0 2
      source/FoxIntermediateObjectFile.Mod
  33. 1 2
      source/FoxIntermediateParser.Mod
  34. 3 14
      source/FoxInterpreter.Mod
  35. 2 3
      source/FoxInterpreterBackend.Mod
  36. 5 22
      source/FoxInterpreterSymbols.Mod
  37. 10 17
      source/FoxMinosObjectFile.Mod
  38. 0 2
      source/FoxOberonFrontend.Mod
  39. 31 37
      source/FoxParser.Mod
  40. 9 17
      source/FoxPrintout.Mod
  41. 1 4
      source/FoxProfiler.Mod
  42. 3 22
      source/FoxProgTools.Mod
  43. 29 37
      source/FoxScanner.Mod
  44. 2 5
      source/FoxSections.Mod
  45. 47 120
      source/FoxSemanticChecker.Mod
  46. 28 66
      source/FoxSyntaxTree.Mod
  47. 1 9
      source/FoxTRMAssembler.Mod
  48. 53 75
      source/FoxTRMBackend.Mod
  49. 23 52
      source/FoxTRMInstructionSet.Mod
  50. 0 26
      source/FoxTRMTools.Mod
  51. 2 3
      source/FoxTest.Mod
  52. 0 4
      source/FoxTextualSymbolFile.Mod
  53. 8 10
      source/FoxTranspilerBackend.Mod

+ 1 - 3
source/FoxA2Interface.Mod

@@ -101,7 +101,6 @@ TYPE
 
 
 	END StreamDiagnostics;
 	END StreamDiagnostics;
 
 
-
 	PROCEDURE Print (w: Streams.Writer; CONST source : ARRAY OF CHAR; position: Streams.Position; type: WORD; CONST message: ARRAY OF CHAR);
 	PROCEDURE Print (w: Streams.Writer; CONST source : ARRAY OF CHAR; position: Streams.Position; type: WORD; CONST message: ARRAY OF CHAR);
 	VAR attributes: Texts.Attributes;
 	VAR attributes: Texts.Attributes;
 	BEGIN
 	BEGIN
@@ -160,5 +159,4 @@ TYPE
 
 
 END FoxA2Interface.
 END FoxA2Interface.
 
 
-FSTools.DeleteFiles FoxA2Interface.Obw ~~
-
+FSTools.DeleteFiles FoxA2Interface.Obw ~

+ 6 - 26
source/FoxAMD64Assembler.Mod

@@ -48,7 +48,6 @@ CONST
 	segFS = 4;
 	segFS = 4;
 	segGS = 5;
 	segGS = 5;
 
 
-
 	(* sizes *)
 	(* sizes *)
 	bitsDefault* = 0;
 	bitsDefault* = 0;
 	bits8* = 1;
 	bits8* = 1;
@@ -91,7 +90,6 @@ CONST
 	pntr1616*= InstructionSet.pntr1616;
 	pntr1616*= InstructionSet.pntr1616;
 	pntr1632*=InstructionSet.pntr1632;
 	pntr1632*=InstructionSet.pntr1632;
 
 
-
 	(* scanner codes *)
 	(* scanner codes *)
 	TAB = 09X;
 	TAB = 09X;
 	LF = 0AX;
 	LF = 0AX;
@@ -285,7 +283,6 @@ TYPE
 			code.fixupList.AddFixup(fixup);
 			code.fixupList.AddFixup(fixup);
 		END AddFixup;
 		END AddFixup;
 
 
-
 		PROCEDURE EmitInstruction (mnem: LONGINT; VAR operands: ARRAY OF Operand; lastPass: BOOLEAN): BOOLEAN;
 		PROCEDURE EmitInstruction (mnem: LONGINT; VAR operands: ARRAY OF Operand; lastPass: BOOLEAN): BOOLEAN;
 		VAR instr, i, oppos, op: LONGINT;
 		VAR instr, i, oppos, op: LONGINT;
 			val: LONGINT;
 			val: LONGINT;
@@ -409,7 +406,6 @@ TYPE
 				RETURN (c1 = CHR(opCode)) & ((c2 = 0F2X) OR (c2 = 0F3X) ) ;
 				RETURN (c1 = CHR(opCode)) & ((c2 = 0F2X) OR (c2 = 0F3X) ) ;
 			END IsPreREXPrefix;
 			END IsPreREXPrefix;
 
 
-
 		BEGIN
 		BEGIN
 			IF (dump # NIL) & (lastPass) THEN
 			IF (dump # NIL) & (lastPass) THEN
 				pc0 := code.pc;
 				pc0 := code.pc;
@@ -516,7 +512,7 @@ TYPE
 								(InstructionSet.instructions[instr].operands[i] = InstructionSet.regmem64)
 								(InstructionSet.instructions[instr].operands[i] = InstructionSet.regmem64)
 								OR
 								OR
 								(InstructionSet.instructions[instr].operands[i] = InstructionSet.mem)
 								(InstructionSet.instructions[instr].operands[i] = InstructionSet.mem)
-							 THEN
+							THEN
 								IF Trace THEN KernelLog.String(" rex prefix bits64 "); KernelLog.Ln; END;
 								IF Trace THEN KernelLog.String(" rex prefix bits64 "); KernelLog.Ln; END;
 								INCL(rexPrefix,rexW);
 								INCL(rexPrefix,rexW);
 							END;
 							END;
@@ -562,7 +558,6 @@ TYPE
 			IF InstructionSet.optPREP IN bitwidthOptions THEN code.PutByte (InstructionSet.prfREP) END;
 			IF InstructionSet.optPREP IN bitwidthOptions THEN code.PutByte (InstructionSet.prfREP) END;
 			IF InstructionSet.optPREPN IN bitwidthOptions THEN code.PutByte (InstructionSet.prfREPNE) END;
 			IF InstructionSet.optPREPN IN bitwidthOptions THEN code.PutByte (InstructionSet.prfREPNE) END;
 
 
-
 			op := 0;
 			op := 0;
 
 
 			oppos := 0;
 			oppos := 0;
@@ -582,7 +577,6 @@ TYPE
 				code.PutByte (byte);
 				code.PutByte (byte);
 			END;
 			END;
 
 
-
 			WHILE (oppos < LEN(opcode)) & (opcode[oppos] # CHR(none)) DO
 			WHILE (oppos < LEN(opcode)) & (opcode[oppos] # CHR(none)) DO
 
 
 				IF opcode[oppos] = CHR(opCode) THEN
 				IF opcode[oppos] = CHR(opCode) THEN
@@ -703,7 +697,7 @@ TYPE
 									END;
 									END;
 								*)
 								*)
 								IF lastPass & (operands[addressOperand].symbol.name # "") THEN
 								IF lastPass & (operands[addressOperand].symbol.name # "") THEN
-									 AddFixup(BinaryCode.Absolute,4,code.pc,operands[addressOperand].symbol, operands[addressOperand].symbolOffset,operands[addressOperand].displacement)
+									AddFixup(BinaryCode.Absolute,4,code.pc,operands[addressOperand].symbol, operands[addressOperand].symbolOffset,operands[addressOperand].displacement)
 								END;
 								END;
 								code.PutDWord (operands[addressOperand].displacement);
 								code.PutDWord (operands[addressOperand].displacement);
 							ELSE
 							ELSE
@@ -949,7 +943,7 @@ TYPE
 							IF (free[i]) & InstructionSet.IsImmediate64(InstructionSet.instructions[instr].operands[i])  THEN
 							IF (free[i]) & InstructionSet.IsImmediate64(InstructionSet.instructions[instr].operands[i])  THEN
 								operands[i].pc := code.pc;
 								operands[i].pc := code.pc;
 								IF lastPass & (operands[i].symbol.name # "") THEN
 								IF lastPass & (operands[i].symbol.name # "") THEN
-									 AddFixup(BinaryCode.Absolute,8,code.pc,operands[i].symbol,operands[i].symbolOffset,operands[i].displacement)
+									AddFixup(BinaryCode.Absolute,8,code.pc,operands[i].symbol,operands[i].symbolOffset,operands[i].displacement)
 								END;
 								END;
 								code.PutQWord (operands[i].val);
 								code.PutQWord (operands[i].val);
 								free[i] := FALSE; i:= maxNumberOperands;
 								free[i] := FALSE; i:= maxNumberOperands;
@@ -979,7 +973,7 @@ TYPE
 									code.PutWord (operands[i].displacement);
 									code.PutWord (operands[i].displacement);
 								ELSE
 								ELSE
 									IF lastPass & (operands[i].symbol.name # "") THEN
 									IF lastPass & (operands[i].symbol.name # "") THEN
-										 AddFixup(BinaryCode.Absolute,4,code.pc,operands[i].symbol,operands[i].symbolOffset,operands[i].displacement)
+										AddFixup(BinaryCode.Absolute,4,code.pc,operands[i].symbol,operands[i].symbolOffset,operands[i].displacement)
 									END;
 									END;
 									code.PutDWord (operands[i].displacement);
 									code.PutDWord (operands[i].displacement);
 								END;
 								END;
@@ -1175,7 +1169,6 @@ TYPE
 			Error(message);
 			Error(message);
 		END ErrorSS;
 		END ErrorSS;
 
 
-
 		PROCEDURE Assemble* (reader: Streams.Reader;  orgPos: Basic.Position; scope: SyntaxTree.Scope; in: IntermediateCode.Section; out: IntermediateCode.Section; module: Sections.Module; exported, inlined: BOOLEAN;
 		PROCEDURE Assemble* (reader: Streams.Reader;  orgPos: Basic.Position; scope: SyntaxTree.Scope; in: IntermediateCode.Section; out: IntermediateCode.Section; module: Sections.Module; exported, inlined: BOOLEAN;
 			map: RegisterMap
 			map: RegisterMap
 		);
 		);
@@ -1277,7 +1270,6 @@ TYPE
 				SkipBlanks;
 				SkipBlanks;
 				errPos := position;
 				errPos := position;
 
 
-
 				CASE char OF
 				CASE char OF
 				'A' .. 'Z', 'a' .. 'z', '_' :
 				'A' .. 'Z', 'a' .. 'z', '_' :
 					GetIdentifier;
 					GetIdentifier;
@@ -1367,7 +1359,6 @@ TYPE
 				END;
 				END;
 			END Ensure;
 			END Ensure;
 
 
-
 			PROCEDURE GetCPU (cumulateOptions: BOOLEAN): BOOLEAN;
 			PROCEDURE GetCPU (cumulateOptions: BOOLEAN): BOOLEAN;
 			VAR i: LONGINT;
 			VAR i: LONGINT;
 			BEGIN
 			BEGIN
@@ -1391,7 +1382,6 @@ TYPE
 
 
 			END GetCPU;
 			END GetCPU;
 
 
-
 			PROCEDURE Factor (VAR x: HUGEINT; critical: BOOLEAN; VAR type: SHORTINT): BOOLEAN;
 			PROCEDURE Factor (VAR x: HUGEINT; critical: BOOLEAN; VAR type: SHORTINT): BOOLEAN;
 			VAR label: NamedLabel; l: LONGINT;
 			VAR label: NamedLabel; l: LONGINT;
 			BEGIN
 			BEGIN
@@ -1518,7 +1508,6 @@ TYPE
 				END;
 				END;
 			END Align;
 			END Align;
 
 
-
 			PROCEDURE PutData (size: Size): BOOLEAN;
 			PROCEDURE PutData (size: Size): BOOLEAN;
 			VAR i: SIZE; x: HUGEINT; type:SHORTINT; ofs: Operand;
 			VAR i: SIZE; x: HUGEINT; type:SHORTINT; ofs: Operand;
 			BEGIN
 			BEGIN
@@ -1665,7 +1654,6 @@ TYPE
 				END;
 				END;
 			END GetValue;
 			END GetValue;
 
 
-
 			PROCEDURE GetMemFixup (CONST ident: ARRAY OF CHAR; VAR operand: Operand);
 			PROCEDURE GetMemFixup (CONST ident: ARRAY OF CHAR; VAR operand: Operand);
 			VAR scopeSymbol:SyntaxTree.Symbol;
 			VAR scopeSymbol:SyntaxTree.Symbol;
 			BEGIN
 			BEGIN
@@ -1728,7 +1716,6 @@ TYPE
 			PROCEDURE AdaptOperandSizes(VAR operands: ARRAY OF Operand);
 			PROCEDURE AdaptOperandSizes(VAR operands: ARRAY OF Operand);
 			VAR i: LONGINT;
 			VAR i: LONGINT;
 
 
-
 				PROCEDURE OffsetSize(val: HUGEINT): SHORTINT;
 				PROCEDURE OffsetSize(val: HUGEINT): SHORTINT;
 				BEGIN
 				BEGIN
 					DEC(val,emitter.code.pc);
 					DEC(val,emitter.code.pc);
@@ -1902,7 +1889,6 @@ TYPE
 							operands[opCount] := mem;
 							operands[opCount] := mem;
 							INC (opCount);
 							INC (opCount);
 
 
-
 							IF ~Ensure (symRBraket, 556) THEN
 							IF ~Ensure (symRBraket, 556) THEN
 								RETURN FALSE;
 								RETURN FALSE;
 							END;
 							END;
@@ -1914,7 +1900,6 @@ TYPE
 								GetOffsetFixup (idents, offset);
 								GetOffsetFixup (idents, offset);
 							END;
 							END;
 
 
-
 							IF offset.symbol.name = "" THEN (* nothing could be fixuped, must be a number / constant *)
 							IF offset.symbol.name = "" THEN (* nothing could be fixuped, must be a number / constant *)
 								type := offset.type; currentFixup := ""; currentLabel := NIL;
 								type := offset.type; currentFixup := ""; currentLabel := NIL;
 								IF ~Expression (offset.val, FALSE,type) THEN
 								IF ~Expression (offset.val, FALSE,type) THEN
@@ -2243,11 +2228,11 @@ TYPE
 	END IsRegisterOperand;
 	END IsRegisterOperand;
 
 
 	PROCEDURE IsMemoryOperand*(CONST op: Operand): BOOLEAN;
 	PROCEDURE IsMemoryOperand*(CONST op: Operand): BOOLEAN;
-	BEGIN 	RETURN op.type = mem
+	BEGIN RETURN op.type = mem
 	END IsMemoryOperand;
 	END IsMemoryOperand;
 
 
 	PROCEDURE IsImmediateOperand*(CONST op: Operand): BOOLEAN;
 	PROCEDURE IsImmediateOperand*(CONST op: Operand): BOOLEAN;
-	BEGIN 	RETURN op.type = imm
+	BEGIN RETURN op.type = imm
 	END IsImmediateOperand;
 	END IsImmediateOperand;
 
 
 	PROCEDURE DumpType*(w: Streams.Writer; type: LONGINT);
 	PROCEDURE DumpType*(w: Streams.Writer; type: LONGINT);
@@ -2323,7 +2308,6 @@ TYPE
 			HALT(100)
 			HALT(100)
 		END;
 		END;
 
 
-
 	END DumpOperand;
 	END DumpOperand;
 
 
 	PROCEDURE DumpInstruction(w: Streams.Writer; mnemonic: LONGINT; CONST operands: ARRAY OF Operand);
 	PROCEDURE DumpInstruction(w: Streams.Writer; mnemonic: LONGINT; CONST operands: ARRAY OF Operand);
@@ -2542,7 +2526,6 @@ TYPE
 	BEGIN RETURN SYSTEM.VAL (INTEGER, value) = value
 	BEGIN RETURN SYSTEM.VAL (INTEGER, value) = value
 	END ValueInWordRange;
 	END ValueInWordRange;
 
 
-
 	PROCEDURE InitOperand*(VAR operand: Operand);
 	PROCEDURE InitOperand*(VAR operand: Operand);
 	BEGIN
 	BEGIN
 		operand.type := none;
 		operand.type := none;
@@ -2560,7 +2543,6 @@ TYPE
 		operand.offset := 0;
 		operand.offset := 0;
 	END InitOperand;
 	END InitOperand;
 
 
-
 	PROCEDURE InitRegister* (VAR operand: Operand; register: Register);
 	PROCEDURE InitRegister* (VAR operand: Operand; register: Register);
 	BEGIN
 	BEGIN
 		InitOperand(operand);
 		InitOperand(operand);
@@ -2758,7 +2740,6 @@ TYPE
 		RETURN FALSE
 		RETURN FALSE
 	END SameOperand;
 	END SameOperand;
 
 
-
 	PROCEDURE Test*(context: Commands.Context);
 	PROCEDURE Test*(context: Commands.Context);
 	VAR assembly: Emitter;
 	VAR assembly: Emitter;
 		(*errorHandler: ErrorHandler; *)
 		(*errorHandler: ErrorHandler; *)
@@ -2792,4 +2773,3 @@ TYPE
 	END FoxAMD64Assembler.
 	END FoxAMD64Assembler.
 
 
 OCAMD64Assembler.Test ~
 OCAMD64Assembler.Test ~
-

+ 17 - 31
source/FoxAMD64InstructionSet.Mod

@@ -92,41 +92,40 @@ CONST
 	optPREP* = 9;		(* a repeat prefix must preceed the instruction *)
 	optPREP* = 9;		(* a repeat prefix must preceed the instruction *)
 	optPREPN* = 10;	(* a repeat prefix must preceed the instruction *)
 	optPREPN* = 10;	(* a repeat prefix must preceed the instruction *)
 
 
-
 	(*
 	(*
 		FoxProgTools.Enum -l=1 -e
 		FoxProgTools.Enum -l=1 -e
 		(** operand types, numbers assigned to the types do not have a special meaning **)
 		(** operand types, numbers assigned to the types do not have a special meaning **)
 		(* register classes first *)
 		(* register classes first *)
-		 reg8 reg16 reg32 reg64 CRn DRn segReg mmx xmm ymm sti
-		 (* other classes *)
-		 mem imm ioffset pntr1616 pntr1632
+		reg8 reg16 reg32 reg64 CRn DRn segReg mmx xmm ymm sti
+		(* other classes *)
+		mem imm ioffset pntr1616 pntr1632
 		(* special registers *)
 		(* special registers *)
-		 AL  AX  CL  CR8   CS   DS  DX  EAX  ECX  ES  FS  GS  RAX  SS rAX st0
-		 (* immediates and memory locations *)
-		 imm16  imm32  imm64  imm8
-		 uimm16  uimm32  uimm8
-		 simm16  simm32  simm8
+		AL  AX  CL  CR8   CS   DS  DX  EAX  ECX  ES  FS  GS  RAX  SS rAX st0
+		(* immediates and memory locations *)
+		imm16  imm32  imm64  imm8
+		uimm16  uimm32  uimm8
+		simm16  simm32  simm8
 		mem256
 		mem256
- 		mem128  mem16  mem32  mem64  mem8
-		 moffset16  moffset32  moffset64  moffset8
-		 rel16off  rel32off  rel8off
+		mem128  mem16  mem32  mem64  mem8
+		moffset16  moffset32  moffset64  moffset8
+		rel16off  rel32off  rel8off
 		(* ambivalent operand types *)
 		(* ambivalent operand types *)
-		 reg3264
-		 regmem16  regmem32  regmem64  regmem8 reg32mem16
-		 mmxmem32  mmxmem64
-		 xmmmem256 xmmmem128  xmmmem32  xmmmem64
+		reg3264
+		regmem16  regmem32  regmem64  regmem8 reg32mem16
+		mmxmem32  mmxmem64
+		xmmmem256 xmmmem128  xmmmem32  xmmmem64
 		xmmmem8
 		xmmmem8
 		xmmmem16
 		xmmmem16
 		ymmmem128
 		ymmmem128
 		ymmmem256
 		ymmmem256
 		(* miscellaneous *)
 		(* miscellaneous *)
-		 one three
+		one three
 		vm32x
 		vm32x
 		vm32y
 		vm32y
 		vm64x
 		vm64x
 		vm64y
 		vm64y
 		m2z;
 		m2z;
-		 ~
+		~
 	*)
 	*)
 	(** operand types, numbers assigned to the types do not have a special meaning **)
 	(** operand types, numbers assigned to the types do not have a special meaning **)
 	(* register classes first *)
 	(* register classes first *)
@@ -230,7 +229,6 @@ CONST
 	prfREPNE* = 0F2H;
 	prfREPNE* = 0F2H;
 	prfREPNZ* = 0F2H;
 	prfREPNZ* = 0F2H;
 
 
-
 	(* registers
 	(* registers
 		FoxProgTools.Enum -e -l=8 -s=0
 		FoxProgTools.Enum -e -l=8 -s=0
 		(** 8 bit general purpose registers **)
 		(** 8 bit general purpose registers **)
@@ -297,7 +295,6 @@ CONST
 		18			BH
 		18			BH
 		19			DH
 		19			DH
 
 
-
 		*)
 		*)
 
 
 	(** register indices, the order is arbitrary and has no meaning for instruction encoding,
 	(** register indices, the order is arbitrary and has no meaning for instruction encoding,
@@ -1343,7 +1340,6 @@ VAR
 	opVZEROALL*,
 	opVZEROALL*,
 	opVZEROUPPER*
 	opVZEROUPPER*
 
 
-
 	: LONGINT
 	: LONGINT
 
 
 	(*
 	(*
@@ -1413,7 +1409,6 @@ VAR
 	cpus-: ARRAY maxCPUs OF CPUType;
 	cpus-: ARRAY maxCPUs OF CPUType;
 	cpuCount: LONGINT;
 	cpuCount: LONGINT;
 
 
-
 	(* perform a binary search for the index of the specified mnemonic *)
 	(* perform a binary search for the index of the specified mnemonic *)
 	PROCEDURE FindMnemonic* (CONST mnem: ARRAY OF CHAR): LONGINT;
 	PROCEDURE FindMnemonic* (CONST mnem: ARRAY OF CHAR): LONGINT;
 	VAR l, r, m: LONGINT;
 	VAR l, r, m: LONGINT;
@@ -1919,12 +1914,9 @@ VAR
 			INC(numberInstructions);
 			INC(numberInstructions);
 		END AddInstructionV;
 		END AddInstructionV;
 
 
-
 		PROCEDURE AddInstruction(mnemonic: LONGINT; CONST op,code: ARRAY OF CHAR; bitwidthOptions, cpuOptions: SET);
 		PROCEDURE AddInstruction(mnemonic: LONGINT; CONST op,code: ARRAY OF CHAR; bitwidthOptions, cpuOptions: SET);
 		VAR i: SHORTINT; at: LONGINT;
 		VAR i: SHORTINT; at: LONGINT;
 
 
-
-
 		BEGIN
 		BEGIN
 			i := 0; at := 0;
 			i := 0; at := 0;
 			WHILE (i<maxNumberOperands) DO
 			WHILE (i<maxNumberOperands) DO
@@ -1947,14 +1939,12 @@ VAR
 			INC(numberInstructions);
 			INC(numberInstructions);
 		END AddInstruction;
 		END AddInstruction;
 
 
-
 	(* the following has partially been generated with
 	(* the following has partially been generated with
 		FoxProgTools.ParseAMDInstructionSet FoxInstructionSetAMD64TabSeperated.txt ~
 		FoxProgTools.ParseAMDInstructionSet FoxInstructionSetAMD64TabSeperated.txt ~
 
 
 		Do not change or re-order. The alphabetical order is of importance
 		Do not change or re-order. The alphabetical order is of importance
 	*)
 	*)
 
 
-
 	BEGIN
 	BEGIN
 		numberMnemonics := 0;
 		numberMnemonics := 0;
 		numberInstructions := 0;
 		numberInstructions := 0;
@@ -2970,7 +2960,6 @@ VAR
 		AddMnemonic(opXORPD, "XORPD");
 		AddMnemonic(opXORPD, "XORPD");
 		AddMnemonic(opXORPS, "XORPS");
 		AddMnemonic(opXORPS, "XORPS");
 
 
-
 		AddInstruction(opAAA, "", "37", {optNot64}, {cpu8086});
 		AddInstruction(opAAA, "", "37", {optNot64}, {cpu8086});
 		AddInstruction(opAAD, "", "D50A", {optNot64}, {cpu8086});
 		AddInstruction(opAAD, "", "D50A", {optNot64}, {cpu8086});
 		AddInstruction(opAAD, "", "D5ib", {optNot64}, {cpu8086});
 		AddInstruction(opAAD, "", "D5ib", {optNot64}, {cpu8086});
@@ -4346,7 +4335,6 @@ VAR
 		AddInstruction(opXORPD, "xmm1,xmm2/mem128", "0F57/r", {optPOP}, {cpuSSE2});
 		AddInstruction(opXORPD, "xmm1,xmm2/mem128", "0F57/r", {optPOP}, {cpuSSE2});
 		AddInstruction(opXORPS, "xmm1,xmm2/mem128", "0F57/r", {}, {cpuSSE});
 		AddInstruction(opXORPS, "xmm1,xmm2/mem128", "0F57/r", {}, {cpuSSE});
 
 
-
 		AddInstructionV(opVAESKEYGENASSIST,"xmm1,xmm2/mem128,imm8","C4 RXB.00011 X.src.0.01 DF /r ib");
 		AddInstructionV(opVAESKEYGENASSIST,"xmm1,xmm2/mem128,imm8","C4 RXB.00011 X.src.0.01 DF /r ib");
 		AddInstructionV(opVPMADCSWD,"xmm1,xmm2,xmm3/mem128,xmm4","8F RXB.08 0.src1.0.00 B6 /r ib");
 		AddInstructionV(opVPMADCSWD,"xmm1,xmm2,xmm3/mem128,xmm4","8F RXB.08 0.src1.0.00 B6 /r ib");
 		AddInstructionV(opVADDPD,"xmm1,xmm2,xmm3/mem128","C4 RXB.00001 X.src.0.01 58 /r");
 		AddInstructionV(opVADDPD,"xmm1,xmm2,xmm3/mem128","C4 RXB.00001 X.src.0.01 58 /r");
@@ -5414,7 +5402,6 @@ VAR
 		END;
 		END;
 	END Trace;
 	END Trace;
 
 
-
 BEGIN
 BEGIN
 	InitInstructions;
 	InitInstructions;
 	InitRegisters;
 	InitRegisters;
@@ -5474,4 +5461,3 @@ System.Free FoxAMD64InstructionSet ~
 	END;
 	END;
 
 
 	**)
 	**)
-

+ 79 - 92
source/FoxAMDBackend.Mod

@@ -14,21 +14,21 @@ CONST
 
 
 	RAX=InstructionSet.regRAX; RCX=InstructionSet.regRCX; RDX=InstructionSet.regRDX; RBX=InstructionSet.regRBX;
 	RAX=InstructionSet.regRAX; RCX=InstructionSet.regRCX; RDX=InstructionSet.regRDX; RBX=InstructionSet.regRBX;
 	RSP=InstructionSet.regRSP; RBP=InstructionSet.regRBP; RSI=InstructionSet.regRSI; RDI=InstructionSet.regRDI;
 	RSP=InstructionSet.regRSP; RBP=InstructionSet.regRBP; RSI=InstructionSet.regRSI; RDI=InstructionSet.regRDI;
-	R8=InstructionSet.regR8; 	R9=InstructionSet.regR9; 	R10=InstructionSet.regR10; 	R11=InstructionSet.regR11;
-	R12=InstructionSet.regR12; 	R13=InstructionSet.regR13; 	R14=InstructionSet.regR14; 	R15=InstructionSet.regR15;
+	R8=InstructionSet.regR8; R9=InstructionSet.regR9; R10=InstructionSet.regR10; R11=InstructionSet.regR11;
+	R12=InstructionSet.regR12; R13=InstructionSet.regR13; R14=InstructionSet.regR14; R15=InstructionSet.regR15;
 	EAX=InstructionSet.regEAX; ECX=InstructionSet.regECX; EDX=InstructionSet.regEDX; EBX=InstructionSet.regEBX;
 	EAX=InstructionSet.regEAX; ECX=InstructionSet.regECX; EDX=InstructionSet.regEDX; EBX=InstructionSet.regEBX;
 	ESP=InstructionSet.regESP; EBP=InstructionSet.regEBP; ESI=InstructionSet.regESI; EDI=InstructionSet.regEDI;
 	ESP=InstructionSet.regESP; EBP=InstructionSet.regEBP; ESI=InstructionSet.regESI; EDI=InstructionSet.regEDI;
-	R8D=InstructionSet.regR8D; 	R9D=InstructionSet.regR9D; 	R10D=InstructionSet.regR10D; 	R11D=InstructionSet.regR11D;
-	R12D=InstructionSet.regR12D; 	R13D=InstructionSet.regR13D; 	R14D=InstructionSet.regR14D; 	R15D=InstructionSet.regR15D;
-	AX=InstructionSet.regAX;	CX=InstructionSet.regCX;	DX=InstructionSet.regDX;	BX=InstructionSet.regBX;
+	R8D=InstructionSet.regR8D; R9D=InstructionSet.regR9D; R10D=InstructionSet.regR10D; R11D=InstructionSet.regR11D;
+	R12D=InstructionSet.regR12D; R13D=InstructionSet.regR13D; R14D=InstructionSet.regR14D; R15D=InstructionSet.regR15D;
+	AX=InstructionSet.regAX; CX=InstructionSet.regCX; DX=InstructionSet.regDX; BX=InstructionSet.regBX;
 	SI=InstructionSet.regSI; DI=InstructionSet.regDI; BP=InstructionSet.regBP; SP=InstructionSet.regSP;
 	SI=InstructionSet.regSI; DI=InstructionSet.regDI; BP=InstructionSet.regBP; SP=InstructionSet.regSP;
-	R8W=InstructionSet.regR8W; 	R9W=InstructionSet.regR9W; 	R10W=InstructionSet.regR10W; 	R11W=InstructionSet.regR11W;
-	R12W=InstructionSet.regR12W; 	R13W=InstructionSet.regR13W; 	R14W=InstructionSet.regR14W; 	R15W=InstructionSet.regR15W;
-	AL=InstructionSet.regAL;	CL=InstructionSet.regCL;	DL=InstructionSet.regDL;	BL=InstructionSet.regBL;	SIL=InstructionSet.regSIL;
+	R8W=InstructionSet.regR8W; R9W=InstructionSet.regR9W; R10W=InstructionSet.regR10W; R11W=InstructionSet.regR11W;
+	R12W=InstructionSet.regR12W; R13W=InstructionSet.regR13W; R14W=InstructionSet.regR14W; R15W=InstructionSet.regR15W;
+	AL=InstructionSet.regAL; CL=InstructionSet.regCL; DL=InstructionSet.regDL; BL=InstructionSet.regBL; SIL=InstructionSet.regSIL;
 	DIL=InstructionSet.regDIL; BPL=InstructionSet.regBPL; SPL=InstructionSet.regSPL;
 	DIL=InstructionSet.regDIL; BPL=InstructionSet.regBPL; SPL=InstructionSet.regSPL;
-	R8B=InstructionSet.regR8B; 	R9B=InstructionSet.regR9B; 	R10B=InstructionSet.regR10B; 	R11B=InstructionSet.regR11B;
-	R12B=InstructionSet.regR12B; 	R13B=InstructionSet.regR13B; 	R14B=InstructionSet.regR14B; 	R15B=InstructionSet.regR15B;
-	AH=InstructionSet.regAH;	CH=InstructionSet.regCH;	DH=InstructionSet.regDH;	BH=InstructionSet.regBH;
+	R8B=InstructionSet.regR8B; R9B=InstructionSet.regR9B; R10B=InstructionSet.regR10B; R11B=InstructionSet.regR11B;
+	R12B=InstructionSet.regR12B; R13B=InstructionSet.regR13B; R14B=InstructionSet.regR14B; R15B=InstructionSet.regR15B;
+	AH=InstructionSet.regAH; CH=InstructionSet.regCH; DH=InstructionSet.regDH; BH=InstructionSet.regBH;
 	ST0=InstructionSet.regST0;
 	ST0=InstructionSet.regST0;
 	XMM0 = InstructionSet.regXMM0;
 	XMM0 = InstructionSet.regXMM0;
 	XMM7 = InstructionSet.regXMM7;
 	XMM7 = InstructionSet.regXMM7;
@@ -41,12 +41,12 @@ CONST
 
 
 VAR registerOperands: ARRAY InstructionSet.numberRegisters OF Assembler.Operand;
 VAR registerOperands: ARRAY InstructionSet.numberRegisters OF Assembler.Operand;
 	usePool: BOOLEAN;
 	usePool: BOOLEAN;
-	 opEAX, opECX, opEDX, opEBX, opESP, opEBP,
-	 opESI, opEDI, opAX, opCX, opDX, opBX, opSI, opDI, opAL, opCL, opDL, opBL, opAH, opCH, opDH, opBH,opST0
-	 , opRSP, opRBP: Assembler.Operand;
+	opEAX, opECX, opEDX, opEBX, opESP, opEBP,
+	opESI, opEDI, opAX, opCX, opDX, opBX, opSI, opDI, opAL, opCL, opDL, opBL, opAH, opCH, opDH, opBH,opST0,
+	opRSP, opRBP: Assembler.Operand;
 
 
-	 unusable,split,blocked,free: CodeGenerators.Ticket;
-	 traceStackSize: LONGINT;
+	unusable,split,blocked,free: CodeGenerators.Ticket;
+	traceStackSize: LONGINT;
 
 
 TYPE
 TYPE
 
 
@@ -275,7 +275,7 @@ TYPE
 					(* ST7 unusable as it is overwritten during arithmetic instructions *)
 					(* ST7 unusable as it is overwritten during arithmetic instructions *)
 				ELSE
 				ELSE
 					i := GetHint(XMM0, XMM7);
 					i := GetHint(XMM0, XMM7);
-					IF i = none THEN 	i := Get(XMM7, XMM0) END
+					IF i = none THEN i := Get(XMM7, XMM0) END
 				END;
 				END;
 			END;
 			END;
 			hint := none; (* reset *)
 			hint := none; (* reset *)
@@ -429,7 +429,6 @@ TYPE
 				RETURN res
 				RETURN res
 			END GetGPHint;
 			END GetGPHint;
 
 
-
 			PROCEDURE Get(from,to: LONGINT): LONGINT;
 			PROCEDURE Get(from,to: LONGINT): LONGINT;
 			VAR i: LONGINT;
 			VAR i: LONGINT;
 			BEGIN
 			BEGIN
@@ -531,7 +530,7 @@ TYPE
 		sp=0>	FP0 - reg0								FP1 - reg0						sp=0>	FP0 - reg0
 		sp=0>	FP0 - reg0								FP1 - reg0						sp=0>	FP0 - reg0
 				FP1 - reg1								FP2 - reg1								FP1 - reg1
 				FP1 - reg1								FP2 - reg1								FP1 - reg1
 				FP2 - reg2								FP3 - reg2								FP2 - reg2
 				FP2 - reg2								FP3 - reg2								FP2 - reg2
-				FP3 - reg3	 = load op1 =>			FP4 - reg3		= op =>				FP3 - reg3
+				FP3 - reg3	= load op1 =>			FP4 - reg3		= op =>				FP3 - reg3
 				FP4 - reg4								FP5 - reg4								FP4 - reg4
 				FP4 - reg4								FP5 - reg4								FP4 - reg4
 				FP5 - reg5								FP6 - reg5								FP5 - reg5
 				FP5 - reg5								FP6 - reg5								FP5 - reg5
 				FP6 - reg6								FP7 - reg6								FP6 - reg6
 				FP6 - reg6								FP7 - reg6								FP6 - reg6
@@ -896,7 +895,6 @@ TYPE
 				RETURN (value <= MAX(SIGNED32)) & (value >= MIN(SIGNED32));
 				RETURN (value <= MAX(SIGNED32)) & (value >= MIN(SIGNED32));
 			END IsSignedImm32;
 			END IsSignedImm32;
 
 
-
 		BEGIN
 		BEGIN
 			ASSERT(virtual.mode = IntermediateCode.ModeImmediate);
 			ASSERT(virtual.mode = IntermediateCode.ModeImmediate);
 			GetPartType(virtual.type,part,type);
 			GetPartType(virtual.type,part,type);
@@ -1029,7 +1027,6 @@ TYPE
 			END;
 			END;
 		END GetRegister;
 		END GetRegister;
 
 
-
 		(* make physical operand from virtual operand, if ticket given then write result into phyiscal register represented by ticket *)
 		(* make physical operand from virtual operand, if ticket given then write result into phyiscal register represented by ticket *)
 		PROCEDURE MakeOperand(CONST vop: IntermediateCode.Operand; part: LONGINT; VAR op: Assembler.Operand; ticket: Ticket);
 		PROCEDURE MakeOperand(CONST vop: IntermediateCode.Operand; part: LONGINT; VAR op: Assembler.Operand; ticket: Ticket);
 		VAR tmp: Assembler.Operand;
 		VAR tmp: Assembler.Operand;
@@ -1724,7 +1721,6 @@ TYPE
 					Assembler.InitImm(imm, 0 ,0);
 					Assembler.InitImm(imm, 0 ,0);
 					emitter.Emit2(InstructionSet.opSBB, temp4, imm);
 					emitter.Emit2(InstructionSet.opSBB, temp4, imm);
 
 
-
 					IF dtype.sizeInBits # destType.sizeInBits THEN
 					IF dtype.sizeInBits # destType.sizeInBits THEN
 						index := temp4.register;
 						index := temp4.register;
 						CASE destType.sizeInBits OF (* choose low part accordingly *)
 						CASE destType.sizeInBits OF (* choose low part accordingly *)
@@ -2318,24 +2314,24 @@ TYPE
 				11 mod 3 = 2 (=11-9)
 				11 mod 3 = 2 (=11-9)
 
 
 			for negative a there are two definitions for mod possible:
 			for negative a there are two definitions for mod possible:
-				(i) 	mathematical definition with
+				(i) mathematical definition with
 					a mod b >= 0:
 					a mod b >= 0:
 					a mod b = min{ c >=0: c = a-i*b, integer i} >= 0
 					a mod b = min{ c >=0: c = a-i*b, integer i} >= 0
 					this corresponds with rounding down
 					this corresponds with rounding down
 					a div b = Entier(a/b) <= a/b
 					a div b = Entier(a/b) <= a/b
-		 		(ii) symmetric definition with
-		 			(-a) mod' b = -(a mod' b) and
-		 			(-a) div' b = -(a div' b)
-		 			corresponding with rounding to zero
-		 			a div' b = RoundToZero(a/b)
-
-		 	Examples
-		 		(i) -11 div 3 = -4  (3*(-4) = -12)
-		 			-11 mod 3 = 1 (=-11-(-12))
-		 		(ii) -11 div' 3 = -(11 div 3) = -3 (3*(-3)= -9)
-		 			-11 mod' 3 = -2 (=-11-(-9))
-
-		 	The behaviour for negative b can, in the symmetrical case, be deduced as
+				(ii) symmetric definition with
+					(-a) mod' b = -(a mod' b) and
+					(-a) div' b = -(a div' b)
+					corresponding with rounding to zero
+					a div' b = RoundToZero(a/b)
+
+			Examples
+				(i) -11 div 3 = -4  (3*(-4) = -12)
+					-11 mod 3 = 1 (=-11-(-12))
+				(ii) -11 div' 3 = -(11 div 3) = -3 (3*(-3)= -9)
+					-11 mod' 3 = -2 (=-11-(-9))
+
+			The behaviour for negative b can, in the symmetrical case, be deduced as
 				(ii)	symmetric definition
 				(ii)	symmetric definition
 					a div' (-b) = (-a) div' b = -(a div' b)
 					a div' (-b) = (-a) div' b = -(a div' b)
 					a mod' (-b) = a- a div' (-b) * (-b) = a mod' b
 					a mod' (-b) = a- a div' (-b) * (-b) = a mod' b
@@ -2364,8 +2360,6 @@ TYPE
 
 
 			*)
 			*)
 
 
-
-
 			(*
 			(*
 				AX / regMem8 = AL (remainder AH)
 				AX / regMem8 = AL (remainder AH)
 				DX:AX / regmem16 = AX (remainder DX)
 				DX:AX / regmem16 = AX (remainder DX)
@@ -2514,7 +2508,6 @@ TYPE
 				shift := opCL;
 				shift := opCL;
 			END;
 			END;
 
 
-
 			IF ~IsComplex(instruction.op1) THEN
 			IF ~IsComplex(instruction.op1) THEN
 				Move(dest,op2,PhysicalOperandType(dest));
 				Move(dest,op2,PhysicalOperandType(dest));
 				emitter.Emit2 (op, dest,shift);
 				emitter.Emit2 (op, dest,shift);
@@ -2607,7 +2600,6 @@ TYPE
 				rd := TemporaryTicket(IntermediateCode.GeneralPurposeRegister, type);
 				rd := TemporaryTicket(IntermediateCode.GeneralPurposeRegister, type);
 				TicketToOperand(rd,op3);
 				TicketToOperand(rd,op3);
 
 
-
 				Move(op3, op2, type);
 				Move(op3, op2, type);
 				Move(op1, op3, type);
 				Move(op1, op3, type);
 			ELSE
 			ELSE
@@ -2711,7 +2703,6 @@ TYPE
 			END;
 			END;
 		END EmitCopy;
 		END EmitCopy;
 
 
-
 		PROCEDURE EmitFill(CONST instruction: IntermediateCode.Instruction; down: BOOLEAN);
 		PROCEDURE EmitFill(CONST instruction: IntermediateCode.Instruction; down: BOOLEAN);
 		VAR reg,sizeInBits,i: LONGINT;val, value, size, dest: Assembler.Operand;
 		VAR reg,sizeInBits,i: LONGINT;val, value, size, dest: Assembler.Operand;
 			op: LONGINT;
 			op: LONGINT;
@@ -2874,7 +2865,6 @@ TYPE
 				emitter.Emit2(InstructionSet.opCMP,left,right);
 				emitter.Emit2(InstructionSet.opCMP,left,right);
 			END Cmp;
 			END Cmp;
 
 
-
 		BEGIN
 		BEGIN
 			IF (instruction.op1.symbol.name = in.name) & (instruction.op1.symbolOffset = inPC +1) THEN (* jump to next instruction can be ignored *)
 			IF (instruction.op1.symbol.name = in.name) & (instruction.op1.symbolOffset = inPC +1) THEN (* jump to next instruction can be ignored *)
 				IF dump # NIL THEN dump.String("jump to next instruction ignored"); dump.Ln END;
 				IF dump # NIL THEN dump.String("jump to next instruction ignored"); dump.Ln END;
@@ -3106,7 +3096,6 @@ TYPE
 			FinishOp(instruction.op1, Low, op, ticket);
 			FinishOp(instruction.op1, Low, op, ticket);
 		END EmitNegXMM;
 		END EmitNegXMM;
 
 
-
 		PROCEDURE EmitAbs(CONST instruction: IntermediateCode.Instruction);
 		PROCEDURE EmitAbs(CONST instruction: IntermediateCode.Instruction);
 		VAR op1,op2: Assembler.Operand; source,imm: Assembler.Operand; eax: Ticket;
 		VAR op1,op2: Assembler.Operand; source,imm: Assembler.Operand; eax: Ticket;
 		BEGIN
 		BEGIN
@@ -3421,8 +3410,8 @@ TYPE
 			procedure: SyntaxTree.Procedure;
 			procedure: SyntaxTree.Procedure;
 			i, j, initialSectionCount: LONGINT;
 			i, j, initialSectionCount: LONGINT;
 
 
-		 	(* recompute fixup positions and assign binary sections *)
-		 	PROCEDURE PatchFixups(section: BinaryCode.Section);
+			(* recompute fixup positions and assign binary sections *)
+			PROCEDURE PatchFixups(section: BinaryCode.Section);
 			VAR resolved: BinaryCode.Section; fixup: BinaryCode.Fixup; displacement,symbolOffset: LONGINT; in: IntermediateCode.Section;
 			VAR resolved: BinaryCode.Section; fixup: BinaryCode.Fixup; displacement,symbolOffset: LONGINT; in: IntermediateCode.Section;
 				symbol: Sections.Section;
 				symbol: Sections.Section;
 			BEGIN
 			BEGIN
@@ -3448,69 +3437,69 @@ TYPE
 			END PatchFixups;
 			END PatchFixups;
 
 
 		BEGIN
 		BEGIN
-		 	cg.SetModule(module);
+			cg.SetModule(module);
 
 
-		 	FOR i := 0 TO module.allSections.Length() - 1 DO
-			 	in := module.allSections.GetSection(i);
-		 		IF in.type = Sections.InlineCodeSection THEN
-		 			name := in.name;
-			 		out := ResolvedSection(in(IntermediateCode.Section));
-			 		cg.Section(in(IntermediateCode.Section),out);
-			 		procedure := in.symbol(SyntaxTree.Procedure);
-			 		IF procedure.procedureScope.body.code # NIL THEN
-				 		procedure.procedureScope.body.code.SetBinaryCode(out.os.bits);
-				 	END;
-			 	END
-		 	END;
+			FOR i := 0 TO module.allSections.Length() - 1 DO
+				in := module.allSections.GetSection(i);
+				IF in.type = Sections.InlineCodeSection THEN
+					name := in.name;
+					out := ResolvedSection(in(IntermediateCode.Section));
+					cg.Section(in(IntermediateCode.Section),out);
+					procedure := in.symbol(SyntaxTree.Procedure);
+					IF procedure.procedureScope.body.code # NIL THEN
+						procedure.procedureScope.body.code.SetBinaryCode(out.os.bits);
+					END;
+				END
+			END;
 
 
 			initialSectionCount := 0;
 			initialSectionCount := 0;
-		 	REPEAT
-		 		j := initialSectionCount;
-		 	 	initialSectionCount := module.allSections.Length() ;
-
-			 	FOR i := j TO initialSectionCount - 1 DO
-			 		in := module.allSections.GetSection(i);
-			 		IF (in.type # Sections.InlineCodeSection) & (in(IntermediateCode.Section).resolved = NIL) THEN
-			 			name := in.name;
-				 		out := ResolvedSection(in(IntermediateCode.Section));
-				 		cg.Section(in(IntermediateCode.Section),out);
-				 		IF out.os.type = Sections.VarSection THEN
-				 			IF out.pc = 1 THEN out.SetAlignment(FALSE,1)
-				 			ELSIF out.pc = 2 THEN out.SetAlignment(FALSE,2)
-				 			ELSIF (out.pc > 4) & (bits > 32) THEN out.SetAlignment(FALSE,8)
-				 			ELSIF (out.pc > 2) THEN out.SetAlignment(FALSE,4)
-				 			END;
-				 		ELSIF out.os.type = Sections.ConstSection THEN
-				 			out.SetAlignment(FALSE,bits DIV 8);
-				 		END;
-			 		END
-			 	END
+			REPEAT
+				j := initialSectionCount;
+				initialSectionCount := module.allSections.Length() ;
+
+				FOR i := j TO initialSectionCount - 1 DO
+					in := module.allSections.GetSection(i);
+					IF (in.type # Sections.InlineCodeSection) & (in(IntermediateCode.Section).resolved = NIL) THEN
+						name := in.name;
+						out := ResolvedSection(in(IntermediateCode.Section));
+						cg.Section(in(IntermediateCode.Section),out);
+						IF out.os.type = Sections.VarSection THEN
+							IF out.pc = 1 THEN out.SetAlignment(FALSE,1)
+							ELSIF out.pc = 2 THEN out.SetAlignment(FALSE,2)
+							ELSIF (out.pc > 4) & (bits > 32) THEN out.SetAlignment(FALSE,8)
+							ELSIF (out.pc > 2) THEN out.SetAlignment(FALSE,4)
+							END;
+						ELSIF out.os.type = Sections.ConstSection THEN
+							out.SetAlignment(FALSE,bits DIV 8);
+						END;
+					END
+				END
 			UNTIL initialSectionCount = module.allSections.Length(); (* process remaining sections that have been added during traversal of sections *)
 			UNTIL initialSectionCount = module.allSections.Length(); (* process remaining sections that have been added during traversal of sections *)
 
 
 			(*
 			(*
 			FOR i := 0 TO module.allSections.Length() - 1 DO
 			FOR i := 0 TO module.allSections.Length() - 1 DO
 				in := module.allSections.GetSection(i);
 				in := module.allSections.GetSection(i);
 				IF in.kind = Sections.CaseTableKind THEN
 				IF in.kind = Sections.CaseTableKind THEN
-			 		IF in(IntermediateCode.Section).resolved = NIL THEN
-				 		out := ResolvedSection(in(IntermediateCode.Section));
-				 		cg.Section(in(IntermediateCode.Section),out);
-				 	END
-				 END
-		 	END;
+					IF in(IntermediateCode.Section).resolved = NIL THEN
+						out := ResolvedSection(in(IntermediateCode.Section));
+						cg.Section(in(IntermediateCode.Section),out);
+					END
+				END
+			END;
 			*)
 			*)
 
 
 			FOR i := 0 TO module.allSections.Length() - 1 DO
 			FOR i := 0 TO module.allSections.Length() - 1 DO
 				in := module.allSections.GetSection(i);
 				in := module.allSections.GetSection(i);
-		 		PatchFixups(in(IntermediateCode.Section).resolved)
-		 	END;
+				PatchFixups(in(IntermediateCode.Section).resolved)
+			END;
 
 
 			(*
 			(*
 			FOR i := 0 TO module.allSections.Length() - 1 DO
 			FOR i := 0 TO module.allSections.Length() - 1 DO
 				in := module.allSections.GetSection(i);
 				in := module.allSections.GetSection(i);
 				IF in.kind = Sections.CaseTableKind THEN
 				IF in.kind = Sections.CaseTableKind THEN
-			 		PatchFixups(in(IntermediateCode.Section).resolved)
-			 	END
-		 	END;
+					PatchFixups(in(IntermediateCode.Section).resolved)
+				END
+			END;
 			*)
 			*)
 
 
 			IF cg.error THEN Error("",Basic.invalidPosition, Streams.Invalid,"") END;
 			IF cg.error THEN Error("",Basic.invalidPosition, Streams.Invalid,"") END;
@@ -3598,7 +3587,6 @@ TYPE
 			RETURN b
 			RETURN b
 		END CanPassInRegister;
 		END CanPassInRegister;
 
 
-
 		PROCEDURE GetDescription*(VAR instructionSet: ARRAY OF CHAR);
 		PROCEDURE GetDescription*(VAR instructionSet: ARRAY OF CHAR);
 		BEGIN instructionSet := "AMD";
 		BEGIN instructionSet := "AMD";
 		END GetDescription;
 		END GetDescription;
@@ -3724,5 +3712,4 @@ BEGIN
 	usePool := Machine.NumberOfProcessors()>1;
 	usePool := Machine.NumberOfProcessors()>1;
 END FoxAMDBackend.
 END FoxAMDBackend.
 
 
-
 System.FreeDownTo FoxAMDBackend ~
 System.FreeDownTo FoxAMDBackend ~

+ 0 - 2
source/FoxARMAssembler.Mod

@@ -52,7 +52,6 @@ TYPE
 			RETURN FALSE;
 			RETURN FALSE;
 		END GetRegisterList;
 		END GetRegisterList;
 
 
-
 		(** parse a special register name, along with fields **)
 		(** parse a special register name, along with fields **)
 		PROCEDURE GetSpecialRegisterWithFields(VAR registerNumber: LONGINT; VAR fields: SET): BOOLEAN;
 		PROCEDURE GetSpecialRegisterWithFields(VAR registerNumber: LONGINT; VAR fields: SET): BOOLEAN;
 		VAR
 		VAR
@@ -377,7 +376,6 @@ TYPE
 					D.String("    flags="); D.Set(flags); D.Ln;
 					D.String("    flags="); D.Set(flags); D.Ln;
 				END;*)
 				END;*)
 
 
-
 				FOR i := 0 TO InstructionSet.MaxOperands - 1 DO
 				FOR i := 0 TO InstructionSet.MaxOperands - 1 DO
 					InstructionSet.InitOperand(operands[i])
 					InstructionSet.InitOperand(operands[i])
 				END;
 				END;

+ 76 - 92
source/FoxARMBackend.Mod

@@ -136,7 +136,6 @@ TYPE
 			HALT(100);
 			HALT(100);
 		END Emit;
 		END Emit;
 
 
-
 		PROCEDURE AddCitation(pc: LONGINT; bits: LONGINT; shift: LONGINT);
 		PROCEDURE AddCitation(pc: LONGINT; bits: LONGINT; shift: LONGINT);
 		VAR
 		VAR
 			citation: Citation;
 			citation: Citation;
@@ -548,8 +547,6 @@ TYPE
 
 
 		inStackAllocation: BOOLEAN;
 		inStackAllocation: BOOLEAN;
 
 
-
-
 		PROCEDURE & InitGeneratorARM(CONST builtinsModuleName: SyntaxTree.IdentifierString; diagnostics: Diagnostics.Diagnostics; backend: BackendARM);
 		PROCEDURE & InitGeneratorARM(CONST builtinsModuleName: SyntaxTree.IdentifierString; diagnostics: Diagnostics.Diagnostics; backend: BackendARM);
 		VAR
 		VAR
 			physicalRegisters: PhysicalRegisters;
 			physicalRegisters: PhysicalRegisters;
@@ -580,7 +577,6 @@ TYPE
 
 
 			NEW(listOfReferences);
 			NEW(listOfReferences);
 
 
-
 		END InitGeneratorARM;
 		END InitGeneratorARM;
 
 
 		(*------------------- overwritten methods ----------------------*)
 		(*------------------- overwritten methods ----------------------*)
@@ -748,7 +744,6 @@ TYPE
 			(* emit the instruction *)
 			(* emit the instruction *)
 			InstructionSet.Emit(opCode, condition, flags, operands, out);
 			InstructionSet.Emit(opCode, condition, flags, operands, out);
 
 
-
 		END Emit;
 		END Emit;
 
 
 		(** emit an ARM instruction with no operand **)
 		(** emit an ARM instruction with no operand **)
@@ -1398,7 +1393,6 @@ TYPE
 			RETURN irOperand.type.form = IntermediateCode.Float
 			RETURN irOperand.type.form = IntermediateCode.Float
 		END IsFloat;
 		END IsFloat;
 
 
-
 		(** whether an IR operand hold am integer value **)
 		(** whether an IR operand hold am integer value **)
 		PROCEDURE IsInteger(CONST irOperand: IntermediateCode.Operand): BOOLEAN;
 		PROCEDURE IsInteger(CONST irOperand: IntermediateCode.Operand): BOOLEAN;
 		BEGIN RETURN irOperand.type.form IN IntermediateCode.Integer
 		BEGIN RETURN irOperand.type.form IN IntermediateCode.Integer
@@ -1580,8 +1574,8 @@ TYPE
 		END EmitFinalFixupBlock;
 		END EmitFinalFixupBlock;
 
 
 		(* if needed, emit fixup block for all used symbol references
 		(* if needed, emit fixup block for all used symbol references
-		 - the fixup block is skipped by a branch instruction
-		 - afterwards, the list of references is cleared
+			- the fixup block is skipped by a branch instruction
+			- afterwards, the list of references is cleared
 		*)
 		*)
 		PROCEDURE EmitFixupBlockIfNeeded;
 		PROCEDURE EmitFixupBlockIfNeeded;
 		BEGIN
 		BEGIN
@@ -1927,7 +1921,6 @@ TYPE
 			IF (op.symbol.name # "") & (op.resolved = NIL) THEN op.resolved := module.allSections.FindByName(op.symbol.name) END
 			IF (op.symbol.name # "") & (op.resolved = NIL) THEN op.resolved := module.allSections.FindByName(op.symbol.name) END
 		END Resolve;
 		END Resolve;
 
 
-
 		(* call <address>, <parSize> *)
 		(* call <address>, <parSize> *)
 		PROCEDURE EmitCall(VAR irInstruction: IntermediateCode.Instruction);
 		PROCEDURE EmitCall(VAR irInstruction: IntermediateCode.Instruction);
 		VAR
 		VAR
@@ -2217,7 +2210,6 @@ TYPE
 				RETURN;
 				RETURN;
 			END;
 			END;
 
 
-
 			IF IsSinglePrecisionFloat(irInstruction.op1) THEN
 			IF IsSinglePrecisionFloat(irInstruction.op1) THEN
 				ASSERT(backend.useFPU32);
 				ASSERT(backend.useFPU32);
 				PrepareDoubleSourceOp(irInstruction, Low, destination[Low], left[Low], right[Low]);
 				PrepareDoubleSourceOp(irInstruction, Low, destination[Low], left[Low], right[Low]);
@@ -2265,7 +2257,6 @@ TYPE
 				RETURN;
 				RETURN;
 			END;
 			END;
 
 
-
 			IF IsSinglePrecisionFloat(irInstruction.op1) THEN
 			IF IsSinglePrecisionFloat(irInstruction.op1) THEN
 				ASSERT(backend.useFPU32);
 				ASSERT(backend.useFPU32);
 				PrepareDoubleSourceOp(irInstruction, Low, destination, left, right);
 				PrepareDoubleSourceOp(irInstruction, Low, destination, left, right);
@@ -2281,16 +2272,16 @@ TYPE
 				PrepareDoubleSourceOp(irInstruction, Low, destination, left, right);
 				PrepareDoubleSourceOp(irInstruction, Low, destination, left, right);
 				(* left and right operands to double *)
 				(* left and right operands to double *)
 				float := GetFreeRegister(IntermediateCode.FloatType(32));
 				float := GetFreeRegister(IntermediateCode.FloatType(32));
-		 		Emit2(opFMSR, float, left);
+				Emit2(opFMSR, float, left);
 				leftd := GetFreeRegister(IntermediateCode.FloatType(64));
 				leftd := GetFreeRegister(IntermediateCode.FloatType(64));
-	 			IF irInstruction.op1.type.form = IntermediateCode.UnsignedInteger THEN
+				IF irInstruction.op1.type.form = IntermediateCode.UnsignedInteger THEN
 					Emit2(opFUITOD, leftd, float)
 					Emit2(opFUITOD, leftd, float)
 				ELSE
 				ELSE
 					Emit2(opFSITOD,leftd, float)
 					Emit2(opFSITOD,leftd, float)
 				END;
 				END;
-		 		Emit2(opFMSR, float,right);
+				Emit2(opFMSR, float,right);
 				rightd := GetFreeRegister(IntermediateCode.FloatType(64));
 				rightd := GetFreeRegister(IntermediateCode.FloatType(64));
-	 			IF irInstruction.op1.type.form = IntermediateCode.UnsignedInteger THEN
+				IF irInstruction.op1.type.form = IntermediateCode.UnsignedInteger THEN
 					Emit2(opFUITOD, rightd, float)
 					Emit2(opFUITOD, rightd, float)
 				ELSE
 				ELSE
 					Emit2(opFSITOD,rightd, float)
 					Emit2(opFSITOD,rightd, float)
@@ -2299,13 +2290,13 @@ TYPE
 				Emit3(opFDIVD, leftd, leftd, rightd);
 				Emit3(opFDIVD, leftd, leftd, rightd);
 				(* result to destination *)
 				(* result to destination *)
 				RoundDown(fpstatus);
 				RoundDown(fpstatus);
-	 			IF irInstruction.op1.type.form = IntermediateCode.UnsignedInteger THEN
+				IF irInstruction.op1.type.form = IntermediateCode.UnsignedInteger THEN
 					Emit2(opFTOUID, float, leftd)
 					Emit2(opFTOUID, float, leftd)
 				ELSE
 				ELSE
 					Emit2(opFTOSID, float, leftd)
 					Emit2(opFTOSID, float, leftd)
 				END;
 				END;
 				ResetRounding(fpstatus);
 				ResetRounding(fpstatus);
-		 		Emit2(opFMRS, destination, float);
+				Emit2(opFMRS, destination, float);
 				WriteBack(irInstruction.op1, Low, destination)
 				WriteBack(irInstruction.op1, Low, destination)
 			ELSE
 			ELSE
 				HALT(200)
 				HALT(200)
@@ -2985,7 +2976,6 @@ TYPE
 							right[Low] := RegisterFromIrOperand(irRight, Low, emptyOperand);
 							right[Low] := RegisterFromIrOperand(irRight, Low, emptyOperand);
 							Cmp(left[Low], right[Low], FALSE);
 							Cmp(left[Low], right[Low], FALSE);
 
 
-
 						ELSE
 						ELSE
 							HALT(100)
 							HALT(100)
 						END
 						END
@@ -3097,7 +3087,6 @@ TYPE
 				failFixup.resolved := in;
 				failFixup.resolved := in;
 			END;
 			END;
 
 
-
 		END EmitBr;
 		END EmitBr;
 
 
 		PROCEDURE RoundDown(VAR fpstatus: Operand);
 		PROCEDURE RoundDown(VAR fpstatus: Operand);
@@ -3116,7 +3105,6 @@ TYPE
 			Emit2(InstructionSet.opVMSR, fpscr, fpstatus);
 			Emit2(InstructionSet.opVMSR, fpscr, fpstatus);
 		END ResetRounding;
 		END ResetRounding;
 
 
-
 		PROCEDURE EmitConv(VAR irInstruction: IntermediateCode.Instruction);
 		PROCEDURE EmitConv(VAR irInstruction: IntermediateCode.Instruction);
 		VAR
 		VAR
 			irDestination, irSource: IntermediateCode.Operand;
 			irDestination, irSource: IntermediateCode.Operand;
@@ -3124,7 +3112,6 @@ TYPE
 			temp, fpstatus: Operand;
 			temp, fpstatus: Operand;
 			partType: IntermediateCode.Type;
 			partType: IntermediateCode.Type;
 
 
-
 		BEGIN
 		BEGIN
 			irDestination := irInstruction.op1; irSource := irInstruction.op2;
 			irDestination := irInstruction.op1; irSource := irInstruction.op2;
 
 
@@ -3207,52 +3194,52 @@ TYPE
 				END
 				END
 			ELSIF IsSinglePrecisionFloat(irDestination) THEN
 			ELSIF IsSinglePrecisionFloat(irDestination) THEN
 				(* to single precision float: *)
 				(* to single precision float: *)
-			 	IF IsInteger(irSource) THEN
+				IF IsInteger(irSource) THEN
 					ASSERT(~IsComplex(irSource));
 					ASSERT(~IsComplex(irSource));
-			 		(* integer to single precision float: ignore high part of source *)
-			 		temp := GetFreeRegister(IntermediateCode.FloatType(32));
-			 		Emit2(opFMSR, temp, source[Low]);
-		 			IF irSource.type.form = IntermediateCode.UnsignedInteger THEN
+					(* integer to single precision float: ignore high part of source *)
+					temp := GetFreeRegister(IntermediateCode.FloatType(32));
+					Emit2(opFMSR, temp, source[Low]);
+					IF irSource.type.form = IntermediateCode.UnsignedInteger THEN
 						(* non-complex unsigned integer to single precision float: *)
 						(* non-complex unsigned integer to single precision float: *)
 						Emit2(opFUITOS, destination[Low], temp)
 						Emit2(opFUITOS, destination[Low], temp)
 					ELSE
 					ELSE
 						(* non-complex signed integer to single precision float: *)
 						(* non-complex signed integer to single precision float: *)
 						Emit2(opFSITOS, destination[Low], temp)
 						Emit2(opFSITOS, destination[Low], temp)
 					END
 					END
-			 	ELSIF IsSinglePrecisionFloat(irSource) THEN
-			 		(* single precision float to single precision float: *)
-			 		MovIfDifferent(destination[Low], source[Low])
-			 	ELSIF IsDoublePrecisionFloat(irSource) THEN
-			 		(* LONGREAL --> REAL *)
-			 		Emit2(opFCVTSD, destination[Low], source[Low])
-			 	ELSE
-			 		(* anything else to single precision float: *)
-			 		HALT(200)
-			 	END
+				ELSIF IsSinglePrecisionFloat(irSource) THEN
+					(* single precision float to single precision float: *)
+					MovIfDifferent(destination[Low], source[Low])
+				ELSIF IsDoublePrecisionFloat(irSource) THEN
+					(* LONGREAL --> REAL *)
+					Emit2(opFCVTSD, destination[Low], source[Low])
+				ELSE
+					(* anything else to single precision float: *)
+					HALT(200)
+				END
 			ELSIF IsDoublePrecisionFloat(irDestination) THEN
 			ELSIF IsDoublePrecisionFloat(irDestination) THEN
 				(* to double precision float: *)
 				(* to double precision float: *)
-			 	IF IsInteger(irSource) THEN
+				IF IsInteger(irSource) THEN
 					ASSERT(~IsComplex(irSource));
 					ASSERT(~IsComplex(irSource));
-			 		(* integer to double precision float: ignore high part of source *)
-			 		temp := GetFreeRegister(IntermediateCode.FloatType(32));
-			 		Emit2(opFMSR, temp, source[Low]);
-		 			IF irSource.type.form = IntermediateCode.UnsignedInteger THEN
+					(* integer to double precision float: ignore high part of source *)
+					temp := GetFreeRegister(IntermediateCode.FloatType(32));
+					Emit2(opFMSR, temp, source[Low]);
+					IF irSource.type.form = IntermediateCode.UnsignedInteger THEN
 						(* non-complex unsigned integer to double precision float: *)
 						(* non-complex unsigned integer to double precision float: *)
 						Emit2(opFUITOD, destination[Low], temp)
 						Emit2(opFUITOD, destination[Low], temp)
 					ELSE
 					ELSE
 						(* non-complex signed integer to double precision float: *)
 						(* non-complex signed integer to double precision float: *)
 						Emit2(opFSITOD, destination[Low], temp)
 						Emit2(opFSITOD, destination[Low], temp)
 					END
 					END
-			 	ELSIF IsSinglePrecisionFloat(irSource) THEN
-			 		(* REAL --> LONGREAL *)
-			 		Emit2(opFCVTDS, destination[Low], source[Low])
-			 	ELSIF IsDoublePrecisionFloat(irSource) THEN
-			 		(* single precision float to single precision float: *)
-			 		MovIfDifferent(destination[Low], source[Low])
-			 	ELSE
-			 		(* anything else to single precision float: *)
-			 		HALT(200)
-			 	END
+				ELSIF IsSinglePrecisionFloat(irSource) THEN
+					(* REAL --> LONGREAL *)
+					Emit2(opFCVTDS, destination[Low], source[Low])
+				ELSIF IsDoublePrecisionFloat(irSource) THEN
+					(* single precision float to single precision float: *)
+					MovIfDifferent(destination[Low], source[Low])
+				ELSE
+					(* anything else to single precision float: *)
+					HALT(200)
+				END
 			ELSE
 			ELSE
 				(* to anything else: *)
 				(* to anything else: *)
 				HALT(200)
 				HALT(200)
@@ -3634,11 +3621,8 @@ TYPE
 			procedure: SyntaxTree.Procedure;
 			procedure: SyntaxTree.Procedure;
 			i, j, initialSectionCount: LONGINT;
 			i, j, initialSectionCount: LONGINT;
 
 
-
-
-
-		 	(* recompute fixup positions and assign binary sections *)
-		 	PROCEDURE PatchFixups(section: BinaryCode.Section);
+			(* recompute fixup positions and assign binary sections *)
+			PROCEDURE PatchFixups(section: BinaryCode.Section);
 			VAR resolved: BinaryCode.Section; fixup: BinaryCode.Fixup; displacement,symbolOffset: LONGINT; in: IntermediateCode.Section;
 			VAR resolved: BinaryCode.Section; fixup: BinaryCode.Fixup; displacement,symbolOffset: LONGINT; in: IntermediateCode.Section;
 				symbol: Sections.Section;
 				symbol: Sections.Section;
 			BEGIN
 			BEGIN
@@ -3669,8 +3653,8 @@ TYPE
 				IF (fixup.symbol.name # "") & (fixup.resolved = NIL) THEN fixup.resolved := module.allSections.FindByName(fixup.symbol.name) END;
 				IF (fixup.symbol.name # "") & (fixup.resolved = NIL) THEN fixup.resolved := module.allSections.FindByName(fixup.symbol.name) END;
 			END Resolve;
 			END Resolve;
 
 
-		 	(* recompute fixup positions and assign binary sections *)
-		 	PROCEDURE PatchFixups(section: BinaryCode.Section);
+			(* recompute fixup positions and assign binary sections *)
+			PROCEDURE PatchFixups(section: BinaryCode.Section);
 			VAR resolved: BinaryCode.Section; fixup: BinaryCode.Fixup; symbolOffset, offsetWithinSection: LONGINT; in: IntermediateCode.Section;
 			VAR resolved: BinaryCode.Section; fixup: BinaryCode.Fixup; symbolOffset, offsetWithinSection: LONGINT; in: IntermediateCode.Section;
 			BEGIN
 			BEGIN
 				fixup := section.fixupList.firstFixup;
 				fixup := section.fixupList.firstFixup;
@@ -3706,45 +3690,45 @@ TYPE
 			*)
 			*)
 
 
 		BEGIN
 		BEGIN
-		 	cg.SetModule(module);
-		 	cg.dump := dump;
+			cg.SetModule(module);
+			cg.dump := dump;
 
 
-		 	FOR i := 0 TO module.allSections.Length() - 1 DO
-			 	in := module.allSections.GetSection(i);
-		 		IF in.type = Sections.InlineCodeSection THEN
-		 			Basic.SegmentedNameToString(in.name, name);
-			 		out := ResolvedSection(in(IntermediateCode.Section));
-			 		cg.dump := out.comments;
-			 		cg.Section(in(IntermediateCode.Section), out);
-			 		IF in.symbol # NIL THEN
-				 		procedure := in.symbol(SyntaxTree.Procedure);
-				 		procedure.procedureScope.body.code.SetBinaryCode(out.os.bits);
-				 	END;
-			 	END
-		 	END;
+			FOR i := 0 TO module.allSections.Length() - 1 DO
+				in := module.allSections.GetSection(i);
+				IF in.type = Sections.InlineCodeSection THEN
+					Basic.SegmentedNameToString(in.name, name);
+					out := ResolvedSection(in(IntermediateCode.Section));
+					cg.dump := out.comments;
+					cg.Section(in(IntermediateCode.Section), out);
+					IF in.symbol # NIL THEN
+						procedure := in.symbol(SyntaxTree.Procedure);
+						procedure.procedureScope.body.code.SetBinaryCode(out.os.bits);
+					END;
+				END
+			END;
 
 
 			initialSectionCount := 0;
 			initialSectionCount := 0;
-		 	REPEAT
-		 		j := initialSectionCount;
-		 	 	initialSectionCount := module.allSections.Length() ;
-
-			 	FOR i := j TO initialSectionCount - 1 DO
-			 		in := module.allSections.GetSection(i);
-		 			Basic.SegmentedNameToString(in.name, name);
-
-			 		IF (in.type # Sections.InlineCodeSection) (*& (in(IntermediateCode.Section).resolved = NIL) *) THEN
-				 		out := ResolvedSection(in(IntermediateCode.Section));
-				 		cg.Section(in(IntermediateCode.Section),out);
-			 		END
-			 	END
+			REPEAT
+				j := initialSectionCount;
+				initialSectionCount := module.allSections.Length() ;
+
+				FOR i := j TO initialSectionCount - 1 DO
+					in := module.allSections.GetSection(i);
+					Basic.SegmentedNameToString(in.name, name);
+
+					IF (in.type # Sections.InlineCodeSection) (*& (in(IntermediateCode.Section).resolved = NIL) *) THEN
+						out := ResolvedSection(in(IntermediateCode.Section));
+						cg.Section(in(IntermediateCode.Section),out);
+					END
+				END
 			UNTIL initialSectionCount = module.allSections.Length(); (* process remaining sections that have been added during traversal of sections *)
 			UNTIL initialSectionCount = module.allSections.Length(); (* process remaining sections that have been added during traversal of sections *)
 
 
-		 	FOR i := 0 TO module.allSections.Length() - 1 DO
-			 	in := module.allSections.GetSection(i);
-	 			Basic.SegmentedNameToString(in.name, name);
-			 	in := module.allSections.GetSection(i);
-		 		PatchFixups(in(IntermediateCode.Section).resolved)
-		 	END;
+			FOR i := 0 TO module.allSections.Length() - 1 DO
+				in := module.allSections.GetSection(i);
+				Basic.SegmentedNameToString(in.name, name);
+				in := module.allSections.GetSection(i);
+				PatchFixups(in(IntermediateCode.Section).resolved)
+			END;
 
 
 			IF cg.error THEN Error("", Basic.invalidPosition, Streams.Invalid,  "") END
 			IF cg.error THEN Error("", Basic.invalidPosition, Streams.Invalid,  "") END
 		END GenerateBinary;
 		END GenerateBinary;

+ 129 - 137
source/FoxARMInstructionSet.Mod

@@ -721,11 +721,10 @@ CONST
 			END;
 			END;
 		END OperandMatches;
 		END OperandMatches;
 
 
-
 		PROCEDURE Matches(CONST format: InstructionFormat): BOOLEAN;
 		PROCEDURE Matches(CONST format: InstructionFormat): BOOLEAN;
 		VAR i: LONGINT;
 		VAR i: LONGINT;
 		BEGIN
 		BEGIN
-			IF mnemonic # format.mnemonic THEN 	RETURN FALSE END; (* different mnemonic *)
+			IF mnemonic # format.mnemonic THEN RETURN FALSE END; (* different mnemonic *)
 			IF (instruction.condition # conditionAL) & (instruction.condition # None) & ~(flagCondition IN format.flags) THEN (* not always case for encoding problems of BLX which comes in two forms *)
 			IF (instruction.condition # conditionAL) & (instruction.condition # None) & ~(flagCondition IN format.flags) THEN (* not always case for encoding problems of BLX which comes in two forms *)
 				RETURN FALSE END; (* unpermitted condition *)
 				RETURN FALSE END; (* unpermitted condition *)
 			IF instruction.flags * format.flags # instruction.flags THEN
 			IF instruction.flags * format.flags # instruction.flags THEN
@@ -767,8 +766,6 @@ CONST
 			END
 			END
 		END;
 		END;
 
 
-
-
 		RETURN result
 		RETURN result
 	END MakeInstruction;
 	END MakeInstruction;
 
 
@@ -837,7 +834,6 @@ CONST
 		RETURN rot <16
 		RETURN rot <16
 	END EncodeImmediate;
 	END EncodeImmediate;
 
 
-
 	PROCEDURE Encode(CONST instruction: Instruction; VAR code: LONGINT): BOOLEAN;
 	PROCEDURE Encode(CONST instruction: Instruction; VAR code: LONGINT): BOOLEAN;
 	VAR
 	VAR
 		format: InstructionFormat; codeSet: SET; i: LONGINT; error: BOOLEAN;
 		format: InstructionFormat; codeSet: SET; i: LONGINT; error: BOOLEAN;
@@ -964,7 +960,6 @@ CONST
 			END
 			END
 		END CheckImmediateShifts;
 		END CheckImmediateShifts;
 
 
-
 		PROCEDURE EncodeOperand(operandEncoding: LONGINT; CONST operand: Operand);
 		PROCEDURE EncodeOperand(operandEncoding: LONGINT; CONST operand: Operand);
 		VAR
 		VAR
 			imm, rot, firstRegister, num, shiftMode, shiftImmediate: LONGINT;
 			imm, rot, firstRegister, num, shiftMode, shiftImmediate: LONGINT;
@@ -1223,24 +1218,24 @@ CONST
 					ELSIF (operand.register < QR0) OR (operand.register > QR15) THEN error := TRUE
 					ELSIF (operand.register < QR0) OR (operand.register > QR15) THEN error := TRUE
 					END;
 					END;
 					CASE operandEncoding OF
 					CASE operandEncoding OF
-						 encodingNEONQd:
-						 	NEONRegisterPos[0] := 13;
-						 	NEONRegisterPos[1] := 14;
-						 	NEONRegisterPos[2] := 15;
-						 	NEONRegisterPos[3] := 22;
+						|encodingNEONQd:
+							NEONRegisterPos[0] := 13;
+							NEONRegisterPos[1] := 14;
+							NEONRegisterPos[2] := 15;
+							NEONRegisterPos[3] := 22;
 						|encodingNEONQm:
 						|encodingNEONQm:
-						 	NEONRegisterPos[0] := 1;
-						 	NEONRegisterPos[1] := 2;
-						 	NEONRegisterPos[2] := 3;
-						 	NEONRegisterPos[3] := 5;
+							NEONRegisterPos[0] := 1;
+							NEONRegisterPos[1] := 2;
+							NEONRegisterPos[2] := 3;
+							NEONRegisterPos[3] := 5;
 						|encodingNEONQn:
 						|encodingNEONQn:
-						 	NEONRegisterPos[0] := 17;
-						 	NEONRegisterPos[1] := 18;
-						 	NEONRegisterPos[2] := 19;
-						 	NEONRegisterPos[3] := 7;
+							NEONRegisterPos[0] := 17;
+							NEONRegisterPos[1] := 18;
+							NEONRegisterPos[2] := 19;
+							NEONRegisterPos[3] := 7;
 					END;
 					END;
-				 	NEONRegisterPos[4] := 32; (* end of encoding *)
-				 	SplittedUnsigned(operand.register - QR0, NEONRegisterPos)
+					NEONRegisterPos[4] := 32; (* end of encoding *)
+					SplittedUnsigned(operand.register - QR0, NEONRegisterPos)
 
 
 				|encodingNEONDd, encodingNEONDm, encodingNEONDn:
 				|encodingNEONDd, encodingNEONDm, encodingNEONDn:
 					IF operand.mode # modeRegister THEN error := TRUE
 					IF operand.mode # modeRegister THEN error := TRUE
@@ -1248,26 +1243,26 @@ CONST
 					ELSIF (operand.register < DR0) OR (operand.register > DR31) THEN error := TRUE
 					ELSIF (operand.register < DR0) OR (operand.register > DR31) THEN error := TRUE
 					END;
 					END;
 					CASE operandEncoding OF
 					CASE operandEncoding OF
-						 encodingNEONDd:
-						 	NEONRegisterPos[0] := 12;
-						 	NEONRegisterPos[1] := 13;
-						 	NEONRegisterPos[2] := 14;
-						 	NEONRegisterPos[3] := 15;
-						 	NEONRegisterPos[4] := 22;
+						|encodingNEONDd:
+							NEONRegisterPos[0] := 12;
+							NEONRegisterPos[1] := 13;
+							NEONRegisterPos[2] := 14;
+							NEONRegisterPos[3] := 15;
+							NEONRegisterPos[4] := 22;
 						|encodingNEONDm:
 						|encodingNEONDm:
-						 	NEONRegisterPos[0] := 0;
-						 	NEONRegisterPos[1] := 1;
-						 	NEONRegisterPos[2] := 2;
-						 	NEONRegisterPos[3] := 3;
-						 	NEONRegisterPos[4] := 5;
+							NEONRegisterPos[0] := 0;
+							NEONRegisterPos[1] := 1;
+							NEONRegisterPos[2] := 2;
+							NEONRegisterPos[3] := 3;
+							NEONRegisterPos[4] := 5;
 						|encodingNEONDn:
 						|encodingNEONDn:
-						 	NEONRegisterPos[0] := 16;
-						 	NEONRegisterPos[1] := 17;
-						 	NEONRegisterPos[2] := 18;
-						 	NEONRegisterPos[3] := 19;
-						 	NEONRegisterPos[4] := 7;
+							NEONRegisterPos[0] := 16;
+							NEONRegisterPos[1] := 17;
+							NEONRegisterPos[2] := 18;
+							NEONRegisterPos[3] := 19;
+							NEONRegisterPos[4] := 7;
 					END;
 					END;
-				 	SplittedUnsigned(operand.register - DR0, NEONRegisterPos)
+					SplittedUnsigned(operand.register - DR0, NEONRegisterPos)
 
 
 				|encodingNEONSd, encodingNEONSm, encodingNEONSn:
 				|encodingNEONSd, encodingNEONSm, encodingNEONSn:
 					IF operand.mode # modeRegister THEN error := TRUE
 					IF operand.mode # modeRegister THEN error := TRUE
@@ -1275,69 +1270,69 @@ CONST
 					ELSIF (operand.register < SR0) OR (operand.register > SR31) THEN error := TRUE
 					ELSIF (operand.register < SR0) OR (operand.register > SR31) THEN error := TRUE
 					END;
 					END;
 					CASE operandEncoding OF
 					CASE operandEncoding OF
-						 encodingNEONSd:
-						 	NEONRegisterPos[0] := 22;
-						 	NEONRegisterPos[1] := 12;
-						 	NEONRegisterPos[2] := 13;
-						 	NEONRegisterPos[3] := 14;
-						 	NEONRegisterPos[4] := 15;
+						|encodingNEONSd:
+							NEONRegisterPos[0] := 22;
+							NEONRegisterPos[1] := 12;
+							NEONRegisterPos[2] := 13;
+							NEONRegisterPos[3] := 14;
+							NEONRegisterPos[4] := 15;
 						|encodingNEONSm:
 						|encodingNEONSm:
-						 	NEONRegisterPos[0] := 5;
-						 	NEONRegisterPos[1] := 0;
-						 	NEONRegisterPos[2] := 1;
-						 	NEONRegisterPos[3] := 2;
-						 	NEONRegisterPos[4] := 3;
+							NEONRegisterPos[0] := 5;
+							NEONRegisterPos[1] := 0;
+							NEONRegisterPos[2] := 1;
+							NEONRegisterPos[3] := 2;
+							NEONRegisterPos[4] := 3;
 						|encodingNEONSn:
 						|encodingNEONSn:
-						 	NEONRegisterPos[0] := 7;
-						 	NEONRegisterPos[1] := 16;
-						 	NEONRegisterPos[2] := 17;
-						 	NEONRegisterPos[3] := 18;
-						 	NEONRegisterPos[4] := 19;
+							NEONRegisterPos[0] := 7;
+							NEONRegisterPos[1] := 16;
+							NEONRegisterPos[2] := 17;
+							NEONRegisterPos[3] := 18;
+							NEONRegisterPos[4] := 19;
 					END;
 					END;
-				 	SplittedUnsigned(operand.register - SR0, NEONRegisterPos)
+					SplittedUnsigned(operand.register - SR0, NEONRegisterPos)
 
 
 				|encodingNEONQorDd, encodingNEONQorDm, encodingNEONQorDn:
 				|encodingNEONQorDd, encodingNEONQorDm, encodingNEONQorDn:
 					IF operand.mode # modeRegister THEN error := TRUE
 					IF operand.mode # modeRegister THEN error := TRUE
 					ELSIF operand.shiftMode # None THEN error := TRUE
 					ELSIF operand.shiftMode # None THEN error := TRUE
 					ELSIF (DR0 <= operand.register) & (operand.register <= DR31) THEN
 					ELSIF (DR0 <= operand.register) & (operand.register <= DR31) THEN
 						CASE operandEncoding OF
 						CASE operandEncoding OF
-							 encodingNEONQorDd:
-							 	NEONRegisterPos[0] := 12;
-							 	NEONRegisterPos[1] := 13;
-							 	NEONRegisterPos[2] := 14;
-							 	NEONRegisterPos[3] := 15;
-							 	NEONRegisterPos[4] := 22;
+							|encodingNEONQorDd:
+								NEONRegisterPos[0] := 12;
+								NEONRegisterPos[1] := 13;
+								NEONRegisterPos[2] := 14;
+								NEONRegisterPos[3] := 15;
+								NEONRegisterPos[4] := 22;
 							|encodingNEONQorDm:
 							|encodingNEONQorDm:
-							 	NEONRegisterPos[0] := 0;
-							 	NEONRegisterPos[1] := 1;
-							 	NEONRegisterPos[2] := 2;
-							 	NEONRegisterPos[3] := 3;
-							 	NEONRegisterPos[4] := 5;
+								NEONRegisterPos[0] := 0;
+								NEONRegisterPos[1] := 1;
+								NEONRegisterPos[2] := 2;
+								NEONRegisterPos[3] := 3;
+								NEONRegisterPos[4] := 5;
 							|encodingNEONQorDn:
 							|encodingNEONQorDn:
-							 	NEONRegisterPos[0] := 16;
-							 	NEONRegisterPos[1] := 17;
-							 	NEONRegisterPos[2] := 18;
-							 	NEONRegisterPos[3] := 19;
-							 	NEONRegisterPos[4] := 7;
+								NEONRegisterPos[0] := 16;
+								NEONRegisterPos[1] := 17;
+								NEONRegisterPos[2] := 18;
+								NEONRegisterPos[3] := 19;
+								NEONRegisterPos[4] := 7;
 						END;
 						END;
 						SplittedUnsigned(operand.register - DR0, NEONRegisterPos);
 						SplittedUnsigned(operand.register - DR0, NEONRegisterPos);
 					ELSIF (QR0 <= operand.register) & (operand.register <= QR15) THEN
 					ELSIF (QR0 <= operand.register) & (operand.register <= QR15) THEN
 						CASE operandEncoding OF
 						CASE operandEncoding OF
-							 encodingNEONQorDd:
-							 	NEONRegisterPos[0] := 13;
-							 	NEONRegisterPos[1] := 14;
-							 	NEONRegisterPos[2] := 15;
-							 	NEONRegisterPos[3] := 22;
+							|encodingNEONQorDd:
+								NEONRegisterPos[0] := 13;
+								NEONRegisterPos[1] := 14;
+								NEONRegisterPos[2] := 15;
+								NEONRegisterPos[3] := 22;
 							|encodingNEONQorDm:
 							|encodingNEONQorDm:
-							 	NEONRegisterPos[0] := 1;
-							 	NEONRegisterPos[1] := 2;
-							 	NEONRegisterPos[2] := 3;
-							 	NEONRegisterPos[3] := 5;
+								NEONRegisterPos[0] := 1;
+								NEONRegisterPos[1] := 2;
+								NEONRegisterPos[2] := 3;
+								NEONRegisterPos[3] := 5;
 							|encodingNEONQorDn:
 							|encodingNEONQorDn:
-							 	NEONRegisterPos[0] := 17;
-							 	NEONRegisterPos[1] := 18;
-							 	NEONRegisterPos[2] := 19;
-							 	NEONRegisterPos[3] := 7;
+								NEONRegisterPos[0] := 17;
+								NEONRegisterPos[1] := 18;
+								NEONRegisterPos[2] := 19;
+								NEONRegisterPos[3] := 7;
 						END;
 						END;
 						NEONRegisterPos[4] := 32;
 						NEONRegisterPos[4] := 32;
 						SplittedUnsigned(operand.register - QR0, NEONRegisterPos);
 						SplittedUnsigned(operand.register - QR0, NEONRegisterPos);
@@ -1349,46 +1344,46 @@ CONST
 					ELSIF operand.shiftMode # None THEN error := TRUE
 					ELSIF operand.shiftMode # None THEN error := TRUE
 					ELSIF (DR0 <= operand.register) & (operand.register <= DR15) THEN
 					ELSIF (DR0 <= operand.register) & (operand.register <= DR15) THEN
 						CASE operandEncoding OF
 						CASE operandEncoding OF
-							 encodingNEONDorSd:
-							 	NEONRegisterPos[0] := 12;
-							 	NEONRegisterPos[1] := 13;
-							 	NEONRegisterPos[2] := 14;
-							 	NEONRegisterPos[3] := 15;
-							 	NEONRegisterPos[4] := 22;
+							|encodingNEONDorSd:
+								NEONRegisterPos[0] := 12;
+								NEONRegisterPos[1] := 13;
+								NEONRegisterPos[2] := 14;
+								NEONRegisterPos[3] := 15;
+								NEONRegisterPos[4] := 22;
 							|encodingNEONDorSm:
 							|encodingNEONDorSm:
-							 	NEONRegisterPos[0] := 0;
-							 	NEONRegisterPos[1] := 1;
-							 	NEONRegisterPos[2] := 2;
-							 	NEONRegisterPos[3] := 3;
-							 	NEONRegisterPos[4] := 5;
+								NEONRegisterPos[0] := 0;
+								NEONRegisterPos[1] := 1;
+								NEONRegisterPos[2] := 2;
+								NEONRegisterPos[3] := 3;
+								NEONRegisterPos[4] := 5;
 							|encodingNEONDorSn:
 							|encodingNEONDorSn:
-							 	NEONRegisterPos[0] := 16;
-							 	NEONRegisterPos[1] := 17;
-							 	NEONRegisterPos[2] := 18;
-							 	NEONRegisterPos[3] := 19;
-							 	NEONRegisterPos[4] := 7;
+								NEONRegisterPos[0] := 16;
+								NEONRegisterPos[1] := 17;
+								NEONRegisterPos[2] := 18;
+								NEONRegisterPos[3] := 19;
+								NEONRegisterPos[4] := 7;
 						END;
 						END;
 						SplittedUnsigned(operand.register - DR0, NEONRegisterPos)
 						SplittedUnsigned(operand.register - DR0, NEONRegisterPos)
 					ELSIF (SR0 <= operand.register) & (operand.register <= SR31) THEN
 					ELSIF (SR0 <= operand.register) & (operand.register <= SR31) THEN
 						CASE operandEncoding OF
 						CASE operandEncoding OF
-						 encodingNEONDorSd:
-						 	NEONRegisterPos[0] := 22;
-						 	NEONRegisterPos[1] := 12;
-						 	NEONRegisterPos[2] := 13;
-						 	NEONRegisterPos[3] := 14;
-						 	NEONRegisterPos[4] := 15;
+						|encodingNEONDorSd:
+							NEONRegisterPos[0] := 22;
+							NEONRegisterPos[1] := 12;
+							NEONRegisterPos[2] := 13;
+							NEONRegisterPos[3] := 14;
+							NEONRegisterPos[4] := 15;
 						|encodingNEONDorSm:
 						|encodingNEONDorSm:
-						 	NEONRegisterPos[0] := 5;
-						 	NEONRegisterPos[1] := 0;
-						 	NEONRegisterPos[2] := 1;
-						 	NEONRegisterPos[3] := 2;
-						 	NEONRegisterPos[4] := 3;
+							NEONRegisterPos[0] := 5;
+							NEONRegisterPos[1] := 0;
+							NEONRegisterPos[2] := 1;
+							NEONRegisterPos[3] := 2;
+							NEONRegisterPos[4] := 3;
 						|encodingNEONDorSn:
 						|encodingNEONDorSn:
-						 	NEONRegisterPos[0] := 7;
-						 	NEONRegisterPos[1] := 16;
-						 	NEONRegisterPos[2] := 17;
-						 	NEONRegisterPos[3] := 18;
-						 	NEONRegisterPos[4] := 19;
+							NEONRegisterPos[0] := 7;
+							NEONRegisterPos[1] := 16;
+							NEONRegisterPos[2] := 17;
+							NEONRegisterPos[3] := 18;
+							NEONRegisterPos[4] := 19;
 						END;
 						END;
 						SplittedUnsigned(operand.register - SR0, NEONRegisterPos)
 						SplittedUnsigned(operand.register - SR0, NEONRegisterPos)
 					ELSE error := TRUE
 					ELSE error := TRUE
@@ -1409,11 +1404,11 @@ CONST
 					NEONRegisterPos[2] := 14;
 					NEONRegisterPos[2] := 14;
 					NEONRegisterPos[3] := 15;
 					NEONRegisterPos[3] := 15;
 					NEONRegisterPos[4] := 22;
 					NEONRegisterPos[4] := 22;
-				 	SplittedUnsigned(DR0 + firstRegister, NEONRegisterPos);
+					SplittedUnsigned(DR0 + firstRegister, NEONRegisterPos);
 					(* bits 8 to 11 specify the length of the list *)
 					(* bits 8 to 11 specify the length of the list *)
 					CASE num OF
 					CASE num OF
-						 1: 	Unsigned(7H, 8, 11)
-						|2: 	Unsigned(0AH, 8, 11)
+						|1: Unsigned(7H, 8, 11)
+						|2: Unsigned(0AH, 8, 11)
 						|3: Unsigned(6H, 8, 11)
 						|3: Unsigned(6H, 8, 11)
 						|4: Unsigned(2H, 8, 11)
 						|4: Unsigned(2H, 8, 11)
 					ELSE
 					ELSE
@@ -1429,7 +1424,7 @@ CONST
 
 
 					CASE operand.register OF
 					CASE operand.register OF
 						(* FPSID - 0b0; FPSCR - 0b1; FPEXC - 0b1000 at bits 19:16 *)
 						(* FPSID - 0b0; FPSCR - 0b1; FPEXC - 0b1000 at bits 19:16 *)
-						 FPSCR: INCL(codeSet, 16)
+						|FPSCR: INCL(codeSet, 16)
 						|FPEXC: INCL(codeSet, 19)
 						|FPEXC: INCL(codeSet, 19)
 					END
 					END
 
 
@@ -1474,10 +1469,10 @@ CONST
 			(* Set the Q bit *)
 			(* Set the Q bit *)
 			FOR i := 0 TO MaxOperands - 1 DO
 			FOR i := 0 TO MaxOperands - 1 DO
 				CASE format.operands[i] OF
 				CASE format.operands[i] OF
-					 encodingNEONQorDd, encodingNEONQorDm, encodingNEONQorDn:
-					 	IF (QR0 <= instruction.operands[i].register) & (instruction.operands[i].register <= QR15) THEN
-					 		codeSet := codeSet + format.Quadword
-					 	END
+					|encodingNEONQorDd, encodingNEONQorDm, encodingNEONQorDn:
+						IF (QR0 <= instruction.operands[i].register) & (instruction.operands[i].register <= QR15) THEN
+							codeSet := codeSet + format.Quadword
+						END
 					|encodingNEONDorSd, encodingNEONDorSm, encodingNEONDorSn:
 					|encodingNEONDorSd, encodingNEONDorSm, encodingNEONDorSn:
 						IF (DR0 <= instruction.operands[i].register) & (instruction.operands[i].register <= DR15) THEN
 						IF (DR0 <= instruction.operands[i].register) & (instruction.operands[i].register <= DR15) THEN
 							codeSet := codeSet + format.Quadword
 							codeSet := codeSet + format.Quadword
@@ -1739,7 +1734,6 @@ CONST
 			RETURN TRUE
 			RETURN TRUE
 		END DecodeOperand;
 		END DecodeOperand;
 
 
-
 	BEGIN
 	BEGIN
 		codeSet := NumberToSet(code);
 		codeSet := NumberToSet(code);
 		IF TraceDecode THEN
 		IF TraceDecode THEN
@@ -1969,12 +1963,12 @@ CONST
 
 
 			FOR curr := len TO 0 BY -1 DO
 			FOR curr := len TO 0 BY -1 DO
 				ASSERT((format[curr] = " ") OR (format[curr] = "1")
 				ASSERT((format[curr] = " ") OR (format[curr] = "1")
-					 OR (format[curr] = "0") OR (format[curr] = "X")
-					 OR (format[curr] = "U") OR (format[curr] = "Q")
-					 OR (format[curr] = "F") OR (format[curr] = "L")
-					 OR (format[curr] = "S") OR (format[curr] = "o"));
+					OR (format[curr] = "0") OR (format[curr] = "X")
+					OR (format[curr] = "U") OR (format[curr] = "Q")
+					OR (format[curr] = "F") OR (format[curr] = "L")
+					OR (format[curr] = "S") OR (format[curr] = "o"));
 				CASE format[curr] OF
 				CASE format[curr] OF
-					 " ":
+					|" ":
 					|"0": INCL(diffBits, count); INC(count)
 					|"0": INCL(diffBits, count); INC(count)
 					|"1": INCL(setBits, count); INCL(diffBits, count); INC(count)
 					|"1": INCL(setBits, count); INCL(diffBits, count); INC(count)
 					|"X": INC(count)
 					|"X": INC(count)
@@ -2210,7 +2204,6 @@ CONST
 
 
 		FOR i := 0 TO NumberRegisterEntries-1 DO ASSERT(registerEntries[i].name # "") END;
 		FOR i := 0 TO NumberRegisterEntries-1 DO ASSERT(registerEntries[i].name # "") END;
 
 
-
 		(* enter condition names (note that the preferred name, i.e. alias, is entered after the other variants) *)
 		(* enter condition names (note that the preferred name, i.e. alias, is entered after the other variants) *)
 		conditionEntryCount := 0;
 		conditionEntryCount := 0;
 		EnterCondition(conditionEQ, "EQ");
 		EnterCondition(conditionEQ, "EQ");
@@ -2600,11 +2593,11 @@ CONST
 		EnterInstruction(opUMLAL, {4, 7, 21, 23}, {4..7, 21..27}, {flagCondition, flagS}, encodingR12, encodingR16, encodingR0, encodingR8, None, None);
 		EnterInstruction(opUMLAL, {4, 7, 21, 23}, {4..7, 21..27}, {flagCondition, flagS}, encodingR12, encodingR16, encodingR0, encodingR8, None, None);
 		EnterInstruction(opUMULL, {4, 7, 23}, {4..7, 21..27}, {flagCondition, flagS}, encodingR12, encodingR16, encodingR0, encodingR8, None, None);
 		EnterInstruction(opUMULL, {4, 7, 23}, {4..7, 21..27}, {flagCondition, flagS}, encodingR12, encodingR16, encodingR0, encodingR8, None, None);
 
 
-		EnterNEONInstruction(opMOVW,	"XXXX 0011 0000 XXXX XXXX XXXX XXXX XXXX",{flagCondition}, encodingR12, encodingImm12a0imm4a16, None, None, None, None);
-		EnterNEONInstruction(opLDM, 	"XXXX 100X X101 XXXX 0XXX XXXX XXXX XXXX", {flagCondition, flagIA, flagDA, flagIB, flagDB, flagUserMode}, encodingR16, encodingRegisterList, None, None, None, None);
-		EnterNEONInstruction(opSTM, 	"XXXX 100X X100 XXXX XXXX XXXX XXXX XXXX", {flagCondition, flagIA, flagDA, flagIB, flagDB, flagUserMode}, encodingR16, encodingRegisterList, None, None, None, None);
-		EnterNEONInstruction(opISB, 		"1111 0101 0111 1111 1111 0000 0110 1111", {}, None, None, None, None, None, None);
-		EnterNEONInstruction(opLSL, 		"XXXX 0001 1010 0000 XXXX XXXX X000 XXXX", {flagCondition, flagS}, encodingR12, encodingR0, encodingImm7to11, None, None, None);
+		EnterNEONInstruction(opMOVW, "XXXX 0011 0000 XXXX XXXX XXXX XXXX XXXX",{flagCondition}, encodingR12, encodingImm12a0imm4a16, None, None, None, None);
+		EnterNEONInstruction(opLDM, "XXXX 100X X101 XXXX 0XXX XXXX XXXX XXXX", {flagCondition, flagIA, flagDA, flagIB, flagDB, flagUserMode}, encodingR16, encodingRegisterList, None, None, None, None);
+		EnterNEONInstruction(opSTM, "XXXX 100X X100 XXXX XXXX XXXX XXXX XXXX", {flagCondition, flagIA, flagDA, flagIB, flagDB, flagUserMode}, encodingR16, encodingRegisterList, None, None, None, None);
+		EnterNEONInstruction(opISB, "1111 0101 0111 1111 1111 0000 0110 1111", {}, None, None, None, None, None, None);
+		EnterNEONInstruction(opLSL, "XXXX 0001 1010 0000 XXXX XXXX X000 XXXX", {flagCondition, flagS}, encodingR12, encodingR0, encodingImm7to11, None, None, None);
 		EnterNEONInstruction(opLSL, "XXXX 0001 1010 0000 XXXX XXXX 0001 XXXX", {flagCondition, flagS}, encodingR12, encodingR0, encodingR8, None, None, None);
 		EnterNEONInstruction(opLSL, "XXXX 0001 1010 0000 XXXX XXXX 0001 XXXX", {flagCondition, flagS}, encodingR12, encodingR0, encodingR8, None, None, None);
 		EnterNEONInstruction(opLSR, "XXXX 0001 1010 0000 XXXX XXXX X010 XXXX", {flagCondition, flagS}, encodingR12, encodingR0, encodingImm7to11, None, None, None);
 		EnterNEONInstruction(opLSR, "XXXX 0001 1010 0000 XXXX XXXX X010 XXXX", {flagCondition, flagS}, encodingR12, encodingR0, encodingImm7to11, None, None, None);
 		EnterNEONInstruction(opSEV, "XXXX 0011 0010 0000 1111 0000 0000 0100", {flagCondition}, None, None, None, None, None, None);
 		EnterNEONInstruction(opSEV, "XXXX 0011 0010 0000 1111 0000 0000 0100", {flagCondition}, None, None, None, None, None, None);
@@ -2926,7 +2919,6 @@ CONST
 		END;
 		END;
 	END Disassemble;
 	END Disassemble;
 
 
-
 BEGIN Init;
 BEGIN Init;
 END FoxARMInstructionSet.
 END FoxARMInstructionSet.
 
 

+ 55 - 72
source/FoxActiveCells.Mod

@@ -238,7 +238,6 @@ TYPE
 			RETURN TRUE
 			RETURN TRUE
 		END Same;
 		END Same;
 
 
-
 	END PortList;
 	END PortList;
 
 
 	(* devices are additional components that can be attached to processors
 	(* devices are additional components that can be attached to processors
@@ -260,7 +259,6 @@ TYPE
 			RETURN Same^(as, flags)
 			RETURN Same^(as, flags)
 		END Same;
 		END Same;
 
 
-
 		PROCEDURE &InitDevice*(CONST name: ARRAY OF CHAR; scope: Scope; adr: LONGINT);
 		PROCEDURE &InitDevice*(CONST name: ARRAY OF CHAR; scope: Scope; adr: LONGINT);
 		BEGIN
 		BEGIN
 			InitSymbol(name,scope);
 			InitSymbol(name,scope);
@@ -322,7 +320,6 @@ TYPE
 			RETURN TRUE
 			RETURN TRUE
 		END Same;
 		END Same;
 
 
-
 	END DeviceList;
 	END DeviceList;
 
 
 	(*
 	(*
@@ -406,7 +403,6 @@ TYPE
 			RETURN TRUE
 			RETURN TRUE
 		END Same;
 		END Same;
 
 
-
 	END ModuleList;
 	END ModuleList;
 
 
 	(*
 	(*
@@ -456,7 +452,6 @@ TYPE
 			parameterType := String; string := Strings.NewString(s);
 			parameterType := String; string := Strings.NewString(s);
 		END SetString;
 		END SetString;
 
 
-
 		PROCEDURE Write(w: Streams.Writer; indent: LONGINT);
 		PROCEDURE Write(w: Streams.Writer; indent: LONGINT);
 		VAR typeName: SyntaxTree.String;
 		VAR typeName: SyntaxTree.String;
 		BEGIN
 		BEGIN
@@ -591,7 +586,6 @@ TYPE
 			END;
 			END;
 		END SetType;
 		END SetType;
 
 
-
 		PROCEDURE SetInstructionMemorySize*(value: LONGINT);
 		PROCEDURE SetInstructionMemorySize*(value: LONGINT);
 		BEGIN instructionMemorySize := value
 		BEGIN instructionMemorySize := value
 		END SetInstructionMemorySize;
 		END SetInstructionMemorySize;
@@ -804,7 +798,7 @@ TYPE
 			NEW(type,name,SELF);
 			NEW(type,name,SELF);
 			types.AddType(type);
 			types.AddType(type);
 			symbols.AddSymbol(type);
 			symbols.AddSymbol(type);
-			 RETURN type
+			RETURN type
 		END NewType;
 		END NewType;
 
 
 		PROCEDURE ForEachInstanceDo*(method: InstanceMethod): BOOLEAN;
 		PROCEDURE ForEachInstanceDo*(method: InstanceMethod): BOOLEAN;
@@ -823,7 +817,6 @@ TYPE
 			RETURN TRUE
 			RETURN TRUE
 		END ForEachInstanceDo;
 		END ForEachInstanceDo;
 
 
-
 		PROCEDURE ForEachTypeDo*(method: TypeMethod): BOOLEAN; (* used for linking *)
 		PROCEDURE ForEachTypeDo*(method: TypeMethod): BOOLEAN; (* used for linking *)
 		VAR type: Type; i: LONGINT;
 		VAR type: Type; i: LONGINT;
 		BEGIN
 		BEGIN
@@ -880,7 +873,6 @@ TYPE
 			RETURN TRUE (*RETURN Same^(as, flags)*)
 			RETURN TRUE (*RETURN Same^(as, flags)*)
 		END Same;
 		END Same;
 
 
-
 		PROCEDURE & InitType*(CONST name: ARRAY OF CHAR; scope: Scope);
 		PROCEDURE & InitType*(CONST name: ARRAY OF CHAR; scope: Scope);
 		BEGIN
 		BEGIN
 			InitScope(name,scope,scope.specification);
 			InitScope(name,scope,scope.specification);
@@ -925,8 +917,6 @@ TYPE
 			RETURN module;
 			RETURN module;
 		END NewModule;
 		END NewModule;
 
 
-
-
 		(*
 		(*
 		PROCEDURE ThisPort(CONST name: ARRAY OF CHAR): Port;
 		PROCEDURE ThisPort(CONST name: ARRAY OF CHAR): Port;
 		VAR type: Type; port:Port; i: LONGINT;
 		VAR type: Type; port:Port; i: LONGINT;
@@ -984,11 +974,11 @@ TYPE
 			ELSE
 			ELSE
 				msg := "could not link ";
 				msg := "could not link ";
 				Strings.Append(msg,linkRoot);
 				Strings.Append(msg,linkRoot);
-				 FOR i := 0 TO modules.Length()-1 DO
-				 	module := modules.GetModule(i);
-				 	Strings.Append(msg," "); Strings.Append(msg,module.name);
-				 END;
-				 diagnostics.Error("",Streams.Invalid, msg);
+				FOR i := 0 TO modules.Length()-1 DO
+					module := modules.GetModule(i);
+					Strings.Append(msg," "); Strings.Append(msg,module.name);
+				END;
+				diagnostics.Error("",Streams.Invalid, msg);
 			END;
 			END;
 			RETURN ~linker.error
 			RETURN ~linker.error
 		END LinkType;
 		END LinkType;
@@ -1137,7 +1127,6 @@ TYPE
 		widthInBits-: LONGINT;
 		widthInBits-: LONGINT;
 		index-: LONGINT; (* useful for implementations that emulate channels (simulator) *)
 		index-: LONGINT; (* useful for implementations that emulate channels (simulator) *)
 
 
-
 		PROCEDURE Same*(as: Symbol; flags: SET): BOOLEAN;
 		PROCEDURE Same*(as: Symbol; flags: SET): BOOLEAN;
 		BEGIN
 		BEGIN
 			IF TraceSame THEN TRACE("Channel",name) END;
 			IF TraceSame THEN TRACE("Channel",name) END;
@@ -1259,7 +1248,6 @@ TYPE
 			RETURN TRUE
 			RETURN TRUE
 		END Same;
 		END Same;
 
 
-
 	END ChannelList;
 	END ChannelList;
 
 
 	(*
 	(*
@@ -1456,7 +1444,6 @@ TYPE
 
 
 	END Specification;
 	END Specification;
 
 
-
 	(*
 	(*
 	PROCEDURE ReadHugeint(r: Streams.Reader; VAR x: HUGEINT): BOOLEAN;
 	PROCEDURE ReadHugeint(r: Streams.Reader; VAR x: HUGEINT): BOOLEAN;
 	VAR low, high: LONGINT;
 	VAR low, high: LONGINT;
@@ -1571,8 +1558,6 @@ TYPE
 		IF spec1.Same(spec2, {}) THEN context.out.String("Specifications are equal") ELSE context.out.String("specifications are not equal"); END;
 		IF spec1.Same(spec2, {}) THEN context.out.String("Specifications are equal") ELSE context.out.String("specifications are not equal"); END;
 	END CompareSpecification;
 	END CompareSpecification;
 
 
-
-
 	(*
 	(*
 	(**
 	(**
 		Load an ActiveCells specification
 		Load an ActiveCells specification
@@ -1680,58 +1665,57 @@ TYPE
 		(* does nothing -- for compatibility with ActiveCells2 *)
 		(* does nothing -- for compatibility with ActiveCells2 *)
 	END Clone;
 	END Clone;
 
 
-
 	PROCEDURE FlattenNetwork*(scope: Scope);
 	PROCEDURE FlattenNetwork*(scope: Scope);
 	VAR instance,subInstance,newInstance: Instance; oldChannel,channel: Channel;
 	VAR instance,subInstance,newInstance: Instance; oldChannel,channel: Channel;
-		 instances: InstanceList; channels: ChannelList;
-		 i,j: LONGINT; name: SyntaxTree.String;
-		 port: Port;
-
-		 PROCEDURE FlattenPortInstance(VAR pi: PortInstance);
-		 VAR name: Name; port, prevPort: Port; instance: Instance;
-		 BEGIN
-		 	IF pi.port # NIL THEN
-			 	port := pi.port.delegate.port;
-			 	IF port # NIL THEN
-				 	instance := pi.port.delegate.instance;
-				 	ASSERT(instance # NIL);
-			 		COPY(pi.instance.name,name);
-			 		(* iteratively resolve port delegation and build local instance name *)
-			 		WHILE  port # NIL DO
-			 			prevPort := port;
-			 			ASSERT(instance # NIL);
-				 		Strings.Append(name,"."); Strings.Append(name,instance.name);
-				 		instance := port.delegate.instance;
-				 		port := port.delegate.port;
-				 	END;
-				 	port := prevPort;
-				 	instance := instances.ByName(name);
-				 	ASSERT(port # NIL);
-				 	ASSERT(instance # NIL);
-				 	pi.instance := instance;
-				 	pi.port := port;
-			 	END;
-			 END;
-		 END FlattenPortInstance;
-
-		 PROCEDURE EmbedInstance(instance: Instance; VAR subInstance: Instance): Instance;
-		 VAR name: Name; newInstance: Instance; i: LONGINT; parameter,newParameter: Parameter;
-		 BEGIN
-		 	COPY(instance.name, name); Strings.Append(name,"."); Strings.Append(name,subInstance.name);
-		 	newInstance := instances.ByName(name);
-		 	IF newInstance = NIL THEN
-		 		NEW(newInstance, name, scope, subInstance.instanceType);
-		 		FOR i := 0 TO subInstance.parameters.Length()-1 DO
-		 			parameter := subInstance.parameters.GetParameter(i);
-		 			newParameter := newInstance.AddParameter(parameter.name);
-		 			newParameter.index := parameter.index;
-		 			newParameter.parameterType := parameter.parameterType;
-		 			newParameter.integer := parameter.integer;
-		 			newParameter.boolean := parameter.boolean;
-		 		END;
-		 	END;
-		 	RETURN newInstance
-		 END EmbedInstance;
+		instances: InstanceList; channels: ChannelList;
+		i, j: LONGINT; name: SyntaxTree.String;
+		port: Port;
+
+		PROCEDURE FlattenPortInstance(VAR pi: PortInstance);
+		VAR name: Name; port, prevPort: Port; instance: Instance;
+		BEGIN
+			IF pi.port # NIL THEN
+				port := pi.port.delegate.port;
+				IF port # NIL THEN
+					instance := pi.port.delegate.instance;
+					ASSERT(instance # NIL);
+					COPY(pi.instance.name,name);
+					(* iteratively resolve port delegation and build local instance name *)
+					WHILE  port # NIL DO
+						prevPort := port;
+						ASSERT(instance # NIL);
+						Strings.Append(name,"."); Strings.Append(name,instance.name);
+						instance := port.delegate.instance;
+						port := port.delegate.port;
+					END;
+					port := prevPort;
+					instance := instances.ByName(name);
+					ASSERT(port # NIL);
+					ASSERT(instance # NIL);
+					pi.instance := instance;
+					pi.port := port;
+				END;
+			END;
+		END FlattenPortInstance;
+
+		PROCEDURE EmbedInstance(instance: Instance; VAR subInstance: Instance): Instance;
+		VAR name: Name; newInstance: Instance; i: LONGINT; parameter,newParameter: Parameter;
+		BEGIN
+			COPY(instance.name, name); Strings.Append(name,"."); Strings.Append(name,subInstance.name);
+			newInstance := instances.ByName(name);
+			IF newInstance = NIL THEN
+				NEW(newInstance, name, scope, subInstance.instanceType);
+				FOR i := 0 TO subInstance.parameters.Length()-1 DO
+					parameter := subInstance.parameters.GetParameter(i);
+					newParameter := newInstance.AddParameter(parameter.name);
+					newParameter.index := parameter.index;
+					newParameter.parameterType := parameter.parameterType;
+					newParameter.integer := parameter.integer;
+					newParameter.boolean := parameter.boolean;
+				END;
+			END;
+			RETURN newInstance
+		END EmbedInstance;
 
 
 	BEGIN
 	BEGIN
 		IF scope.instances.Length()=0 THEN RETURN END;
 		IF scope.instances.Length()=0 THEN RETURN END;
@@ -1822,7 +1806,6 @@ TYPE
 		platform.specLoader := LoadSpecificationDefault;
 		platform.specLoader := LoadSpecificationDefault;
 	END InitMod;
 	END InitMod;
 
 
-
 BEGIN
 BEGIN
 	InitMod;
 	InitMod;
 	*)
 	*)

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 101 - 128
source/FoxArrayBase.Mod


+ 38 - 42
source/FoxAssembler.Mod

@@ -15,7 +15,6 @@ CONST
 			- expressions with labels would not work
 			- expressions with labels would not work
 			- fixup mechanism complicated and not generic
 			- fixup mechanism complicated and not generic
 
 
-
 	*)
 	*)
 	MaxPasses* = 2;
 	MaxPasses* = 2;
 
 
@@ -366,7 +365,6 @@ TYPE
 			IF (symbol # NIL) THEN RETURN symbol.fingerprint.shallow END;
 			IF (symbol # NIL) THEN RETURN symbol.fingerprint.shallow END;
 		END GetFingerprint;
 		END GetFingerprint;
 
 
-
 		PROCEDURE NonConstantSymbol(pos: Position; symbol: SyntaxTree.Symbol; VAR result: Result): BOOLEAN;
 		PROCEDURE NonConstantSymbol(pos: Position; symbol: SyntaxTree.Symbol; VAR result: Result): BOOLEAN;
 		VAR
 		VAR
 			name: Basic.SegmentedName; moduleScope: SyntaxTree.Scope; fixupSection: IntermediateCode.Section;
 			name: Basic.SegmentedName; moduleScope: SyntaxTree.Scope; fixupSection: IntermediateCode.Section;
@@ -886,7 +884,6 @@ TYPE
 			AllSections;
 			AllSections;
 		END Text;
 		END Text;
 
 
-
 	END Assembler;
 	END Assembler;
 
 
 	PROCEDURE DumpResult*(w: Streams.Writer; result: Result);
 	PROCEDURE DumpResult*(w: Streams.Writer; result: Result);
@@ -926,7 +923,6 @@ END FoxAssembler.
 
 
 System.Free FoxAssembler ~
 System.Free FoxAssembler ~
 
 
-
 FoxAssembler.Test
 FoxAssembler.Test
 ;---------------- intermediate code -----------------
 ;---------------- intermediate code -----------------
 .module BitSets
 .module BitSets
@@ -934,34 +930,34 @@ FoxAssembler.Test
 .imports SYSTEM
 .imports SYSTEM
 
 
 .const BitSets.@moduleSelf offset=0
 .const BitSets.@moduleSelf offset=0
-	 0: data u32 0
+	0: data u32 0
 
 
 .const BitSets.BitSet offset=0
 .const BitSets.BitSet offset=0
-	 0: data u32 0
+	0: data u32 0
 
 
 .code BitSets.BitSet.InitBitSet offset=0
 .code BitSets.BitSet.InitBitSet offset=0
-	 0: enter  0,  0
-	 1: mov u32 r1, u32 [fp+8]
-	 2: mov s32 [r1], s32 [fp+12]
-	 3: push s32 [fp+12]
-	 4: mov u32 r2, u32 [fp+8]
-	 5: add u32 r3, u32 [r2-4], u32 -88
-	 6: push u32 r2
-	 7: call u32 [r3],  8
-	 8: leave  0
-	 9: exit  8
+	0: enter  0,  0
+	1: mov u32 r1, u32 [fp+8]
+	2: mov s32 [r1], s32 [fp+12]
+	3: push s32 [fp+12]
+	4: mov u32 r2, u32 [fp+8]
+	5: add u32 r3, u32 [r2-4], u32 -88
+	6: push u32 r2
+	7: call u32 [r3],  8
+	8: leave  0
+	9: exit  8
 
 
 .code BitSets.BitSet.Zero offset=0
 .code BitSets.BitSet.Zero offset=0
-	 0: enter  0,  8
-	 1: mov s32 [fp-4], s32 0
-	 2: mov u32 r1, u32 [fp+8]
-	 3: mov u32 r2, u32 [r1+4]
-	 4: conv s32 r3, u32 [r2+12]
-	 5: sub s32 r3, s32 r3, s32 1
-	 6: mov s32 [fp-8], s32 r3
-	 7: brlt u32 BitSets.BitSet.Zero:21, s32 [fp-8], s32 [fp-4]
-	 8: br u32 BitSets.BitSet.Zero:9
-	 9: conv u32 r4, s32 [fp-4]
+	0: enter  0,  8
+	1: mov s32 [fp-4], s32 0
+	2: mov u32 r1, u32 [fp+8]
+	3: mov u32 r2, u32 [r1+4]
+	4: conv s32 r3, u32 [r2+12]
+	5: sub s32 r3, s32 r3, s32 1
+	6: mov s32 [fp-8], s32 r3
+	7: brlt u32 BitSets.BitSet.Zero:21, s32 [fp-8], s32 [fp-4]
+	8: br u32 BitSets.BitSet.Zero:9
+	9: conv u32 r4, s32 [fp-4]
 	10: mov u32 r5, u32 r4
 	10: mov u32 r5, u32 r4
 	11: mov u32 r6, u32 [fp+8]
 	11: mov u32 r6, u32 [fp+8]
 	12: mov u32 r7, u32 [r6+4]
 	12: mov u32 r7, u32 [r6+4]
@@ -977,16 +973,16 @@ FoxAssembler.Test
 	22: exit  4
 	22: exit  4
 
 
 .code BitSets.BitSet.Resize offset=0
 .code BitSets.BitSet.Resize offset=0
-	 0: enter  0,  12
-	 1: brlt u32 BitSets.BitSet.Resize:3, s32 [fp+12], s32 0
-	 2: br u32 BitSets.BitSet.Resize:4
-	 3: trap  8
-	 4: mov u32 r1, u32 [fp+8]
-	 5: mov s32 [r1], s32 [fp+12]
-	 6: sub s32 r2, s32 [fp+12], s32 1
-	 7: brlt u32 BitSets.BitSet.Resize:10, s32 r2, s32 0
-	 8: mov s32 r2, s32 r2
-	 9: br u32 BitSets.BitSet.Resize:11
+	0: enter  0,  12
+	1: brlt u32 BitSets.BitSet.Resize:3, s32 [fp+12], s32 0
+	2: br u32 BitSets.BitSet.Resize:4
+	3: trap  8
+	4: mov u32 r1, u32 [fp+8]
+	5: mov s32 [r1], s32 [fp+12]
+	6: sub s32 r2, s32 [fp+12], s32 1
+	7: brlt u32 BitSets.BitSet.Resize:10, s32 r2, s32 0
+	8: mov s32 r2, s32 r2
+	9: br u32 BitSets.BitSet.Resize:11
 	10: mov s32 r2, s32 0, s32 r2
 	10: mov s32 r2, s32 0, s32 r2
 	11: shr s32 r2, s32 r2, s32 5
 	11: shr s32 r2, s32 r2, s32 5
 	12: add s32 r2, s32 r2, s32 1
 	12: add s32 r2, s32 r2, s32 1
@@ -1068,9 +1064,9 @@ FoxAssembler.Test
 	88: exit  8
 	88: exit  8
 
 
 .code BitSets.BitSet.GetSize offset=0
 .code BitSets.BitSet.GetSize offset=0
-	 0: enter  0,  0
-	 1: mov u32 r1, u32 [fp+8]
-	 2: return s32 [r1]
-	 3: leave  0
-	 4: exit  4
-	 5: trap  3
+	0: enter  0,  0
+	1: mov u32 r1, u32 [fp+8]
+	2: return s32 [r1]
+	3: leave  0
+	4: exit  4
+	5: trap  3

+ 1 - 4
source/FoxBackend.Mod

@@ -3,7 +3,6 @@ MODULE FoxBackend; (**  AUTHOR "kaeserm,fof"; PURPOSE "Oberon Compiler: Common b
 IMPORT
 IMPORT
 	Streams, Diagnostics, Basic := FoxBasic, Global := FoxGlobal, Formats := FoxFormats, SyntaxTree := FoxSyntaxTree, SemanticChecker := FoxSemanticChecker, Options, Strings;
 	Streams, Diagnostics, Basic := FoxBasic, Global := FoxGlobal, Formats := FoxFormats, SyntaxTree := FoxSyntaxTree, SemanticChecker := FoxSemanticChecker, Options, Strings;
 
 
-
 TYPE
 TYPE
 	SectionName = ARRAY 256 OF CHAR;
 	SectionName = ARRAY 256 OF CHAR;
 
 
@@ -89,8 +88,6 @@ TYPE
 			RETURN Global.DefaultSystem();
 			RETURN Global.DefaultSystem();
 		END GetSystem;
 		END GetSystem;
 
 
-
-
 		PROCEDURE Error*(CONST source: ARRAY OF CHAR; position: Basic.Position; errorNumber: LONGINT; CONST err: ARRAY OF CHAR);
 		PROCEDURE Error*(CONST source: ARRAY OF CHAR; position: Basic.Position; errorNumber: LONGINT; CONST err: ARRAY OF CHAR);
 		BEGIN
 		BEGIN
 			IF (errorNumber # Basic.InvalidCode) OR (err # "") THEN
 			IF (errorNumber # Basic.InvalidCode) OR (err # "") THEN
@@ -183,4 +180,4 @@ TYPE
 		ASSERT(b);
 		ASSERT(b);
 	END Assert;
 	END Assert;
 
 
-END FoxBackend.
+END FoxBackend.

+ 20 - 28
source/FoxBasic.Mod

@@ -1,7 +1,6 @@
 MODULE FoxBasic;   (**  AUTHOR "fof"; PURPOSE "Oberon Compiler: basic helpers: strings, lists, hash tables, graphs, indented writer";  **)
 MODULE FoxBasic;   (**  AUTHOR "fof"; PURPOSE "Oberon Compiler: basic helpers: strings, lists, hash tables, graphs, indented writer";  **)
 (* (c) fof ETH Zürich, 2009 *)
 (* (c) fof ETH Zürich, 2009 *)
 
 
-
 IMPORT KernelLog, StringPool, Strings, Streams, Diagnostics, Files, SYSTEM, ObjectFile, Modules, D:= Debugging;
 IMPORT KernelLog, StringPool, Strings, Streams, Diagnostics, Files, SYSTEM, ObjectFile, Modules, D:= Debugging;
 
 
 CONST
 CONST
@@ -469,7 +468,6 @@ TYPE
 		value: ANY;
 		value: ANY;
 	END;
 	END;
 
 
-
 	HashAnyArray = POINTER TO ARRAY OF HashEntryAny;
 	HashAnyArray = POINTER TO ARRAY OF HashEntryAny;
 	HashIntArray = POINTER TO ARRAY OF HashEntryInt;
 	HashIntArray = POINTER TO ARRAY OF HashEntryInt;
 
 
@@ -605,7 +603,6 @@ TYPE
 			RETURN TRUE;
 			RETURN TRUE;
 		END GetNext;
 		END GetNext;
 
 
-
 	END IntIterator;
 	END IntIterator;
 
 
 	HashTableInt* = OBJECT
 	HashTableInt* = OBJECT
@@ -819,7 +816,6 @@ TYPE
 
 
 	END HashTableSegmentedName;
 	END HashTableSegmentedName;
 
 
-
 	(* Hash table supporting 2 keys *)
 	(* Hash table supporting 2 keys *)
 	HashTable2D* = OBJECT(HashTable);
 	HashTable2D* = OBJECT(HashTable);
 	VAR
 	VAR
@@ -1183,7 +1179,7 @@ TYPE
 		END ReIndex;
 		END ReIndex;
 
 
 		(* Calculate dominance tree. Algorithm taken from:
 		(* Calculate dominance tree. Algorithm taken from:
-		    "A simple, fast dominance algorithm" (Cooper, Harvey, Kennedy) *)
+			"A simple, fast dominance algorithm" (Cooper, Harvey, Kennedy) *)
 		PROCEDURE CalculateDominance*;
 		PROCEDURE CalculateDominance*;
 		VAR
 		VAR
 			doms: IndexList;
 			doms: IndexList;
@@ -1751,21 +1747,22 @@ VAR
 	PROCEDURE ErrorC*(diagnostics: Diagnostics.Diagnostics; CONST source: ARRAY OF CHAR; pos: Position; code: ErrorCode; CONST msg: ARRAY OF CHAR);
 	PROCEDURE ErrorC*(diagnostics: Diagnostics.Diagnostics; CONST source: ARRAY OF CHAR; pos: Position; code: ErrorCode; CONST msg: ARRAY OF CHAR);
 	VAR message: ARRAY 1024 OF CHAR; file: Files.File;
 	VAR message: ARRAY 1024 OF CHAR; file: Files.File;
 
 
-	    PROCEDURE GetReader(): Streams.Reader;
-	    VAR reader := NIL: Streams.Reader; fileReader : Files.Reader;
-	    BEGIN
-            IF (pos.linepos >= 0) & ((source # "") OR (pos.reader # NIL)) THEN
-                reader := pos.reader;
-                IF reader = NIL THEN
-                    file := Files.Old(source);
-                    IF file # NIL THEN
-			NEW (fileReader, file, pos.linepos);
-                        reader := fileReader;
-                    END;
-                END;
-            END;
-            RETURN reader;
-	    END GetReader;
+		PROCEDURE GetReader(): Streams.Reader;
+		VAR reader := NIL: Streams.Reader; fileReader : Files.Reader;
+		BEGIN
+			IF (pos.linepos >= 0) & ((source # "") OR (pos.reader # NIL)) THEN
+				reader := pos.reader;
+				IF reader = NIL THEN
+					file := Files.Old(source);
+					IF file # NIL THEN
+						NEW (fileReader, file, pos.linepos);
+						reader := fileReader;
+					END;
+				END;
+			END;
+			RETURN reader;
+		END GetReader;
+
 	BEGIN
 	BEGIN
 		IF diagnostics # NIL THEN
 		IF diagnostics # NIL THEN
 			MakeDetailedMessage(pos, code, msg, GetReader(), message);
 			MakeDetailedMessage(pos, code, msg, GetReader(), message);
@@ -1779,8 +1776,6 @@ VAR
 		ErrorC(diagnostics, source, pos, InvalidCode, msg);
 		ErrorC(diagnostics, source, pos, InvalidCode, msg);
 	END Error;
 	END Error;
 
 
-
-
 	PROCEDURE Warning*(diagnostics: Diagnostics.Diagnostics; CONST source: ARRAY OF CHAR; pos: Position; CONST msg: ARRAY OF CHAR);
 	PROCEDURE Warning*(diagnostics: Diagnostics.Diagnostics; CONST source: ARRAY OF CHAR; pos: Position; CONST msg: ARRAY OF CHAR);
 	VAR message: ARRAY 256 OF CHAR;
 	VAR message: ARRAY 256 OF CHAR;
 	BEGIN
 	BEGIN
@@ -1957,7 +1952,6 @@ VAR
 		END;
 		END;
 	END GetSuffix;
 	END GetSuffix;
 
 
-
 	PROCEDURE IsPrefix*(CONST prefix, of: SegmentedName): BOOLEAN;
 	PROCEDURE IsPrefix*(CONST prefix, of: SegmentedName): BOOLEAN;
 	VAR prefixS, ofS: SectionName; i: LONGINT;
 	VAR prefixS, ofS: SectionName; i: LONGINT;
 	BEGIN
 	BEGIN
@@ -2134,7 +2128,6 @@ VAR
 		RETURN GetDiagnostics(w);
 		RETURN GetDiagnostics(w);
 	END GetDefaultDiagnostics;
 	END GetDefaultDiagnostics;
 
 
-
 	PROCEDURE InitWindowWriter;
 	PROCEDURE InitWindowWriter;
 	VAR install: PROCEDURE;
 	VAR install: PROCEDURE;
 	BEGIN
 	BEGIN
@@ -2147,9 +2140,9 @@ VAR
 
 
 	PROCEDURE InstallWriterFactory*(writer: WriterFactory; debug: DebugWriterFactory; diagnostics: DiagnosticsFactory);
 	PROCEDURE InstallWriterFactory*(writer: WriterFactory; debug: DebugWriterFactory; diagnostics: DiagnosticsFactory);
 	BEGIN
 	BEGIN
-		 getWriter := writer;
-		 getDebugWriter := debug;
-		 getDiagnostics := diagnostics;
+		getWriter := writer;
+		getDebugWriter := debug;
+		getDiagnostics := diagnostics;
 	END InstallWriterFactory;
 	END InstallWriterFactory;
 
 
 	PROCEDURE Replace(VAR in: ARRAY OF CHAR; CONST this, by: ARRAY OF CHAR);
 	PROCEDURE Replace(VAR in: ARRAY OF CHAR; CONST this, by: ARRAY OF CHAR);
@@ -2293,5 +2286,4 @@ END FoxBasic.
 
 
 FoxBasic.ActivateDebug ~
 FoxBasic.ActivateDebug ~
 
 
-
 FoxBasic.Test ~
 FoxBasic.Test ~

+ 22 - 30
source/FoxBinaryCode.Mod

@@ -186,7 +186,6 @@ TYPE
 		prev-: LabelList;
 		prev-: LabelList;
 	END;
 	END;
 
 
-
 	Section* = OBJECT
 	Section* = OBJECT
 	VAR
 	VAR
 		os*: ObjectFile.Section;
 		os*: ObjectFile.Section;
@@ -203,7 +202,6 @@ TYPE
 			RETURN pc
 			RETURN pc
 		END GetPC;
 		END GetPC;
 
 
-
 		PROCEDURE & InitBinarySection*(type: SHORTINT; unit: Bits; CONST name:Basic.SegmentedName; dump: BOOLEAN; bigEndian: BOOLEAN);
 		PROCEDURE & InitBinarySection*(type: SHORTINT; unit: Bits; CONST name:Basic.SegmentedName; dump: BOOLEAN; bigEndian: BOOLEAN);
 		BEGIN
 		BEGIN
 			ASSERT(unit > 0);
 			ASSERT(unit > 0);
@@ -239,7 +237,6 @@ TYPE
 			pc := 0;
 			pc := 0;
 		END Reset;
 		END Reset;
 
 
-
 		PROCEDURE AddLabel*(position: Basic.Position);
 		PROCEDURE AddLabel*(position: Basic.Position);
 		VAR new: LabelList;
 		VAR new: LabelList;
 		BEGIN
 		BEGIN
@@ -264,7 +261,6 @@ TYPE
 			SetPC(pc + (-pc) MOD alignment)
 			SetPC(pc + (-pc) MOD alignment)
 		END Align;
 		END Align;
 
 
-
 		PROCEDURE SetFinally*(atPC: Unit);
 		PROCEDURE SetFinally*(atPC: Unit);
 		BEGIN finally := atPC
 		BEGIN finally := atPC
 		END SetFinally;
 		END SetFinally;
@@ -370,7 +366,6 @@ TYPE
 			INC(pc,(8*Byte) DIV os.unit);
 			INC(pc,(8*Byte) DIV os.unit);
 		END PutQWord;
 		END PutQWord;
 
 
-
 		PROCEDURE PutReal*(f: REAL);
 		PROCEDURE PutReal*(f: REAL);
 		BEGIN
 		BEGIN
 			PutDWord(ConvertReal(f))
 			PutDWord(ConvertReal(f))
@@ -547,7 +542,6 @@ TYPE
 				END;
 				END;
 			END Hex;
 			END Hex;
 
 
-
 			PROCEDURE DumpUnit(at: Unit);
 			PROCEDURE DumpUnit(at: Unit);
 			VAR val: WORD; a: ARRAY 9 OF CHAR; bits: Bits;
 			VAR val: WORD; a: ARRAY 9 OF CHAR; bits: Bits;
 			BEGIN
 			BEGIN
@@ -632,17 +626,17 @@ TYPE
 	VAR result: LONGINT; VAR exponent, i: INTEGER;
 	VAR result: LONGINT; VAR exponent, i: INTEGER;
 	BEGIN
 	BEGIN
 		(*! NaN code missing, we need an extra - machine specific - functionality for that  / cf. Streams.NaNCode *)
 		(*! NaN code missing, we need an extra - machine specific - functionality for that  / cf. Streams.NaNCode *)
-	    IF value = 0 THEN RETURN 0 END;
-	    result := 0; exponent := 0;
-	    IF value < 0 THEN value := -value; result := ASH (1, Exponent) END;
-	    WHILE value < 1 DO value := value * 2; DEC (exponent) END;
-	    WHILE value >= 2 DO value := value / 2; INC (exponent) END;
-	    value := value - 1; INC (result, ASH (1, Exponent - 1) - 1 + exponent);
-	    FOR i := 0 TO Significant - 1 DO
-	        value := value * 2; INC (result, result);
-	        IF value >= 1 THEN value := value - 1; INC (result) END;
-	    END;
-	    RETURN result;
+		IF value = 0 THEN RETURN 0 END;
+		result := 0; exponent := 0;
+		IF value < 0 THEN value := -value; result := ASH (1, Exponent) END;
+		WHILE value < 1 DO value := value * 2; DEC (exponent) END;
+		WHILE value >= 2 DO value := value / 2; INC (exponent) END;
+		value := value - 1; INC (result, ASH (1, Exponent - 1) - 1 + exponent);
+		FOR i := 0 TO Significant - 1 DO
+			value := value * 2; INC (result, result);
+			IF value >= 1 THEN value := value - 1; INC (result) END;
+		END;
+		RETURN result;
 	END ConvertReal;
 	END ConvertReal;
 
 
 	PROCEDURE ConvertLongreal*(value: LONGREAL): HUGEINT;
 	PROCEDURE ConvertLongreal*(value: LONGREAL): HUGEINT;
@@ -650,17 +644,17 @@ TYPE
 	VAR result: HUGEINT; VAR exponent, i: INTEGER;
 	VAR result: HUGEINT; VAR exponent, i: INTEGER;
 	BEGIN
 	BEGIN
 		(*! NaN code missing, we need an extra - machine specific - functionality for that  / cf. Streams.NaNCode *)
 		(*! NaN code missing, we need an extra - machine specific - functionality for that  / cf. Streams.NaNCode *)
-	    IF value = 0 THEN RETURN 0 END;
-	    result := 0; exponent := 0;
-	    IF value < 0 THEN value := -value; result := ASH (1, Exponent) END;
-	    WHILE value < 1 DO value := value * 2; DEC (exponent) END;
-	    WHILE value >= 2 DO value := value / 2; INC (exponent) END;
-	    value := value - 1; INC (result, ASH (1, Exponent - 1) - 1 + exponent);
-	    FOR i := 0 TO Significant - 1 DO
-	        value := value * 2; INC (result, result);
-	        IF value >= 1 THEN value := value - 1; INC (result) END;
-	    END;
-	    RETURN result;
+		IF value = 0 THEN RETURN 0 END;
+		result := 0; exponent := 0;
+		IF value < 0 THEN value := -value; result := ASH (1, Exponent) END;
+		WHILE value < 1 DO value := value * 2; DEC (exponent) END;
+		WHILE value >= 2 DO value := value / 2; INC (exponent) END;
+		value := value - 1; INC (result, ASH (1, Exponent - 1) - 1 + exponent);
+		FOR i := 0 TO Significant - 1 DO
+			value := value * 2; INC (result, result);
+			IF value >= 1 THEN value := value - 1; INC (result) END;
+		END;
+		RETURN result;
 	END ConvertLongreal;
 	END ConvertLongreal;
 
 
 	PROCEDURE ConvertToReal*(x: LONGINT): REAL;
 	PROCEDURE ConvertToReal*(x: LONGINT): REAL;
@@ -731,7 +725,6 @@ TYPE
 		NEW(binarySection,type,unit,name,dump,bigEndian); RETURN binarySection
 		NEW(binarySection,type,unit,name,dump,bigEndian); RETURN binarySection
 	END NewBinarySection;
 	END NewBinarySection;
 
 
-
 END FoxBinaryCode.
 END FoxBinaryCode.
 
 
 FoxBinaryCode.TestFixup
 FoxBinaryCode.TestFixup
@@ -779,4 +772,3 @@ FoxBinaryCode.TestFixup
 		data2.Dump(D.Log); D.Ln;
 		data2.Dump(D.Log); D.Ln;
 	END TestFixup;
 	END TestFixup;
 	*)
 	*)
-

+ 0 - 3
source/FoxCSharpParser.Mod

@@ -14,8 +14,6 @@ CONST
 
 
     LynxCase = FoxScanner.Lowercase;
     LynxCase = FoxScanner.Lowercase;
 
 
-
-
 TYPE
 TYPE
 	Position*= Scanner.Position;
 	Position*= Scanner.Position;
 
 
@@ -1681,7 +1679,6 @@ KernelLog.Ln();
             switch-block:
             switch-block:
                 '{' [switch-sections] '}'
                 '{' [switch-sections] '}'
 
 
-
             switch-sections:
             switch-sections:
                 switch-section
                 switch-section
                 switch-sections switch-section
                 switch-sections switch-section

+ 1 - 1
source/FoxCSharpScanner.Mod

@@ -160,7 +160,7 @@ TYPE
         the last read input from the scanner to the parser
         the last read input from the scanner to the parser
     **)
     **)
     Symbol* = RECORD
     Symbol* = RECORD
-    	position*: Position;
+        position*: Position;
         token*: Token;
         token*: Token;
         identifier*: IdentifierType;
         identifier*: IdentifierType;
         identifierString*: IdentifierString;
         identifierString*: IdentifierString;

+ 3 - 12
source/FoxCodeGenerators.Mod

@@ -145,7 +145,6 @@ TYPE
 			error := TRUE;
 			error := TRUE;
 		END Error;
 		END Error;
 
 
-
 		(* generic *)
 		(* generic *)
 		PROCEDURE Section*(in: IntermediateCode.Section; out: BinaryCode.Section);
 		PROCEDURE Section*(in: IntermediateCode.Section; out: BinaryCode.Section);
 		VAR pc: LONGINT; name: Basic.SectionName; instruction: IntermediateCode.Instruction;
 		VAR pc: LONGINT; name: Basic.SectionName; instruction: IntermediateCode.Instruction;
@@ -302,7 +301,6 @@ TYPE
 
 
 			BEGIN
 			BEGIN
 
 
-
 				first := NIL;
 				first := NIL;
 				FOR pc := 0 TO in.pc-1 DO
 				FOR pc := 0 TO in.pc-1 DO
 					IF OptimizeRegisterTransfer IN optimize THEN
 					IF OptimizeRegisterTransfer IN optimize THEN
@@ -329,7 +327,6 @@ TYPE
 				Use(instruction.op3);
 				Use(instruction.op3);
 			END DumpInstruction;
 			END DumpInstruction;
 
 
-
 			PROCEDURE Emulate(VAR x: IntermediateCode.Instruction; CONST moduleName,procedureName: SyntaxTree.IdentifierString);
 			PROCEDURE Emulate(VAR x: IntermediateCode.Instruction; CONST moduleName,procedureName: SyntaxTree.IdentifierString);
 			VAR
 			VAR
 				parSize: LONGINT; sectionName: Basic.SegmentedName; source: Sections.Section; op: IntermediateCode.Operand;
 				parSize: LONGINT; sectionName: Basic.SegmentedName; source: Sections.Section; op: IntermediateCode.Operand;
@@ -376,7 +373,7 @@ TYPE
 				hasDestination := (IntermediateCode.Op1IsDestination IN IntermediateCode.instructionFormat[x.opcode].flags);
 				hasDestination := (IntermediateCode.Op1IsDestination IN IntermediateCode.instructionFormat[x.opcode].flags);
 				ASSERT(x.op1.mode # IntermediateCode.Undefined);
 				ASSERT(x.op1.mode # IntermediateCode.Undefined);
 
 
-				(* 	add import to import list -- raw insert, no check.
+				(*	add import to import list -- raw insert, no check.
 					checks will be performed by loader or linker -- we assume that a low-level runtime system programmer knows what he is doing
 					checks will be performed by loader or linker -- we assume that a low-level runtime system programmer knows what he is doing
 				*)
 				*)
 				SaveRegisters;
 				SaveRegisters;
@@ -445,7 +442,6 @@ TYPE
 				END;
 				END;
 			END SetLiveness;
 			END SetLiveness;
 
 
-
 		BEGIN
 		BEGIN
 			inEmulation := FALSE;
 			inEmulation := FALSE;
 			Basic.SegmentedNameToString(in.name, name);
 			Basic.SegmentedNameToString(in.name, name);
@@ -512,7 +508,6 @@ TYPE
 
 
 		(* ---------------------- generically available code emission ------------------------- *)
 		(* ---------------------- generically available code emission ------------------------- *)
 
 
-
 		PROCEDURE GetDataSection*(): IntermediateCode.Section;
 		PROCEDURE GetDataSection*(): IntermediateCode.Section;
 		VAR name: Basic.SegmentedName; section: IntermediateCode.Section;
 		VAR name: Basic.SegmentedName; section: IntermediateCode.Section;
 		BEGIN
 		BEGIN
@@ -570,16 +565,14 @@ TYPE
 
 
 	(* ----------------------- ticket based register allocation ------------------------------------- *)
 	(* ----------------------- ticket based register allocation ------------------------------------- *)
 
 
-
 		(* register mapping scheme
 		(* register mapping scheme
-			virtual register number	--> register mapping   = 		part(0)		-->	ticket	<-->	physical register
+			virtual register number	--> register mapping   =		part(0)		-->	ticket	<-->	physical register
 																											spill offset
 																											spill offset
 
 
 																	part(n)		-->	ticket	<-->	physical register
 																	part(n)		-->	ticket	<-->	physical register
 																											spill offset
 																											spill offset
 		*)
 		*)
 
 
-
 	Ticket*=POINTER TO RECORD
 	Ticket*=POINTER TO RECORD
 		next-: Ticket;
 		next-: Ticket;
 		type-: IntermediateCode.Type;
 		type-: IntermediateCode.Type;
@@ -755,7 +748,6 @@ TYPE
 		PROCEDURE &InitPhysicalRegisters;
 		PROCEDURE &InitPhysicalRegisters;
 		END InitPhysicalRegisters;
 		END InitPhysicalRegisters;
 
 
-
 		PROCEDURE Allocate*(index: LONGINT; virtualRegister: Ticket);
 		PROCEDURE Allocate*(index: LONGINT; virtualRegister: Ticket);
 		END Allocate;
 		END Allocate;
 
 
@@ -788,10 +780,9 @@ TYPE
 		BEGIN
 		BEGIN
 		END NumberRegisters;
 		END NumberRegisters;
 
 
-
 	END PhysicalRegisters;
 	END PhysicalRegisters;
 
 
-	CONST 	MaxSpilledRegisters=64;
+	CONST MaxSpilledRegisters=64;
 
 
 	TYPE
 	TYPE
 	SpillStack*=OBJECT
 	SpillStack*=OBJECT

+ 3 - 10
source/FoxDisassembler.Mod

@@ -2,7 +2,6 @@ MODULE FoxDisassembler; (** AUTHOR ""; PURPOSE ""; *)
 
 
 IMPORT Streams, ObjectFile, Scanner := FoxScanner, Basic := FoxBasic, BitSets, D := Debugging, Files, Commands;
 IMPORT Streams, ObjectFile, Scanner := FoxScanner, Basic := FoxBasic, BitSets, D := Debugging, Files, Commands;
 
 
-
 CONST Trace = FALSE;
 CONST Trace = FALSE;
 TYPE
 TYPE
 	Block*= POINTER TO RECORD (ObjectFile.Section)
 	Block*= POINTER TO RECORD (ObjectFile.Section)
@@ -228,7 +227,6 @@ TYPE
 			dataDisplacement := data;
 			dataDisplacement := data;
 		END SetDisplacements;
 		END SetDisplacements;
 
 
-
 	END Disassembler;
 	END Disassembler;
 
 
 	PROCEDURE FindPC*(context: Commands.Context);
 	PROCEDURE FindPC*(context: Commands.Context);
@@ -256,18 +254,14 @@ TYPE
 		END;
 		END;
 	END FindPC;
 	END FindPC;
 
 
-
-
-
-
 	(*
 	(*
 	PROCEDURE Test*(context: Commands.Context);
 	PROCEDURE Test*(context: Commands.Context);
 	VAR filename: Files.FileName; name: ObjectFile.SectionName; block: Block;
 	VAR filename: Files.FileName; name: ObjectFile.SectionName; block: Block;
 	BEGIN
 	BEGIN
 		IF context.arg.GetString(filename) THEN
 		IF context.arg.GetString(filename) THEN
-		file := Files.Old(filename);
-		IF file = NIL THEN (* error *) HALT(100) END;
-		 block := ParseLogFile(filename);
+			file := Files.Old(filename);
+			IF file = NIL THEN (* error *) HALT(100) END;
+			block := ParseLogFile(filename);
 			WHILE block # NIL DO
 			WHILE block # NIL DO
 				Basic.SegmentedNameToString(block.identifier.name, name);
 				Basic.SegmentedNameToString(block.identifier.name, name);
 				context.out.String(name); context.out.String(" at "); context.out.Int(block.alignment,1); context.out.Ln;
 				context.out.String(name); context.out.String(" at "); context.out.Int(block.alignment,1); context.out.Ln;
@@ -281,4 +275,3 @@ END FoxDisassembler.
 
 
 System.FreeDownTo FoxDisassembler ~
 System.FreeDownTo FoxDisassembler ~
 FoxDisassembler.Test ins.log ~
 FoxDisassembler.Test ins.log ~
-

+ 1 - 16
source/FoxDocumentationBackend.Mod

@@ -131,8 +131,6 @@ The following describes how a documentation is generated from a module:
 
 
 **)
 **)
 
 
-
-
 IMPORT Basic := FoxBasic, SyntaxTree := FoxSyntaxTree, Global := FoxGlobal, Scanner := FoxScanner, Backend := FoxBackend, Formats := FoxFormats,
 IMPORT Basic := FoxBasic, SyntaxTree := FoxSyntaxTree, Global := FoxGlobal, Scanner := FoxScanner, Backend := FoxBackend, Formats := FoxFormats,
 		Options, Streams, Strings, SymbolFileFormat := FoxTextualSymbolFile, Diagnostics,
 		Options, Streams, Strings, SymbolFileFormat := FoxTextualSymbolFile, Diagnostics,
 		DocumentationTree := FoxDocumentationTree, DocumentationPrinter := FoxDocumentationPrinter, DocumentationHtml := FoxDocumentationHtml, DocumentationParser := FoxDocumentationParser, DocumentationScanner := FoxDocumentationScanner,
 		DocumentationTree := FoxDocumentationTree, DocumentationPrinter := FoxDocumentationPrinter, DocumentationHtml := FoxDocumentationHtml, DocumentationParser := FoxDocumentationParser, DocumentationScanner := FoxDocumentationScanner,
@@ -778,7 +776,6 @@ TYPE
 			RETURN FALSE
 			RETURN FALSE
 		END NeedsSection;
 		END NeedsSection;
 
 
-
 		PROCEDURE ExtractParameters(x: SyntaxTree.ProcedureType; doc: DocumentationTree.Document; VAR parameters: DocumentationTree.Document);
 		PROCEDURE ExtractParameters(x: SyntaxTree.ProcedureType; doc: DocumentationTree.Document; VAR parameters: DocumentationTree.Document);
 		VAR par: SyntaxTree.Parameter; paragraph,heading: DocumentationTree.Paragraph; i: LONGINT; element: DocumentationTree.TextElement;
 		VAR par: SyntaxTree.Parameter; paragraph,heading: DocumentationTree.Paragraph; i: LONGINT; element: DocumentationTree.TextElement;
 			string: DocumentationTree.String; id: SyntaxTree.Identifier; done: BOOLEAN;
 			string: DocumentationTree.String; id: SyntaxTree.Identifier; done: BOOLEAN;
@@ -818,7 +815,6 @@ TYPE
 			END;
 			END;
 		END ExtractParameters;
 		END ExtractParameters;
 
 
-
 		PROCEDURE WriteSymbolSection(x: SyntaxTree.Symbol);
 		PROCEDURE WriteSymbolSection(x: SyntaxTree.Symbol);
 		VAR section: DocumentationTree.Section; paragraph: DocumentationTree.Paragraph; commentDoc: DocumentationTree.Document;
 		VAR section: DocumentationTree.Section; paragraph: DocumentationTree.Paragraph; commentDoc: DocumentationTree.Document;
 			parameters: DocumentationTree.Document;
 			parameters: DocumentationTree.Document;
@@ -828,7 +824,6 @@ TYPE
 
 
 				parameterDocument := NIL;
 				parameterDocument := NIL;
 
 
-
 				IF x.comment # NIL THEN
 				IF x.comment # NIL THEN
 					commentDoc := DocumentationTree.NewDocument();
 					commentDoc := DocumentationTree.NewDocument();
 					ParseComments(commentDoc,x.comment, NIL,x);
 					ParseComments(commentDoc,x.comment, NIL,x);
@@ -1008,7 +1003,6 @@ TYPE
 			current.text.WriteWhitespace
 			current.text.WriteWhitespace
 		END Whitespace;
 		END Whitespace;
 
 
-
 		PROCEDURE VisitOperator*(x: SyntaxTree.Operator);
 		PROCEDURE VisitOperator*(x: SyntaxTree.Operator);
 		BEGIN VisitProcedure(x);
 		BEGIN VisitProcedure(x);
 		END VisitOperator;
 		END VisitOperator;
@@ -1088,7 +1082,6 @@ TYPE
 
 
 			paragraph: DocumentationTree.Paragraph;
 			paragraph: DocumentationTree.Paragraph;
 
 
-
 		BEGIN
 		BEGIN
 			prevScope := current.scope;
 			prevScope := current.scope;
 			current.scope := x;
 			current.scope := x;
@@ -1098,7 +1091,6 @@ TYPE
 			paragraph := paragraphs.AppendNew(ParagraphType.Table);
 			paragraph := paragraphs.AppendNew(ParagraphType.Table);
 			current.text := paragraph.text;
 			current.text := paragraph.text;
 
 
-
 			short := TRUE;
 			short := TRUE;
 
 
 			IF x IS SyntaxTree.ModuleScope THEN
 			IF x IS SyntaxTree.ModuleScope THEN
@@ -1516,8 +1508,6 @@ TYPE
 		text.WriteLabel(label);
 		text.WriteLabel(label);
 	END WriteSymbolLabel;
 	END WriteSymbolLabel;
 
 
-
-
 	PROCEDURE WriteReferenceInScope*(text: DocumentationTree.Text; symbol: SyntaxTree.Symbol; inScope: SyntaxTree.Scope);
 	PROCEDURE WriteReferenceInScope*(text: DocumentationTree.Text; symbol: SyntaxTree.Symbol; inScope: SyntaxTree.Scope);
 	VAR n: SyntaxTree.IdentifierString; td: SyntaxTree.TypeDeclaration; name: Basic.SectionName; write: BOOLEAN;
 	VAR n: SyntaxTree.IdentifierString; td: SyntaxTree.TypeDeclaration; name: Basic.SectionName; write: BOOLEAN;
 		PROCEDURE Scope(scope: SyntaxTree.Scope);
 		PROCEDURE Scope(scope: SyntaxTree.Scope);
@@ -1589,7 +1579,7 @@ TYPE
 	BEGIN
 	BEGIN
 		description := document.description;
 		description := document.description;
 		FOR i := document.sections.Length()-1 TO 0 BY -1 DO
 		FOR i := document.sections.Length()-1 TO 0 BY -1 DO
-		 section := document.sections.GetSection(i);
+			section := document.sections.GetSection(i);
 			IF (section.label # NIL) THEN
 			IF (section.label # NIL) THEN
 				IF section.label^= "author" THEN
 				IF section.label^= "author" THEN
 					par := description.AppendNew(ParagraphType.Heading);
 					par := description.AppendNew(ParagraphType.Heading);
@@ -1781,15 +1771,12 @@ TYPE
 
 
 	END MergeSectionDocument;
 	END MergeSectionDocument;
 
 
-
 	PROCEDURE Get*(): Backend.Backend;
 	PROCEDURE Get*(): Backend.Backend;
 	VAR documentationBackend: DocumentationBackend;
 	VAR documentationBackend: DocumentationBackend;
 	BEGIN
 	BEGIN
 		NEW(documentationBackend); RETURN documentationBackend;
 		NEW(documentationBackend); RETURN documentationBackend;
 	END Get;
 	END Get;
 
 
-
-
 END FoxDocumentationBackend.
 END FoxDocumentationBackend.
 
 
 ~~
 ~~
@@ -1816,12 +1803,10 @@ The following is a bulleted list
 	\* Bullet1
 	\* Bullet1
 	\* Bullet2
 	\* Bullet2
 
 
-
 	This is  a normal text with *
 	This is  a normal text with *
 
 
 There may be references like this: [[Get|FoxDocumentationBackend.Get]]
 There may be references like this: [[Get|FoxDocumentationBackend.Get]]
 
 
-
 *)
 *)
 
 
 System.Free FoxDocumentationHtml FoxDocumentationBackend FoxDocumentationParser FoxDocumentationPrinter FoxDocumentationTree FoxDocumentationScanner ~
 System.Free FoxDocumentationHtml FoxDocumentationBackend FoxDocumentationParser FoxDocumentationPrinter FoxDocumentationTree FoxDocumentationScanner ~

+ 7 - 10
source/FoxDocumentationHtml.Mod

@@ -168,7 +168,7 @@ TYPE
 			|ElementType.Link:
 			|ElementType.Link:
 				writer.String('<a href="'); writer.String("#"); WriteString(writer,textElement.string);  writer.String('">');
 				writer.String('<a href="'); writer.String("#"); WriteString(writer,textElement.string);  writer.String('">');
 				IF textElement.text.Length()#0 THEN
 				IF textElement.text.Length()#0 THEN
-					 Text(textElement.text);
+					Text(textElement.text);
 				ELSE WriteString( writer, textElement.string);
 				ELSE WriteString( writer, textElement.string);
 				END;
 				END;
 				writer.String("</a>");
 				writer.String("</a>");
@@ -179,7 +179,6 @@ TYPE
 			END;
 			END;
 		END TextElement;
 		END TextElement;
 
 
-
 		PROCEDURE Text*(text: Tree.Text);
 		PROCEDURE Text*(text: Tree.Text);
 		VAR element: Tree.TextElement; i: LONGINT;
 		VAR element: Tree.TextElement; i: LONGINT;
 		BEGIN
 		BEGIN
@@ -201,25 +200,25 @@ TYPE
 				normal {
 				normal {
 				font-family: Helvetica, Sans-Serif;
 				font-family: Helvetica, Sans-Serif;
 				}
 				}
-			  .bold {
+			.bold {
 				font-family: Helvetica, Sans-Serif;
 				font-family: Helvetica, Sans-Serif;
 				}
 				}
-			  H1 {
+			H1 {
 				color: #550088
 				color: #550088
 				}
 				}
-			  H2 {
+			H2 {
 				font-family: Helvetica, Sans-Serif;
 				font-family: Helvetica, Sans-Serif;
 				color: #550088
 				color: #550088
 				}
 				}
-			  H3 {
+			H3 {
 				font-family: Helvetica, Sans-Serif;
 				font-family: Helvetica, Sans-Serif;
 				color: #550088
 				color: #550088
 				}
 				}
-			  H4 {
+			H4 {
 				font-family: Helvetica, Sans-Serif;
 				font-family: Helvetica, Sans-Serif;
 				color: #550088
 				color: #550088
 				}
 				}
-			  A {
+			A {
 				color: #550088
 				color: #550088
 				}
 				}
 				</style>
 				</style>
@@ -240,5 +239,3 @@ TYPE
 	END Printer;
 	END Printer;
 
 
 END FoxDocumentationHtml.
 END FoxDocumentationHtml.
-
-

+ 1 - 2
source/FoxDocumentationParser.Mod

@@ -51,7 +51,7 @@
 	Target        = word.
 	Target        = word.
 
 
 	URL           = "[[" url "]]" |
 	URL           = "[[" url "]]" |
-	                "[[" url "|" {TextElement} "]]".
+			"[[" url "|" {TextElement} "]]".
 
 
 	Label         = "<<" Target ">>".
 	Label         = "<<" Target ">>".
 
 
@@ -309,5 +309,4 @@ CONST Trace = FALSE;
 
 
 		END Parser;
 		END Parser;
 
 
-
 END FoxDocumentationParser.
 END FoxDocumentationParser.

+ 0 - 3
source/FoxDocumentationScanner.Mod

@@ -2,7 +2,6 @@ MODULE FoxDocumentationScanner; (** AUTHOR ""; PURPOSE ""; *)
 
 
 IMPORT Streams, Diagnostics, D := Debugging;
 IMPORT Streams, Diagnostics, D := Debugging;
 
 
-
 CONST
 CONST
 	(* scanner constants *)
 	(* scanner constants *)
 	EOT* = 0X; LF* = 0AX; CR* = 0DX;
 	EOT* = 0X; LF* = 0AX; CR* = 0DX;
@@ -194,7 +193,6 @@ TYPE
 				RETURN ~IsWhitespace(prev,TRUE) & IsWhitespace(Peek(),TRUE)
 				RETURN ~IsWhitespace(prev,TRUE) & IsWhitespace(Peek(),TRUE)
 			END IsRight;
 			END IsRight;
 
 
-
 		BEGIN
 		BEGIN
 			symbol.stringLength := 0;
 			symbol.stringLength := 0;
 			symbol.string := NIL;
 			symbol.string := NIL;
@@ -212,7 +210,6 @@ TYPE
 				RETURN
 				RETURN
 			END;
 			END;
 
 
-
 			CASE ch OF  (* ch > " " *)
 			CASE ch OF  (* ch > " " *)
 			EOT: symbol.token := Token.EndOfText
 			EOT: symbol.token := Token.EndOfText
 			| CR: symbol.token := Token.NewLine; GetNextCharacter; IF ch = LF THEN GetNextCharacter END;
 			| CR: symbol.token := Token.NewLine; GetNextCharacter; IF ch = LF THEN GetNextCharacter END;

+ 1 - 8
source/FoxDocumentationTree.Mod

@@ -21,7 +21,6 @@ MODULE FoxDocumentationTree;
 		of the documentation rules and how they are parsed.
 		of the documentation rules and how they are parsed.
 **)
 **)
 
 
-
 IMPORT Basic := FoxBasic, Scanner := FoxDocumentationScanner, Strings;
 IMPORT Basic := FoxBasic, Scanner := FoxDocumentationScanner, Strings;
 
 
 TYPE
 TYPE
@@ -59,7 +58,6 @@ TYPE
 
 
 	END TextElement;
 	END TextElement;
 
 
-
 	(**
 	(**
 		Comment of Text
 		Comment of Text
 		@docuEBNF EBNF
 		@docuEBNF EBNF
@@ -105,7 +103,6 @@ TYPE
 			e := AppendNew(ElementType.Whitespace);
 			e := AppendNew(ElementType.Whitespace);
 		END WriteWhitespace;
 		END WriteWhitespace;
 
 
-
 		PROCEDURE WriteLink*(CONST name, label: ARRAY OF CHAR);
 		PROCEDURE WriteLink*(CONST name, label: ARRAY OF CHAR);
 		VAR e: TextElement;
 		VAR e: TextElement;
 		BEGIN
 		BEGIN
@@ -181,13 +178,11 @@ TYPE
 		BEGIN SELF.level := level
 		BEGIN SELF.level := level
 		END SetLevel;
 		END SetLevel;
 
 
-
 	END Paragraph;
 	END Paragraph;
 
 
-
 	(**
 	(**
 		@docuEBNF
 		@docuEBNF
-		 {{{ Paragraphs = {Paragraph}. }}}
+		{{{ Paragraphs = {Paragraph}. }}}
 	*)
 	*)
 	Paragraphs*=OBJECT (Basic.List)
 	Paragraphs*=OBJECT (Basic.List)
 
 
@@ -294,7 +289,6 @@ TYPE
 
 
 	END Sections;
 	END Sections;
 
 
-
 	(** a document provides the documentation of a module in a structured way *)
 	(** a document provides the documentation of a module in a structured way *)
 	(**
 	(**
 		@docuEBNF
 		@docuEBNF
@@ -349,7 +343,6 @@ TYPE
 		BEGIN NEW(documents,4)
 		BEGIN NEW(documents,4)
 		END InitDocumentation;
 		END InitDocumentation;
 
 
-
 	END Documentation;
 	END Documentation;
 
 
 	PROCEDURE NewText*(): Text;
 	PROCEDURE NewText*(): Text;

+ 16 - 23
source/FoxFingerprinter.Mod

@@ -15,7 +15,7 @@ IMPORT SyntaxTree := FoxSyntaxTree, Basic := FoxBasic, SYSTEM, Global := FoxGlob
 	Value(fp)                  = fp <*> fpTrue | fp <*> fpFalse | fp <*> integer  | fp <*> intlow <*> inthigh | fp -> Name
 	Value(fp)                  = fp <*> fpTrue | fp <*> fpFalse | fp <*> integer  | fp <*> intlow <*> inthigh | fp -> Name
 	FP(Type)                   = FP(BasicType) | FP(RecordType) | FP(PointerType)
 	FP(Type)                   = FP(BasicType) | FP(RecordType) | FP(PointerType)
 
 
-                           	 	| FP(ArrayType) | FP(MathArrayType) | FP(ProcedurType)
+                           		| FP(ArrayType) | FP(MathArrayType) | FP(ProcedurType)
 
 
 	FP(BasicType)              = fpTypeChar8 | fpTypeChar16 | fpTypeChar32
 	FP(BasicType)              = fpTypeChar8 | fpTypeChar16 | fpTypeChar32
 	                            | fpTypeShortint | fpTypeInteger | fpTypeLongint | fpTypeHugeint
 	                            | fpTypeShortint | fpTypeInteger | fpTypeLongint | fpTypeHugeint
@@ -59,7 +59,6 @@ IMPORT SyntaxTree := FoxSyntaxTree, Basic := FoxBasic, SYSTEM, Global := FoxGlob
 	                            <*> FP(parameterType) [-> Name(parameterName)]  }
 	                            <*> FP(parameterType) [-> Name(parameterName)]  }
 **)
 **)
 
 
-
 CONST
 CONST
 	(*Fingerprints/Obj Modes*)
 	(*Fingerprints/Obj Modes*)
 	fpModeVar=1;
 	fpModeVar=1;
@@ -387,7 +386,6 @@ TYPE
 			deep := SELF.deep;
 			deep := SELF.deep;
 			IF Trace THEN TraceEnter("MathArrayType") END;
 			IF Trace THEN TraceEnter("MathArrayType") END;
 
 
-
 			IF ~fingerprint.shallowAvailable THEN
 			IF ~fingerprint.shallowAvailable THEN
 				fingerprint.shallowAvailable := TRUE; (* the fingerprinting may return to itself => avoid circles *)
 				fingerprint.shallowAvailable := TRUE; (* the fingerprinting may return to itself => avoid circles *)
 				SELF.deep := FALSE;
 				SELF.deep := FALSE;
@@ -431,16 +429,16 @@ TYPE
 		VAR  typeDeclaration: SyntaxTree.TypeDeclaration;
 		VAR  typeDeclaration: SyntaxTree.TypeDeclaration;
 		BEGIN
 		BEGIN
 			IF (x.scope # NIL) THEN
 			IF (x.scope # NIL) THEN
-				 (* only executed for imported types, reason:
-				 	modification of a type name would result in modified fingerprint leading to modified fingerprints of using structures such as
-				 	in the following example:
-				 	TYPE A=ARRAY 32 OF CHAR;
-				 	PROCEDURE P*(a:A);
-				 	...
-				 	END P;
-				 	IF name of A was changed, P would get a new fingerprint.
-				 	Better: fingerprint of P only depends in type of A but not on its declared name.
-				 *)
+				(* only executed for imported types, reason:
+					modification of a type name would result in modified fingerprint leading to modified fingerprints of using structures such as
+					in the following example:
+					TYPE A=ARRAY 32 OF CHAR;
+					PROCEDURE P*(a:A);
+					...
+					END P;
+					IF name of A was changed, P would get a new fingerprint.
+					Better: fingerprint of P only depends in type of A but not on its declared name.
+				*)
 				IF Trace THEN
 				IF Trace THEN
 					TraceIndent;
 					TraceIndent;
 					D.Str("TypeName  ");
 					D.Str("TypeName  ");
@@ -510,7 +508,6 @@ TYPE
 				SELF.deep := deep;
 				SELF.deep := deep;
 			END;
 			END;
 
 
-
 			IF Trace THEN TraceExit("PointerType",fingerprint) END;
 			IF Trace THEN TraceExit("PointerType",fingerprint) END;
 
 
 			SELF.fingerprint := fingerprint;
 			SELF.fingerprint := fingerprint;
@@ -885,10 +882,10 @@ TYPE
 			DEC(level);
 			DEC(level);
 		END FPType;
 		END FPType;
 
 
-		(* 	Signature(f)  = f <*> FP(returnType)
-	                      { <*> (fpModeVarParameter | fpModeConstParameter | fpModePar)
-	                      <*> FP(parameterType) [-> Name(parameterName)]  }
-		 *)
+		(*	Signature(f)  = f <*> FP(returnType)
+			{ <*> (fpModeVarParameter | fpModeConstParameter | fpModePar)
+			<*> FP(parameterType) [-> Name(parameterName)]  }
+		*)
 		PROCEDURE FPSignature(VAR fp: Basic.Fingerprint; t: SyntaxTree.ProcedureType; isOperator: BOOLEAN);
 		PROCEDURE FPSignature(VAR fp: Basic.Fingerprint; t: SyntaxTree.ProcedureType; isOperator: BOOLEAN);
 		VAR par,self: SyntaxTree.Parameter; deep: BOOLEAN;
 		VAR par,self: SyntaxTree.Parameter; deep: BOOLEAN;
 
 
@@ -1082,7 +1079,6 @@ TYPE
 			VisitVariable(x);
 			VisitVariable(x);
 		END VisitProperty;
 		END VisitProperty;
 
 
-
 		(*
 		(*
 			FP(ParameterDeclaration)    = 0 <*> fpModePar -> Name -> Visibility <*> FP(Type).
 			FP(ParameterDeclaration)    = 0 <*> fpModePar -> Name -> Visibility <*> FP(Type).
 		*)
 		*)
@@ -1113,7 +1109,7 @@ TYPE
 
 
 		(*
 		(*
 		FP(ProcedureDeclaration)   = 0 <*> fpModeInlineProcedure -> Name -> Visibility <*> FP(Type) -> Code.
 		FP(ProcedureDeclaration)   = 0 <*> fpModeInlineProcedure -> Name -> Visibility <*> FP(Type) -> Code.
-		                            | 0 <*> fpModeExportedProcedure -> Name -> Visibility <*> FP(Type)
+						| 0 <*> fpModeExportedProcedure -> Name -> Visibility <*> FP(Type)
 		*)
 		*)
 		PROCEDURE VisitProcedure*(x: SyntaxTree.Procedure);
 		PROCEDURE VisitProcedure*(x: SyntaxTree.Procedure);
 		VAR fp: Basic.Fingerprint; access: SET; fingerprint: SyntaxTree.Fingerprint; deep: BOOLEAN; code: SyntaxTree.Code; i: LONGINT;
 		VAR fp: Basic.Fingerprint; access: SET; fingerprint: SyntaxTree.Fingerprint; deep: BOOLEAN; code: SyntaxTree.Code; i: LONGINT;
@@ -1267,7 +1263,6 @@ TYPE
 			D.Str(" "); D.Hex(fingerprint.public,0);
 			D.Str(" "); D.Hex(fingerprint.public,0);
 		END TraceFP;
 		END TraceFP;
 
 
-
 		(* returns the finger print (object) of a type *)
 		(* returns the finger print (object) of a type *)
 		PROCEDURE TypeFP*(this: SyntaxTree.Type): SyntaxTree.Fingerprint;
 		PROCEDURE TypeFP*(this: SyntaxTree.Type): SyntaxTree.Fingerprint;
 		VAR deep: BOOLEAN;
 		VAR deep: BOOLEAN;
@@ -1306,7 +1301,6 @@ TYPE
 
 
 	END Fingerprinter;
 	END Fingerprinter;
 
 
-
 	(** ---------- Fingerprinting primitives -------------- *)
 	(** ---------- Fingerprinting primitives -------------- *)
 	PROCEDURE IsOberonProcedure(type: SyntaxTree.ProcedureType): BOOLEAN;
 	PROCEDURE IsOberonProcedure(type: SyntaxTree.ProcedureType): BOOLEAN;
 	BEGIN
 	BEGIN
@@ -1363,5 +1357,4 @@ TYPE
 		w.Ln;
 		w.Ln;
 	END DumpFingerprint;
 	END DumpFingerprint;
 
 
-
 END FoxFingerprinter.
 END FoxFingerprinter.

+ 1 - 1
source/FoxFormats.Mod

@@ -180,4 +180,4 @@ TYPE
 		ASSERT(b);
 		ASSERT(b);
 	END Assert;
 	END Assert;
 
 
-END FoxFormats.
+END FoxFormats.

+ 6 - 12
source/FoxGenericObjectFile.Mod

@@ -38,7 +38,6 @@ TYPE ObjectFileFormat* = OBJECT (Formats.ObjectFileFormat)
 			Init; SetExtension(ObjectFile.DefaultExtension);
 			Init; SetExtension(ObjectFile.DefaultExtension);
 		END InitObjectFileFormat;
 		END InitObjectFileFormat;
 
 
-
 		PROCEDURE Export* (module: Formats.GeneratedModule; symbolFileFormat: Formats.SymbolFileFormat): BOOLEAN;
 		PROCEDURE Export* (module: Formats.GeneratedModule; symbolFileFormat: Formats.SymbolFileFormat): BOOLEAN;
 		VAR fileName: Files.FileName; file: Files.File; writer: Files.Writer; fingerprinter: Fingerprinter.Fingerprinter; poolMap: ObjectFile.PoolMap;
 		VAR fileName: Files.FileName; file: Files.File; writer: Files.Writer; fingerprinter: Fingerprinter.Fingerprinter; poolMap: ObjectFile.PoolMap;
 
 
@@ -167,7 +166,6 @@ TYPE ObjectFileFormat* = OBJECT (Formats.ObjectFileFormat)
 					END;
 					END;
 				END;
 				END;
 
 
-
 				IF codeSection # NIL THEN
 				IF codeSection # NIL THEN
 					UpdateAliases (codeSection, fingerprinter);
 					UpdateAliases (codeSection, fingerprinter);
 					irSection := IntermediateCode.NewSection(sections, SHORTINT(codeSection.os.type), codeSection.os.identifier.name, NIL, FALSE);
 					irSection := IntermediateCode.NewSection(sections, SHORTINT(codeSection.os.type), codeSection.os.identifier.name, NIL, FALSE);
@@ -340,8 +338,6 @@ TYPE ObjectFileFormat* = OBJECT (Formats.ObjectFileFormat)
 		BEGIN RETURN SymbolFileFormat.Get();
 		BEGIN RETURN SymbolFileFormat.Get();
 		END DefaultSymbolFileFormat;
 		END DefaultSymbolFileFormat;
 
 
-
-
 	END ObjectFileFormat;
 	END ObjectFileFormat;
 
 
 	PROCEDURE GetFingerprint (section: Sections.Section; fingerprinter: Fingerprinter.Fingerprinter): ObjectFile.Fingerprint;
 	PROCEDURE GetFingerprint (section: Sections.Section; fingerprinter: Fingerprinter.Fingerprinter): ObjectFile.Fingerprint;
@@ -382,7 +378,6 @@ TYPE ObjectFileFormat* = OBJECT (Formats.ObjectFileFormat)
 		END;
 		END;
 	END CheckAlias;
 	END CheckAlias;
 
 
-
 	PROCEDURE CopyFixups(sections: Sections.SectionList; from, to: BinaryCode.Section; offset: LONGINT);
 	PROCEDURE CopyFixups(sections: Sections.SectionList; from, to: BinaryCode.Section; offset: LONGINT);
 	VAR fixup: BinaryCode.Fixup; i, index, fixups: SIZE; fixupList: ObjectFile.Fixups;
 	VAR fixup: BinaryCode.Fixup; i, index, fixups: SIZE; fixupList: ObjectFile.Fixups;
 		aliasSymbol: ObjectFile.Identifier; aliasOffset: LONGINT;
 		aliasSymbol: ObjectFile.Identifier; aliasOffset: LONGINT;
@@ -628,12 +623,12 @@ TYPE ObjectFileFormat* = OBJECT (Formats.ObjectFileFormat)
 		is: IntermediateCode.Section;
 		is: IntermediateCode.Section;
 		sectionList: Sections.SectionList;
 		sectionList: Sections.SectionList;
 		section: ObjectFile.Section;
 		section: ObjectFile.Section;
-		 i: LONGINT;
-		 dest: Files.FileName;
-		 writer: Files.Writer;
-		 name: ObjectFile.SegmentedName;
-		 version: WORD;
-		 offers, requires: ObjectFile.NameList;
+		i: LONGINT;
+		dest: Files.FileName;
+		writer: Files.Writer;
+		name: ObjectFile.SegmentedName;
+		version: WORD;
+		offers, requires: ObjectFile.NameList;
 	BEGIN
 	BEGIN
 		NEW(sectionList);
 		NEW(sectionList);
 		IF context.arg.GetString(dest) THEN
 		IF context.arg.GetString(dest) THEN
@@ -672,7 +667,6 @@ TYPE ObjectFileFormat* = OBJECT (Formats.ObjectFileFormat)
 		END;
 		END;
 	END MakeLibrary;
 	END MakeLibrary;
 
 
-
 	PROCEDURE Statistics*;
 	PROCEDURE Statistics*;
 	VAR iterator: Basic.IntIterator; stat: SectionStat; index: StringPool.Index; any: ANY;
 	VAR iterator: Basic.IntIterator; stat: SectionStat; index: StringPool.Index; any: ANY;
 	BEGIN
 	BEGIN

+ 0 - 15
source/FoxGlobal.Mod

@@ -215,7 +215,6 @@ TYPE
 		min, max: LONGINT; (* alignments in bits *)
 		min, max: LONGINT; (* alignments in bits *)
 	END;
 	END;
 
 
-
 	PassInRegisterProc = PROCEDURE {DELEGATE} (type: SyntaxTree.Type): BOOLEAN;
 	PassInRegisterProc = PROCEDURE {DELEGATE} (type: SyntaxTree.Type): BOOLEAN;
 
 
 	System*= OBJECT
 	System*= OBJECT
@@ -248,7 +247,6 @@ TYPE
 		addressType-, sizeType-, shortintType-, integerType-, longintType-, hugeintType-, wordType-, longWordType-, wordSetType-, characterType-, characterType8-, characterType16-, characterType32-, setType-, booleanType-, anyType-,byteType-,
 		addressType-, sizeType-, shortintType-, integerType-, longintType-, hugeintType-, wordType-, longWordType-, wordSetType-, characterType-, characterType8-, characterType16-, characterType32-, setType-, booleanType-, anyType-,byteType-,
 		realType-, longrealType-, complexType-, longcomplexType-, objectType-, nilType-, rangeType-, lenType-: SyntaxTree.Type;
 		realType-, longrealType-, complexType-, longcomplexType-, objectType-, nilType-, rangeType-, lenType-: SyntaxTree.Type;
 
 
-
 		CanPassInRegister-: PassInRegisterProc;
 		CanPassInRegister-: PassInRegisterProc;
 		cellsAreObjects-: BOOLEAN;
 		cellsAreObjects-: BOOLEAN;
 		platformCallingConvention-: SyntaxTree.CallingConvention;
 		platformCallingConvention-: SyntaxTree.CallingConvention;
@@ -280,7 +278,6 @@ TYPE
 			platformCallingConvention := SyntaxTree.UndefinedCallingConvention;
 			platformCallingConvention := SyntaxTree.UndefinedCallingConvention;
 		END InitSystem;
 		END InitSystem;
 
 
-
 		PROCEDURE SetPlatformCallingConvention*(callingConvention: SyntaxTree.CallingConvention);
 		PROCEDURE SetPlatformCallingConvention*(callingConvention: SyntaxTree.CallingConvention);
 		BEGIN
 		BEGIN
 			platformCallingConvention := callingConvention;
 			platformCallingConvention := callingConvention;
@@ -290,13 +287,11 @@ TYPE
 			cellsAreObjects := c;
 			cellsAreObjects := c;
 		END SetCellsAreObjects;
 		END SetCellsAreObjects;
 
 
-
 		PROCEDURE SetRegisterPassCallback*(canPassInRegister: PassInRegisterProc);
 		PROCEDURE SetRegisterPassCallback*(canPassInRegister: PassInRegisterProc);
 		BEGIN
 		BEGIN
 			CanPassInRegister := canPassInRegister;
 			CanPassInRegister := canPassInRegister;
 		END SetRegisterPassCallback;
 		END SetRegisterPassCallback;
 
 
-
 		PROCEDURE AddCapability*(name: SyntaxTree.Identifier);
 		PROCEDURE AddCapability*(name: SyntaxTree.Identifier);
 		VAR symbol: SyntaxTree.Symbol;
 		VAR symbol: SyntaxTree.Symbol;
 		BEGIN
 		BEGIN
@@ -437,7 +432,6 @@ TYPE
 
 
 		END GenerateCellOffsets;
 		END GenerateCellOffsets;
 
 
-
 		PROCEDURE GenerateVariableOffsets*(scope: SyntaxTree.Scope): BOOLEAN;
 		PROCEDURE GenerateVariableOffsets*(scope: SyntaxTree.Scope): BOOLEAN;
 		VAR variable: SyntaxTree.Variable; offset,size: LONGINT; alignment: LONGINT;
 		VAR variable: SyntaxTree.Variable; offset,size: LONGINT; alignment: LONGINT;
 		BEGIN
 		BEGIN
@@ -529,7 +523,6 @@ TYPE
 			RETURN TRUE
 			RETURN TRUE
 		END GenerateParameterOffsets;
 		END GenerateParameterOffsets;
 
 
-
 		PROCEDURE SizeOf*(type: SyntaxTree.Type): LONGINT;
 		PROCEDURE SizeOf*(type: SyntaxTree.Type): LONGINT;
 		VAR size: LONGINT; base: SyntaxTree.Type;
 		VAR size: LONGINT; base: SyntaxTree.Type;
 		BEGIN
 		BEGIN
@@ -934,7 +927,6 @@ TYPE
 		NewBuiltin(IncMul,"INCMUL",system.globalScope,TRUE);
 		NewBuiltin(IncMul,"INCMUL",system.globalScope,TRUE);
 		NewBuiltin(DecMul,"DECMUL",system.globalScope,TRUE);
 		NewBuiltin(DecMul,"DECMUL",system.globalScope,TRUE);
 
 
-
 		(*!
 		(*!
 
 
        (* Following is LYNX version: *)
        (* Following is LYNX version: *)
@@ -943,7 +935,6 @@ TYPE
             system.characterType := Character16;
             system.characterType := Character16;
         END;
         END;
 
 
-
         (* LYNX builtin types *)
         (* LYNX builtin types *)
         DeclareLynxType(system.characterType, LynxChar, system.globalScope);
         DeclareLynxType(system.characterType, LynxChar, system.globalScope);
         DeclareLynxType(system.shortintType, LynxSbyte, system.globalScope);
         DeclareLynxType(system.shortintType, LynxSbyte, system.globalScope);
@@ -1054,7 +1045,6 @@ TYPE
 		RETURN value;
 		RETURN value;
 	END AlignedSizeOf;
 	END AlignedSizeOf;
 
 
-
 	(* returns if a module is the system module *)
 	(* returns if a module is the system module *)
 	PROCEDURE IsSystemModule*(module: SyntaxTree.Module): BOOLEAN;
 	PROCEDURE IsSystemModule*(module: SyntaxTree.Module): BOOLEAN;
 	BEGIN RETURN (module.name=systemName) OR (module.name=SystemName)
 	BEGIN RETURN (module.name=systemName) OR (module.name=SystemName)
@@ -1325,7 +1315,6 @@ TYPE
 		RETURN symbol;
 		RETURN symbol;
 	END FindSymbol;
 	END FindSymbol;
 
 
-
 	PROCEDURE GetSymbolNameInScope*(symbol: SyntaxTree.Symbol; inScope: SyntaxTree.Scope; VAR name: ARRAY OF CHAR);
 	PROCEDURE GetSymbolNameInScope*(symbol: SyntaxTree.Symbol; inScope: SyntaxTree.Scope; VAR name: ARRAY OF CHAR);
 	VAR n: SyntaxTree.IdentifierString; td: SyntaxTree.TypeDeclaration;
 	VAR n: SyntaxTree.IdentifierString; td: SyntaxTree.TypeDeclaration;
 		PROCEDURE Scope(scope: SyntaxTree.Scope);
 		PROCEDURE Scope(scope: SyntaxTree.Scope);
@@ -1400,13 +1389,11 @@ TYPE
 		Basic.SuffixSegmentedName(pooledName, symbol.name);
 		Basic.SuffixSegmentedName(pooledName, symbol.name);
 	END GetSymbolSegmentedNameInScope;
 	END GetSymbolSegmentedNameInScope;
 
 
-
 	PROCEDURE GetSymbolSegmentedName*(symbol: SyntaxTree.Symbol; VAR pooledName: Basic.SegmentedName);
 	PROCEDURE GetSymbolSegmentedName*(symbol: SyntaxTree.Symbol; VAR pooledName: Basic.SegmentedName);
 	BEGIN
 	BEGIN
 		GetSymbolSegmentedNameInScope(symbol,NIL,pooledName);
 		GetSymbolSegmentedNameInScope(symbol,NIL,pooledName);
 	END GetSymbolSegmentedName;
 	END GetSymbolSegmentedName;
 
 
-
 	PROCEDURE Level*(t: SyntaxTree.Type): LONGINT;
 	PROCEDURE Level*(t: SyntaxTree.Type): LONGINT;
 	VAR level: LONGINT;
 	VAR level: LONGINT;
 	BEGIN
 	BEGIN
@@ -1654,7 +1641,6 @@ TYPE
 		RETURN -1
 		RETURN -1
 	END GetSymbol;
 	END GetSymbol;
 
 
-
 	PROCEDURE InitIdentifiers;
 	PROCEDURE InitIdentifiers;
 	VAR i: LONGINT;
 	VAR i: LONGINT;
 
 
@@ -1717,7 +1703,6 @@ TYPE
 		NewBuiltinIdentifier(IncMul,"INCMUL");
 		NewBuiltinIdentifier(IncMul,"INCMUL");
 		NewBuiltinIdentifier(DecMul,"DECMUL");
 		NewBuiltinIdentifier(DecMul,"DECMUL");
 
 
-
 		(* TODO: check if ok. The operators defined in FoxArrayBase require the following identifiers *)
 		(* TODO: check if ok. The operators defined in FoxArrayBase require the following identifiers *)
 		(* TODO: ".*+" should preferably be added as a new token in the scanner *)
 		(* TODO: ".*+" should preferably be added as a new token in the scanner *)
 		identifiers[Scanner.Lowercase, Scanner.Becomes] := SyntaxTree.NewIdentifier(":=");
 		identifiers[Scanner.Lowercase, Scanner.Becomes] := SyntaxTree.NewIdentifier(":=");

+ 0 - 3
source/FoxInterfaceComparison.Mod

@@ -78,7 +78,6 @@ CONST
 		RETURN symbol
 		RETURN symbol
 	END NextSymbol;
 	END NextSymbol;
 
 
-
 	PROCEDURE CompareScopes(new,old: SyntaxTree.Scope);
 	PROCEDURE CompareScopes(new,old: SyntaxTree.Scope);
 	VAR newSymbol, oldSymbol: SyntaxTree.Symbol;
 	VAR newSymbol, oldSymbol: SyntaxTree.Symbol;
 		newName, oldName: SyntaxTree.IdentifierString;
 		newName, oldName: SyntaxTree.IdentifierString;
@@ -157,6 +156,4 @@ CONST
 		END;
 		END;
 	END CompareThis;
 	END CompareThis;
 
 
-
-
 END FoxInterfaceComparison.
 END FoxInterfaceComparison.

+ 0 - 7
source/FoxIntermediateAssembler.Mod

@@ -99,13 +99,6 @@ TYPE
 
 
 	END Assembler;
 	END Assembler;
 
 
-
-
 END FoxIntermediateAssembler.
 END FoxIntermediateAssembler.
 
 
 System.Free FoxInlineAssembler FoxInlineInstructionSet ~
 System.Free FoxInlineAssembler FoxInlineInstructionSet ~
-
-
-
-
-

+ 51 - 166
source/FoxIntermediateBackend.Mod

@@ -82,8 +82,6 @@ CONST
 			StackLimitOffset* = BaseObjectTypeSize + 3;
 			StackLimitOffset* = BaseObjectTypeSize + 3;
 			QuantumOffset = BaseObjectTypeSize + 4;
 			QuantumOffset = BaseObjectTypeSize + 4;
 
 
-
-
 		(* flags for optimizations with small matricies and vectors (Alexey Morozov) *)
 		(* flags for optimizations with small matricies and vectors (Alexey Morozov) *)
 		SmallMatrixFlag = 3; (* flag for identification of a small matrix *)
 		SmallMatrixFlag = 3; (* flag for identification of a small matrix *)
 		SmallVectorFlag = 3; (* flag for identification of a small vector *)
 		SmallVectorFlag = 3; (* flag for identification of a small vector *)
@@ -111,7 +109,6 @@ CONST
 		SysvABI = {SyntaxTree.CCallingConvention};
 		SysvABI = {SyntaxTree.CCallingConvention};
 		SysvABIorWINAPI = {SyntaxTree.CCallingConvention, SyntaxTree.WinAPICallingConvention};
 		SysvABIorWINAPI = {SyntaxTree.CCallingConvention, SyntaxTree.WinAPICallingConvention};
 
 
-
 TYPE
 TYPE
 	Position=SyntaxTree.Position;
 	Position=SyntaxTree.Position;
 	SupportedInstructionProcedure* = PROCEDURE {DELEGATE} (CONST instr: IntermediateCode.Instruction; VAR moduleName,procedureName: ARRAY OF CHAR): BOOLEAN;
 	SupportedInstructionProcedure* = PROCEDURE {DELEGATE} (CONST instr: IntermediateCode.Instruction; VAR moduleName,procedureName: ARRAY OF CHAR): BOOLEAN;
@@ -131,7 +128,6 @@ TYPE
 		availability: WORD; (* index *)
 		availability: WORD; (* index *)
 	END;
 	END;
 
 
-
 	Fixup= POINTER TO RECORD
 	Fixup= POINTER TO RECORD
 		pc: LONGINT;
 		pc: LONGINT;
 		nextFixup: Fixup;
 		nextFixup: Fixup;
@@ -168,7 +164,6 @@ TYPE
 
 
 	END Label;
 	END Label;
 
 
-
 	ConditionalBranch = PROCEDURE {DELEGATE}(label: Label; op1,op2: IntermediateCode.Operand);
 	ConditionalBranch = PROCEDURE {DELEGATE}(label: Label; op1,op2: IntermediateCode.Operand);
 
 
 	DeclarationVisitor =OBJECT
 	DeclarationVisitor =OBJECT
@@ -313,7 +308,6 @@ TYPE
 					lastUpdated := offset + ToMemoryUnits(system, op.type.sizeInBits);
 					lastUpdated := offset + ToMemoryUnits(system, op.type.sizeInBits);
 			END SingleInitialize;
 			END SingleInitialize;
 
 
-
 			PROCEDURE Initialize(type: SyntaxTree.Type; initializer: SyntaxTree.Expression; offset:LONGINT);
 			PROCEDURE Initialize(type: SyntaxTree.Type; initializer: SyntaxTree.Expression; offset:LONGINT);
 			VAR op: Operand; baseType: SyntaxTree.Type; variable: SyntaxTree.Variable; i: LONGINT; size:LONGINT;
 			VAR op: Operand; baseType: SyntaxTree.Type; variable: SyntaxTree.Variable; i: LONGINT; size:LONGINT;
 			BEGIN
 			BEGIN
@@ -371,7 +365,6 @@ TYPE
 				END;
 				END;
 			END Initialize;
 			END Initialize;
 
 
-
 		BEGIN
 		BEGIN
 			IF x.externalName # NIL THEN RETURN END;
 			IF x.externalName # NIL THEN RETURN END;
 			IF (currentScope IS SyntaxTree.ModuleScope) OR (currentScope IS SyntaxTree.CellScope) & ~backend.cellsAreObjects THEN
 			IF (currentScope IS SyntaxTree.ModuleScope) OR (currentScope IS SyntaxTree.CellScope) & ~backend.cellsAreObjects THEN
@@ -457,7 +450,6 @@ TYPE
 			END;
 			END;
 		END Constant;
 		END Constant;
 
 
-
 		PROCEDURE Scope(x: SyntaxTree.Scope);
 		PROCEDURE Scope(x: SyntaxTree.Scope);
 		VAR procedure: SyntaxTree.Procedure;
 		VAR procedure: SyntaxTree.Procedure;
 			constant: SyntaxTree.Constant;
 			constant: SyntaxTree.Constant;
@@ -471,7 +463,6 @@ TYPE
 			currentScope := x;
 			currentScope := x;
 			(* constants treated in implementation visitor  *)
 			(* constants treated in implementation visitor  *)
 
 
-
 			WITH x: SyntaxTree.CellScope DO
 			WITH x: SyntaxTree.CellScope DO
 				cell := x.ownerCell;
 				cell := x.ownerCell;
 				parameter := cell.firstParameter;
 				parameter := cell.firstParameter;
@@ -884,8 +875,6 @@ TYPE
 			currentScope := prevScope;
 			currentScope := prevScope;
 		END Procedure;
 		END Procedure;
 
 
-
-
 		PROCEDURE AddBodyCallStub(bodyProcedure: SyntaxTree.Procedure); (* code that is only necessary for static linkers *)
 		PROCEDURE AddBodyCallStub(bodyProcedure: SyntaxTree.Procedure); (* code that is only necessary for static linkers *)
 		VAR procedure: SyntaxTree.Procedure; procedureScope: SyntaxTree.ProcedureScope; name: Basic.SegmentedName;
 		VAR procedure: SyntaxTree.Procedure; procedureScope: SyntaxTree.ProcedureScope; name: Basic.SegmentedName;
 			ir: IntermediateCode.Section; op: IntermediateCode.Operand;
 			ir: IntermediateCode.Section; op: IntermediateCode.Operand;
@@ -929,8 +918,6 @@ TYPE
 			ir.Emit(Mov(Basic.invalidPosition,implementationVisitor.sp,op));
 			ir.Emit(Mov(Basic.invalidPosition,implementationVisitor.sp,op));
 		END AddStackAllocation;
 		END AddStackAllocation;
 
 
-
-
 		(** entry function to visit a complete module *)
 		(** entry function to visit a complete module *)
 		PROCEDURE Module(x: SyntaxTree.Module; module: Sections.Module);
 		PROCEDURE Module(x: SyntaxTree.Module; module: Sections.Module);
 		VAR
 		VAR
@@ -972,7 +959,6 @@ TYPE
 				RETURN FALSE
 				RETURN FALSE
 			END ScopeNeedsInitialization;
 			END ScopeNeedsInitialization;
 
 
-
 		BEGIN
 		BEGIN
 			ASSERT(x # NIL); ASSERT(module # NIL);
 			ASSERT(x # NIL); ASSERT(module # NIL);
 			SELF.module := module;
 			SELF.module := module;
@@ -1147,7 +1133,6 @@ TYPE
 			nameIndex := 0;
 			nameIndex := 0;
 		END Clear;
 		END Clear;
 
 
-
 		PROCEDURE GetUID(): SyntaxTree.Identifier;
 		PROCEDURE GetUID(): SyntaxTree.Identifier;
 		VAR string: SyntaxTree.IdentifierString ;
 		VAR string: SyntaxTree.IdentifierString ;
 		BEGIN
 		BEGIN
@@ -1232,9 +1217,6 @@ TYPE
 			RETURN NIL
 			RETURN NIL
 		END GetFreeVariable;
 		END GetFreeVariable;
 
 
-
-
-
 	END Variables;
 	END Variables;
 
 
 	SymbolMap = POINTER TO RECORD
 	SymbolMap = POINTER TO RECORD
@@ -1270,7 +1252,6 @@ TYPE
 
 
 	END SymbolMapper;
 	END SymbolMapper;
 
 
-
 	ImplementationVisitor =OBJECT(SyntaxTree.Visitor)
 	ImplementationVisitor =OBJECT(SyntaxTree.Visitor)
 	VAR
 	VAR
 		system: Global.System;
 		system: Global.System;
@@ -1305,8 +1286,6 @@ TYPE
 		registerUsageCount: RegisterUsageCount;
 		registerUsageCount: RegisterUsageCount;
 		usedRegisters: RegisterEntry;
 		usedRegisters: RegisterEntry;
 
 
-
-
 		(* useful operands and types *)
 		(* useful operands and types *)
 		nil,one,fp,sp,ap,lr,true,false: IntermediateCode.Operand;
 		nil,one,fp,sp,ap,lr,true,false: IntermediateCode.Operand;
 		bool,addressType,setType, sizeType, lenType, byteType: IntermediateCode.Type;
 		bool,addressType,setType, sizeType, lenType, byteType: IntermediateCode.Type;
@@ -1466,7 +1445,6 @@ TYPE
 			Strings.Append(string, "]");
 			Strings.Append(string, "]");
 		END GetFingerprintString;
 		END GetFingerprintString;
 
 
-
 		(** get the name for the code section that represens a certain symbol
 		(** get the name for the code section that represens a certain symbol
 		(essentially the same as Global.GetSymbolName, apart from operators) **)
 		(essentially the same as Global.GetSymbolName, apart from operators) **)
 		PROCEDURE GetCodeSectionNameForSymbol(symbol: SyntaxTree.Symbol; VAR name: Basic.SegmentedName);
 		PROCEDURE GetCodeSectionNameForSymbol(symbol: SyntaxTree.Symbol; VAR name: Basic.SegmentedName);
@@ -1480,7 +1458,6 @@ TYPE
 			END
 			END
 		END GetCodeSectionNameForSymbol;
 		END GetCodeSectionNameForSymbol;
 
 
-
 		PROCEDURE TraceEnter(CONST s: ARRAY OF CHAR);
 		PROCEDURE TraceEnter(CONST s: ARRAY OF CHAR);
 		BEGIN
 		BEGIN
 			IF dump # NIL THEN
 			IF dump # NIL THEN
@@ -1495,7 +1472,6 @@ TYPE
 			END;
 			END;
 		END TraceExit;
 		END TraceExit;
 
 
-
 		PROCEDURE Emit(instruction: IntermediateCode.Instruction);
 		PROCEDURE Emit(instruction: IntermediateCode.Instruction);
 		VAR moduleName, procedureName: SyntaxTree.IdentifierString;
 		VAR moduleName, procedureName: SyntaxTree.IdentifierString;
 
 
@@ -2704,7 +2680,6 @@ TYPE
 			END;
 			END;
 		END CheckRegistersFree;
 		END CheckRegistersFree;
 
 
-
 		(* Reuse2: reuse src1 or src2 for ongoing computation if src1 or src2, respectively, is a register.
 		(* Reuse2: reuse src1 or src2 for ongoing computation if src1 or src2, respectively, is a register.
 			Otherwise allocate a new register.
 			Otherwise allocate a new register.
 			Does NOT necessarily keep the content of src1 or src2 in result! *)
 			Does NOT necessarily keep the content of src1 or src2 in result! *)
@@ -2780,7 +2755,6 @@ TYPE
 			END
 			END
 		END TransferToRegister;
 		END TransferToRegister;
 
 
-
 		(** labels and branches **)
 		(** labels and branches **)
 		PROCEDURE NewLabel(): Label;
 		PROCEDURE NewLabel(): Label;
 		VAR label: Label;
 		VAR label: Label;
@@ -3048,7 +3022,6 @@ TYPE
 					RETURN dim;
 					RETURN dim;
 			END Dimension;
 			END Dimension;
 
 
-
 		BEGIN
 		BEGIN
 			(*static math array not providing pointers anyway *)
 			(*static math array not providing pointers anyway *)
 			variable := GetTemporaryVariable(x.type, FALSE, FALSE (* untraced *));
 			variable := GetTemporaryVariable(x.type, FALSE, FALSE (* untraced *));
@@ -3110,8 +3083,6 @@ TYPE
 			IF Trace THEN TraceExit("VisitUnaryExpression") END;
 			IF Trace THEN TraceExit("VisitUnaryExpression") END;
 		END VisitUnaryExpression;
 		END VisitUnaryExpression;
 
 
-
-
 				(* test if e is of type type, side effect: result of evaluation of e stays in the operand *)
 				(* test if e is of type type, side effect: result of evaluation of e stays in the operand *)
 		PROCEDURE TypeTest(tag: IntermediateCode.Operand; type: SyntaxTree.Type; label: Label; reason: BOOLEAN; withPart: BOOLEAN);
 		PROCEDURE TypeTest(tag: IntermediateCode.Operand; type: SyntaxTree.Type; label: Label; reason: BOOLEAN; withPart: BOOLEAN);
 		VAR left,right: IntermediateCode.Operand; level,offset: LONGINT; repeatL,skip: Label; originalType: SyntaxTree.Type;
 		VAR left,right: IntermediateCode.Operand; level,offset: LONGINT; repeatL,skip: Label; originalType: SyntaxTree.Type;
@@ -3138,12 +3109,12 @@ TYPE
 				right := TypeDescriptorAdr(type);
 				right := TypeDescriptorAdr(type);
 
 
 				IF backend.cooperative THEN
 				IF backend.cooperative THEN
-		 			repeatL := NewLabel();
-		 			IF (originalType IS SyntaxTree.PointerType) & ~type(SyntaxTree.RecordType).isObject THEN
+					repeatL := NewLabel();
+					IF (originalType IS SyntaxTree.PointerType) & ~type(SyntaxTree.RecordType).isObject THEN
 						Emit(Mov(position,left,IntermediateCode.Memory(addressType,left,ToMemoryUnits(system,addressType.sizeInBits))));
 						Emit(Mov(position,left,IntermediateCode.Memory(addressType,left,ToMemoryUnits(system,addressType.sizeInBits))));
 					END;
 					END;
-		 			SetLabel(repeatL);
-		 			IF reason THEN
+					SetLabel(repeatL);
+					IF reason THEN
 						BreqL(label,left,right);
 						BreqL(label,left,right);
 					ELSE
 					ELSE
 						skip := NewLabel();
 						skip := NewLabel();
@@ -3313,7 +3284,6 @@ TYPE
 				Emit(Push(Basic.invalidPosition, lr));
 				Emit(Push(Basic.invalidPosition, lr));
 			END;
 			END;
 
 
-
 			variable := recordType.recordScope.firstVariable;
 			variable := recordType.recordScope.firstVariable;
 			WHILE variable # NIL DO
 			WHILE variable # NIL DO
 				IF variable.NeedsTrace() THEN
 				IF variable.NeedsTrace() THEN
@@ -3686,7 +3656,6 @@ TYPE
 			END;
 			END;
 		END CallResetProcedure;
 		END CallResetProcedure;
 
 
-
 		PROCEDURE ResetVariables (scope: SyntaxTree.ProcedureScope);
 		PROCEDURE ResetVariables (scope: SyntaxTree.ProcedureScope);
 		VAR variable: SyntaxTree.Variable; parameter: SyntaxTree.Parameter; previousScope: SyntaxTree.Scope; prevOffset: SIZE; pc: LONGINT;
 		VAR variable: SyntaxTree.Variable; parameter: SyntaxTree.Parameter; previousScope: SyntaxTree.Scope; prevOffset: SIZE; pc: LONGINT;
 
 
@@ -3806,11 +3775,9 @@ TYPE
 
 
 			END Reset;
 			END Reset;
 
 
-
 		PROCEDURE ResetVariables2 (scope: SyntaxTree.ProcedureScope; refer: BOOLEAN);
 		PROCEDURE ResetVariables2 (scope: SyntaxTree.ProcedureScope; refer: BOOLEAN);
 		VAR variable: SyntaxTree.Variable; parameter: SyntaxTree.Parameter; previousScope: SyntaxTree.Scope;   pc: LONGINT; prevOffset: SIZE;
 		VAR variable: SyntaxTree.Variable; parameter: SyntaxTree.Parameter; previousScope: SyntaxTree.Scope;   pc: LONGINT; prevOffset: SIZE;
 
 
-
 		BEGIN
 		BEGIN
 			previousScope := currentScope;
 			previousScope := currentScope;
 			currentScope := scope;
 			currentScope := scope;
@@ -3873,8 +3840,6 @@ TYPE
 			ELSE
 			ELSE
 				import := moduleScope.ImportByModuleName(SyntaxTree.NewIdentifier(moduleName),SyntaxTree.NewIdentifier("A2"));
 				import := moduleScope.ImportByModuleName(SyntaxTree.NewIdentifier(moduleName),SyntaxTree.NewIdentifier("A2"));
 
 
-
-
 				IF import = NIL THEN
 				IF import = NIL THEN
 					import := SyntaxTree.NewImport(Basic.invalidPosition,SyntaxTree.NewIdentifier(moduleName),SyntaxTree.NewIdentifier(moduleName),FALSE);
 					import := SyntaxTree.NewImport(Basic.invalidPosition,SyntaxTree.NewIdentifier(moduleName),SyntaxTree.NewIdentifier(moduleName),FALSE);
 
 
@@ -4035,7 +4000,6 @@ TYPE
 			RETURN GetDynamicSize(e.type, tag);
 			RETURN GetDynamicSize(e.type, tag);
 		END GetArrayOfBytesSize;
 		END GetArrayOfBytesSize;
 
 
-
 		(*
 		(*
 		to find imported symbol. not needed ?
 		to find imported symbol. not needed ?
 		PROCEDURE SymbolByName(CONST moduleName, symbolName: ARRAY OF CHAR): SyntaxTree.Symbol;
 		PROCEDURE SymbolByName(CONST moduleName, symbolName: ARRAY OF CHAR): SyntaxTree.Symbol;
@@ -4099,7 +4063,6 @@ TYPE
 			RETURN symbol
 			RETURN symbol
 		END GetTypeDescriptor;
 		END GetTypeDescriptor;
 
 
-
 		(* Call a runtime procedure.  If numberParameters >= 0 then the procedure may be called without module import. Otherwise the signature has to be inferred from the import. *)
 		(* Call a runtime procedure.  If numberParameters >= 0 then the procedure may be called without module import. Otherwise the signature has to be inferred from the import. *)
 		PROCEDURE CallThisChecked(position: Position; CONST moduleName, procedureName: ARRAY OF CHAR; numberParameters: LONGINT; checkNumParameters: BOOLEAN);
 		PROCEDURE CallThisChecked(position: Position; CONST moduleName, procedureName: ARRAY OF CHAR; numberParameters: LONGINT; checkNumParameters: BOOLEAN);
 		VAR procedure: SyntaxTree.Procedure; result: Operand; reg: IntermediateCode.Operand; source: IntermediateCode.Section;
 		VAR procedure: SyntaxTree.Procedure; result: Operand; reg: IntermediateCode.Operand; source: IntermediateCode.Section;
@@ -4595,7 +4558,6 @@ TYPE
 
 
 			END CountIndices;
 			END CountIndices;
 
 
-
 		BEGIN
 		BEGIN
 			ASSERT(tagsAvailable);
 			ASSERT(tagsAvailable);
 
 
@@ -5357,7 +5319,7 @@ TYPE
 					arrayDestinationTag := sp;
 					arrayDestinationTag := sp;
 
 
 					(* case 1b
 					(* case 1b
-						 P(...,A[a..b,c..d],...): push: push array range descriptor to stack
+						P(...,A[a..b,c..d],...): push: push array range descriptor to stack
 					*)
 					*)
 					IF expression IS SyntaxTree.IndexDesignator THEN
 					IF expression IS SyntaxTree.IndexDesignator THEN
 						ReuseCopy(arrayDestinationTag,arrayDestinationTag);
 						ReuseCopy(arrayDestinationTag,arrayDestinationTag);
@@ -5459,7 +5421,7 @@ TYPE
 				ELSIF (parameter.type.resolved(SyntaxTree.MathArrayType).form = SyntaxTree.Open) & (parameter.kind = SyntaxTree.VarParameter) THEN
 				ELSIF (parameter.type.resolved(SyntaxTree.MathArrayType).form = SyntaxTree.Open) & (parameter.kind = SyntaxTree.VarParameter) THEN
 					dim := SemanticChecker.Dimension(parameter.type.resolved,{SyntaxTree.Open});
 					dim := SemanticChecker.Dimension(parameter.type.resolved,{SyntaxTree.Open});
 					(* case 2b
 					(* case 2b
-						 P(...,A[a..b,c..d],...) pre: emit range and push array range descriptor, memorize stack position
+						P(...,A[a..b,c..d],...) pre: emit range and push array range descriptor, memorize stack position
 							push: push reference to pushed array descriptor
 							push: push reference to pushed array descriptor
 							post: remove array descriptor.
 							post: remove array descriptor.
 					*)
 					*)
@@ -5476,7 +5438,7 @@ TYPE
 						Pass((operand.tag));
 						Pass((operand.tag));
 						NeedDescriptor := FALSE;
 						NeedDescriptor := FALSE;
 					(* case 2a
 					(* case 2a
-						 P(...,A,...)
+						P(...,A,...)
 						push: push reference to array descriptor on stack
 						push: push reference to array descriptor on stack
 					*)
 					*)
 					ELSIF type.resolved(SyntaxTree.MathArrayType).form = SyntaxTree.Open THEN
 					ELSIF type.resolved(SyntaxTree.MathArrayType).form = SyntaxTree.Open THEN
@@ -5514,7 +5476,7 @@ TYPE
 							Pass((arrayDestinationTag));
 							Pass((arrayDestinationTag));
 						END;
 						END;
 					(* case 2d
 					(* case 2d
-						 P(...,T,...) push: emit dimension check, push T
+						P(...,T,...) push: emit dimension check, push T
 					*)
 					*)
 					ELSIF type.resolved(SyntaxTree.MathArrayType).form = SyntaxTree.Tensor THEN
 					ELSIF type.resolved(SyntaxTree.MathArrayType).form = SyntaxTree.Tensor THEN
 						Designate(expression,operand);
 						Designate(expression,operand);
@@ -5522,7 +5484,7 @@ TYPE
 						DimensionCheck(operand.tag, IntermediateCode.Immediate(sizeType,dim),BreqL);
 						DimensionCheck(operand.tag, IntermediateCode.Immediate(sizeType,dim),BreqL);
 						Pass((operand.tag));
 						Pass((operand.tag));
 					(* case 2f
 					(* case 2f
-						 P(...,S,...) pre: allocate array descriptor on stack and memorize stack position
+						P(...,S,...) pre: allocate array descriptor on stack and memorize stack position
 							push: push reference to pushed array descriptor
 							push: push reference to pushed array descriptor
 							post: remove array descriptor
 							post: remove array descriptor
 					*)
 					*)
@@ -5585,7 +5547,7 @@ TYPE
 				ELSIF (parameter.type.resolved(SyntaxTree.MathArrayType).form = SyntaxTree.Tensor) & (parameter.kind IN {SyntaxTree.ConstParameter,SyntaxTree.ValueParameter}) THEN
 				ELSIF (parameter.type.resolved(SyntaxTree.MathArrayType).form = SyntaxTree.Tensor) & (parameter.kind IN {SyntaxTree.ConstParameter,SyntaxTree.ValueParameter}) THEN
 					dim := SemanticChecker.Dimension(type,{SyntaxTree.Open,SyntaxTree.Static});
 					dim := SemanticChecker.Dimension(type,{SyntaxTree.Open,SyntaxTree.Static});
 					(* case 3b
 					(* case 3b
-						 P(...,A[a..b,c..d],...)
+						P(...,A[a..b,c..d],...)
 					*)
 					*)
 					IF (expression IS SyntaxTree.IndexDesignator) & (type.resolved(SyntaxTree.MathArrayType).form # SyntaxTree.Static) THEN
 					IF (expression IS SyntaxTree.IndexDesignator) & (type.resolved(SyntaxTree.MathArrayType).form # SyntaxTree.Static) THEN
 						IF type(SyntaxTree.MathArrayType).form = SyntaxTree.Tensor THEN (* indexer of form a[e,....,?] *)
 						IF type(SyntaxTree.MathArrayType).form = SyntaxTree.Tensor THEN (* indexer of form a[e,....,?] *)
@@ -5644,16 +5606,16 @@ TYPE
 					(* case 3d
 					(* case 3d
 						P(...,T,...)
 						P(...,T,...)
 						case 3e
 						case 3e
-						 P(...,PT(...),...)
+						P(...,PT(...),...)
 					*)
 					*)
 					ELSIF type.resolved(SyntaxTree.MathArrayType).form = SyntaxTree.Tensor THEN
 					ELSIF type.resolved(SyntaxTree.MathArrayType).form = SyntaxTree.Tensor THEN
 						Designate(expression,operand);
 						Designate(expression,operand);
 						Dereference(operand,type.resolved,FALSE);
 						Dereference(operand,type.resolved,FALSE);
 						Pass((operand.tag));
 						Pass((operand.tag));
 					(* case 3f
 					(* case 3f
-						 P(...,S,...)
-						 case 3g
-						 P(...,PS(...),...)
+						P(...,S,...)
+						case 3g
+						P(...,PS(...),...)
 					*)
 					*)
 					ELSIF type.resolved(SyntaxTree.MathArrayType).form = SyntaxTree.Static THEN
 					ELSIF type.resolved(SyntaxTree.MathArrayType).form = SyntaxTree.Static THEN
 						descriptorType := GetMathArrayDescriptorType(dim);
 						descriptorType := GetMathArrayDescriptorType(dim);
@@ -5998,7 +5960,6 @@ TYPE
 				ReleaseIntermediateOperand(result.op);
 				ReleaseIntermediateOperand(result.op);
 			END;
 			END;
 
 
-
 		END VisitStatementDesignator;
 		END VisitStatementDesignator;
 
 
 		PROCEDURE InlineProcedureCall(x: SyntaxTree.ProcedureCallDesignator): BOOLEAN;
 		PROCEDURE InlineProcedureCall(x: SyntaxTree.ProcedureCallDesignator): BOOLEAN;
@@ -6046,9 +6007,6 @@ TYPE
 				RETURN variableDesignator
 				RETURN variableDesignator
 			END GetTemp;
 			END GetTemp;
 
 
-
-
-
 		BEGIN
 		BEGIN
 			resultDesignator := procedureResultDesignator; procedureResultDesignator := NIL;
 			resultDesignator := procedureResultDesignator; procedureResultDesignator := NIL;
 			wasInline := currentIsInline;
 			wasInline := currentIsInline;
@@ -6227,7 +6185,7 @@ TYPE
 						IF left IS SyntaxTree.DereferenceDesignator THEN (* dereference, if required *)
 						IF left IS SyntaxTree.DereferenceDesignator THEN (* dereference, if required *)
 							left := left(SyntaxTree.Designator).left;
 							left := left(SyntaxTree.Designator).left;
 						END;
 						END;
-	 					expression := checker.NewObjectOperatorCall(Basic.invalidPosition, left, 0, actualParameter.parameters, tempVariableDesignator);
+						expression := checker.NewObjectOperatorCall(Basic.invalidPosition, left, 0, actualParameter.parameters, tempVariableDesignator);
 						currentWriteBackCall.call := expression(SyntaxTree.ProcedureCallDesignator);
 						currentWriteBackCall.call := expression(SyntaxTree.ProcedureCallDesignator);
 					END;
 					END;
 					actualParameter := tempVariableDesignator;
 					actualParameter := tempVariableDesignator;
@@ -6248,7 +6206,6 @@ TYPE
 				END;
 				END;
 			END;
 			END;
 
 
-
 			resultDesignator := procedureResultDesignator; procedureResultDesignator := NIL;
 			resultDesignator := procedureResultDesignator; procedureResultDesignator := NIL;
 			procedureType := x.left.type.resolved(SyntaxTree.ProcedureType);
 			procedureType := x.left.type.resolved(SyntaxTree.ProcedureType);
 			callingConvention := procedureType.callingConvention;
 			callingConvention := procedureType.callingConvention;
@@ -6313,7 +6270,7 @@ TYPE
 				IntermediateCode.InitImmediate(mask,addressType,-alignment);
 				IntermediateCode.InitImmediate(mask,addressType,-alignment);
 				Emit(And(position,sp, sp, mask));
 				Emit(And(position,sp, sp, mask));
 				Emit(Add(position, sp, sp, IntermediateCode.Immediate(addressType, gap)));
 				Emit(Add(position, sp, sp, IntermediateCode.Immediate(addressType, gap)));
-			 	Emit(Push(position,reg));
+				Emit(Push(position,reg));
 				ReleaseIntermediateOperand(reg);
 				ReleaseIntermediateOperand(reg);
 			END;
 			END;
 
 
@@ -6387,15 +6344,15 @@ TYPE
 					Designate(d,returnValue);
 					Designate(d,returnValue);
 					returnTypeSize := system.SizeOf(procedureType.returnType.resolved);
 					returnTypeSize := system.SizeOf(procedureType.returnType.resolved);
 					size := IntermediateCode.Immediate(addressType,ToMemoryUnits(system,returnTypeSize));
 					size := IntermediateCode.Immediate(addressType,ToMemoryUnits(system,returnTypeSize));
-			 		Emit(Push(position,size));
-			 		Emit(Push(position,returnValue.op));
-			 		ReleaseOperand(returnValue);
+					Emit(Push(position,size));
+					Emit(Push(position,returnValue.op));
+					ReleaseOperand(returnValue);
 				ELSE*)
 				ELSE*)
 					PushParameter(d,procedureType.returnParameter,callingConvention, FALSE, dummy,-1)
 					PushParameter(d,procedureType.returnParameter,callingConvention, FALSE, dummy,-1)
 					(*
 					(*
-		 		END;
-		 		*)
-		 	END;
+				END;
+				*)
+			END;
 
 
 			IF callingConvention # SyntaxTree.OberonCallingConvention THEN
 			IF callingConvention # SyntaxTree.OberonCallingConvention THEN
 				parameterRegisters := 0;
 				parameterRegisters := 0;
@@ -6462,7 +6419,6 @@ TYPE
 				parametersSize := ParametersSize(system,procedureType, FALSE);
 				parametersSize := ParametersSize(system,procedureType, FALSE);
 			END;
 			END;
 
 
-
 			IF isCallOfDynamicOperator & hasDynamicOperands THEN
 			IF isCallOfDynamicOperator & hasDynamicOperands THEN
 			(*
 			(*
 				dynamic operator overloading:
 				dynamic operator overloading:
@@ -6548,7 +6504,6 @@ TYPE
 				END
 				END
 			END;
 			END;
 
 
-
 			ReleaseParameterRegisters();
 			ReleaseParameterRegisters();
 
 
 			IF ~(symbol IS SyntaxTree.Procedure) & backend.trackLeave & ~isUnchecked & (callingConvention IN {SyntaxTree.WinAPICallingConvention, SyntaxTree.CCallingConvention}) THEN
 			IF ~(symbol IS SyntaxTree.Procedure) & backend.trackLeave & ~isUnchecked & (callingConvention IN {SyntaxTree.WinAPICallingConvention, SyntaxTree.CCallingConvention}) THEN
@@ -6619,7 +6574,6 @@ TYPE
 				Emit(Pop(position, ap));
 				Emit(Pop(position, ap));
 			END;
 			END;
 
 
-
 			IF firstWriteBackCall # NIL THEN
 			IF firstWriteBackCall # NIL THEN
 				SaveRegisters(); ReleaseUsedRegisters(saved2);
 				SaveRegisters(); ReleaseUsedRegisters(saved2);
 				(* perform all write-back calls in the list *)
 				(* perform all write-back calls in the list *)
@@ -6692,7 +6646,6 @@ TYPE
 				RETURN delegatePointerType
 				RETURN delegatePointerType
 			END GetDelegateType;
 			END GetDelegateType;
 
 
-
 			PROCEDURE GetBackendType(x: SyntaxTree.Type; VAR offset: LONGINT; VAR name: Basic.SegmentedName): SyntaxTree.Symbol;
 			PROCEDURE GetBackendType(x: SyntaxTree.Type; VAR offset: LONGINT; VAR name: Basic.SegmentedName): SyntaxTree.Symbol;
 			(* create anonymous type declaration for types that need a type descriptor but have been declared anonymously
 			(* create anonymous type declaration for types that need a type descriptor but have been declared anonymously
 				such as in VAR a: RECORD ... END;
 				such as in VAR a: RECORD ... END;
@@ -6761,7 +6714,6 @@ TYPE
 			make memory should be used when tag is used, not earlier
 			make memory should be used when tag is used, not earlier
 			*)
 			*)
 
 
-
 			RETURN res
 			RETURN res
 		END TypeDescriptorAdr;
 		END TypeDescriptorAdr;
 
 
@@ -6901,7 +6853,6 @@ TYPE
 				rightType := NIL
 				rightType := NIL
 			END;
 			END;
 
 
-
 			(* determine operator kind *)
 			(* determine operator kind *)
 			IF IsStrictlyPointerToRecord(leftType) THEN
 			IF IsStrictlyPointerToRecord(leftType) THEN
 				kind := {LhsIsPointer}
 				kind := {LhsIsPointer}
@@ -7085,7 +7036,6 @@ TYPE
 				END;
 				END;
 			END StringOperand;
 			END StringOperand;
 
 
-
 			PROCEDURE Ln;
 			PROCEDURE Ln;
 			BEGIN
 			BEGIN
 				IF GetProcedure("Ln") THEN
 				IF GetProcedure("Ln") THEN
@@ -7093,7 +7043,6 @@ TYPE
 				END;
 				END;
 			END Ln;
 			END Ln;
 
 
-
 		BEGIN
 		BEGIN
 			IF backend.traceModuleName = "" THEN RETURN END;
 			IF backend.traceModuleName = "" THEN RETURN END;
 			IF AddImport(backend.traceModuleName,traceModule,TRUE) THEN
 			IF AddImport(backend.traceModuleName,traceModule,TRUE) THEN
@@ -7169,7 +7118,6 @@ TYPE
 			END;
 			END;
 		END SystemTrace;
 		END SystemTrace;
 
 
-
 		PROCEDURE InitFields(type: SyntaxTree.Type; CONST adr: IntermediateCode.Operand; offset: LONGINT);
 		PROCEDURE InitFields(type: SyntaxTree.Type; CONST adr: IntermediateCode.Operand; offset: LONGINT);
 		VAR baseType: SyntaxTree.Type; imm,mem: IntermediateCode.Operand; dim,size: LONGINT;
 		VAR baseType: SyntaxTree.Type; imm,mem: IntermediateCode.Operand; dim,size: LONGINT;
 			variable: SyntaxTree.Variable; i: LONGINT; initializerOp: Operand;
 			variable: SyntaxTree.Variable; i: LONGINT; initializerOp: Operand;
@@ -7520,8 +7468,6 @@ TYPE
 			END;
 			END;
 		END MathArrayLenOrIncr;
 		END MathArrayLenOrIncr;
 
 
-
-
 		PROCEDURE ArrayLen(type: SyntaxTree.ArrayType; VAR operand: Operand; VAR dim: IntermediateCode.Operand; VAR result: Operand );
 		PROCEDURE ArrayLen(type: SyntaxTree.ArrayType; VAR operand: Operand; VAR dim: IntermediateCode.Operand; VAR result: Operand );
 		VAR val: LONGINT; res,res2: IntermediateCode.Operand; end,next: Label; t: SyntaxTree.Type; imm: IntermediateCode.Operand; hasDynamicPart: BOOLEAN;
 		VAR val: LONGINT; res,res2: IntermediateCode.Operand; end,next: Label; t: SyntaxTree.Type; imm: IntermediateCode.Operand; hasDynamicPart: BOOLEAN;
 			offset: LONGINT;
 			offset: LONGINT;
@@ -7615,7 +7561,6 @@ TYPE
 			variable.SetAccess(SyntaxTree.Hidden);
 			variable.SetAccess(SyntaxTree.Hidden);
 			variable.SetUntraced(untraced);
 			variable.SetUntraced(untraced);
 
 
-
 			IF v = NIL THEN
 			IF v = NIL THEN
 				temporaries.AddVariable(variable);
 				temporaries.AddVariable(variable);
 
 
@@ -7669,7 +7614,6 @@ TYPE
 				recordScope.AddVariable(variable);
 				recordScope.AddVariable(variable);
 			END AddVariable;
 			END AddVariable;
 
 
-
 		BEGIN
 		BEGIN
 			name := "@ArrayDescriptor";
 			name := "@ArrayDescriptor";
 			Basic.AppendNumber(name,dimensions);
 			Basic.AppendNumber(name,dimensions);
@@ -7750,10 +7694,9 @@ TYPE
 			ReleaseOperand(op);
 			ReleaseOperand(op);
 		END PushConstInteger;
 		END PushConstInteger;
 
 
-
 		PROCEDURE OpenInitializer(symbol: SyntaxTree.Symbol; scope: SyntaxTree.Scope): IntermediateCode.Section;
 		PROCEDURE OpenInitializer(symbol: SyntaxTree.Symbol; scope: SyntaxTree.Scope): IntermediateCode.Section;
 		VAR name: Basic.SegmentedName; procedure: SyntaxTree.Procedure; procedureScope: SyntaxTree.ProcedureScope;
 		VAR name: Basic.SegmentedName; procedure: SyntaxTree.Procedure; procedureScope: SyntaxTree.ProcedureScope;
-		 section: IntermediateCode.Section;
+			section: IntermediateCode.Section;
 		BEGIN
 		BEGIN
 			procedureScope := SyntaxTree.NewProcedureScope(scope);
 			procedureScope := SyntaxTree.NewProcedureScope(scope);
 			Global.GetSymbolSegmentedName(symbol, name);
 			Global.GetSymbolSegmentedName(symbol, name);
@@ -7934,8 +7877,6 @@ TYPE
 
 
 		END AddPorts;
 		END AddPorts;
 
 
-
-
 		PROCEDURE AddProperty(cellType: SyntaxTree.CellType; cell: SyntaxTree.Symbol; property: SyntaxTree.Property; value: SyntaxTree.Expression);
 		PROCEDURE AddProperty(cellType: SyntaxTree.CellType; cell: SyntaxTree.Symbol; property: SyntaxTree.Property; value: SyntaxTree.Expression);
 		VAR name: ARRAY 256 OF CHAR; op: Operand;  left, d: SyntaxTree.Designator;
 		VAR name: ARRAY 256 OF CHAR; op: Operand;  left, d: SyntaxTree.Designator;
 		BEGIN
 		BEGIN
@@ -8084,7 +8025,6 @@ TYPE
 			END;
 			END;
 		END AddPortProperties;
 		END AddPortProperties;
 
 
-
 		PROCEDURE PushPort(p: SyntaxTree.Expression);
 		PROCEDURE PushPort(p: SyntaxTree.Expression);
 		VAR op: Operand;
 		VAR op: Operand;
 		BEGIN
 		BEGIN
@@ -8125,7 +8065,7 @@ TYPE
 				x := x(SyntaxTree.Designator).left;
 				x := x(SyntaxTree.Designator).left;
 			END;
 			END;
 			RETURN x # NIL;
 			RETURN x # NIL;
-			 *)
+			*)
 		END OnHeap;
 		END OnHeap;
 
 
 		PROCEDURE VisitBuiltinCallDesignator*(x: SyntaxTree.BuiltinCallDesignator);
 		PROCEDURE VisitBuiltinCallDesignator*(x: SyntaxTree.BuiltinCallDesignator);
@@ -8207,7 +8147,6 @@ TYPE
 				END;
 				END;
 			END CallBodies;
 			END CallBodies;
 
 
-
 			PROCEDURE PushTD(type: SyntaxTree.Type);
 			PROCEDURE PushTD(type: SyntaxTree.Type);
 			VAR op: IntermediateCode.Operand;
 			VAR op: IntermediateCode.Operand;
 			BEGIN
 			BEGIN
@@ -8222,7 +8161,6 @@ TYPE
 				END
 				END
 			END PushTD;
 			END PushTD;
 
 
-
 		BEGIN
 		BEGIN
 			IF Trace THEN TraceEnter("VisitBuiltinCallDesignator") END;
 			IF Trace THEN TraceEnter("VisitBuiltinCallDesignator") END;
 
 
@@ -8640,7 +8578,6 @@ TYPE
 						(* call bodies *)
 						(* call bodies *)
 						CallBodies(pointer,type);
 						CallBodies(pointer,type);
 
 
-
 						SetLabel(exit);
 						SetLabel(exit);
 						needsTrace := p0.NeedsTrace();
 						needsTrace := p0.NeedsTrace();
 						IF needsTrace THEN ModifyAssignments(true) END;
 						IF needsTrace THEN ModifyAssignments(true) END;
@@ -8761,16 +8698,16 @@ TYPE
 					type := type(SyntaxTree.PointerType).pointerBase.resolved;
 					type := type(SyntaxTree.PointerType).pointerBase.resolved;
 					IF ~backend.cooperative THEN  (* simpler version *)
 					IF ~backend.cooperative THEN  (* simpler version *)
 						(*
 						(*
-						 	push len0
-						 	push len1
-						 	push len2
-						 	push len_size
-						 	push len_adr
+							push len0
+							push len1
+							push len2
+							push len_size
+							push len_adr
 
 
 							push tag
 							push tag
-						 	push static elements
-						 	push element size
-						 	push adr
+							push static elements
+							push element size
+							push adr
 						*)
 						*)
 
 
 						dim := 0;
 						dim := 0;
@@ -8796,7 +8733,6 @@ TYPE
 
 
 						openDim := dim;
 						openDim := dim;
 
 
-
 						staticLength := 1;
 						staticLength := 1;
 						IF type IS SyntaxTree.ArrayType THEN
 						IF type IS SyntaxTree.ArrayType THEN
 							WHILE (type IS SyntaxTree.ArrayType) DO (* static array *)
 							WHILE (type IS SyntaxTree.ArrayType) DO (* static array *)
@@ -8814,7 +8750,6 @@ TYPE
 						staticLength := ToMemoryUnits(system,system.AlignedSizeOf(type));
 						staticLength := ToMemoryUnits(system,system.AlignedSizeOf(type));
 						Emit(Push(position, IntermediateCode.Immediate(sizeType, staticLength))); (* element size *)
 						Emit(Push(position, IntermediateCode.Immediate(sizeType, staticLength))); (* element size *)
 
 
-
 						Designate(p0,l);
 						Designate(p0,l);
 						Emit(Push(position,l.op)); (* address *)
 						Emit(Push(position,l.op)); (* address *)
 						ReleaseOperand(l);
 						ReleaseOperand(l);
@@ -9071,15 +9006,15 @@ TYPE
 						*)
 						*)
 					ELSE
 					ELSE
 						(*
 						(*
-						 	push len0
-						 	push len1
-						 	push len2
-
-						 	push size
-						 	push len_adr
-						 	push element_size
-						 	push tag
-						 	push adr
+							push len0
+							push len1
+							push len2
+
+							push size
+							push len_adr
+							push element_size
+							push tag
+							push adr
 						*)
 						*)
 
 
 						dim := 0;
 						dim := 0;
@@ -9090,7 +9025,6 @@ TYPE
 							isTensor := FALSE;
 							isTensor := FALSE;
 						END;
 						END;
 
 
-
 						FOR i := x.parameters.Length()-1 TO firstPar BY -1 DO
 						FOR i := x.parameters.Length()-1 TO firstPar BY -1 DO
 							IF ~isTensor THEN
 							IF ~isTensor THEN
 								type := type(SyntaxTree.MathArrayType).arrayBase.resolved;
 								type := type(SyntaxTree.MathArrayType).arrayBase.resolved;
@@ -9121,7 +9055,6 @@ TYPE
 							baseType := SemanticChecker.ArrayBase(type,openDim);
 							baseType := SemanticChecker.ArrayBase(type,openDim);
 						END;
 						END;
 
 
-
 						staticLength := ToMemoryUnits(system,system.AlignedSizeOf(baseType));
 						staticLength := ToMemoryUnits(system,system.AlignedSizeOf(baseType));
 						Emit(Push(position, IntermediateCode.Immediate(sizeType, staticLength)));
 						Emit(Push(position, IntermediateCode.Immediate(sizeType, staticLength)));
 
 
@@ -9193,14 +9126,12 @@ TYPE
 					(* allocate *)
 					(* allocate *)
 					CallThis(position,"ActiveCellsRuntime","Allocate",7);
 					CallThis(position,"ActiveCellsRuntime","Allocate",7);
 
 
-
 					Symbol(temporaryVariable,l); (*Designate(temporaryVariable,l)*)
 					Symbol(temporaryVariable,l); (*Designate(temporaryVariable,l)*)
 					(* l.op contains address of pointer to record *)
 					(* l.op contains address of pointer to record *)
 					ToMemory(l.op,addressType,0);
 					ToMemory(l.op,addressType,0);
 					(* l.op contains value  of pointer to record *)
 					(* l.op contains value  of pointer to record *)
 					InitFields(baseType, l.op,0);
 					InitFields(baseType, l.op,0);
 
 
-
 					(* add capabilities *)
 					(* add capabilities *)
 					modifier := p0(SyntaxTree.Designator).modifiers;
 					modifier := p0(SyntaxTree.Designator).modifiers;
 
 
@@ -9219,7 +9150,6 @@ TYPE
 					*)
 					*)
 					AddModifiers(baseType(SyntaxTree.CellType), temporaryVariable, modifier);
 					AddModifiers(baseType(SyntaxTree.CellType), temporaryVariable, modifier);
 
 
-
 					Symbol(temporaryVariable,l); (*Designate(temporaryVariable,l)*)
 					Symbol(temporaryVariable,l); (*Designate(temporaryVariable,l)*)
 					(* l.op contains address of pointer to record *)
 					(* l.op contains address of pointer to record *)
 					ToMemory(l.op,addressType,0);
 					ToMemory(l.op,addressType,0);
@@ -9228,7 +9158,6 @@ TYPE
 					ReleaseOperand(l);
 					ReleaseOperand(l);
 					CallThis(position,"ActiveCellsRuntime","FinishedProperties",1);
 					CallThis(position,"ActiveCellsRuntime","FinishedProperties",1);
 
 
-
 					prevScope := currentScope;
 					prevScope := currentScope;
 					init := OpenInitializer(temporaryVariable, baseType(SyntaxTree.CellType).cellScope);
 					init := OpenInitializer(temporaryVariable, baseType(SyntaxTree.CellType).cellScope);
 					previous := section;
 					previous := section;
@@ -9630,7 +9559,6 @@ TYPE
 					Emit(Push(position,s2.op));
 					Emit(Push(position,s2.op));
 				END;
 				END;
 
 
-
 				(*
 				(*
 				Emit(Push(position,IntermediateCode.Immediate(addressType,size)));
 				Emit(Push(position,IntermediateCode.Immediate(addressType,size)));
 				*)
 				*)
@@ -10637,7 +10565,6 @@ TYPE
 			RETURN i;
 			RETURN i;
 		END GetAvailability;
 		END GetAvailability;
 
 
-
 		PROCEDURE VisitVariable*(x: SyntaxTree.Variable);
 		PROCEDURE VisitVariable*(x: SyntaxTree.Variable);
 		VAR symbol: Sections.Section;  type: SyntaxTree.Type; recordType: SyntaxTree.RecordType; name: Basic.SegmentedName; temp: IntermediateCode.Operand; reg: LONGINT;
 		VAR symbol: Sections.Section;  type: SyntaxTree.Type; recordType: SyntaxTree.RecordType; name: Basic.SegmentedName; temp: IntermediateCode.Operand; reg: LONGINT;
 		BEGIN
 		BEGIN
@@ -10964,7 +10891,6 @@ TYPE
 			VExpression(x.expression);
 			VExpression(x.expression);
 		END VisitAlias;
 		END VisitAlias;
 
 
-
 		(** statements *)
 		(** statements *)
 
 
 		PROCEDURE VisitProcedureCallStatement*(x: SyntaxTree.ProcedureCallStatement);
 		PROCEDURE VisitProcedureCallStatement*(x: SyntaxTree.ProcedureCallStatement);
@@ -11435,7 +11361,6 @@ TYPE
 			END;
 			END;
 		END VisitCommunicationStatement;
 		END VisitCommunicationStatement;
 
 
-
 		PROCEDURE VisitIfStatement*(x: SyntaxTree.IfStatement);
 		PROCEDURE VisitIfStatement*(x: SyntaxTree.IfStatement);
 		VAR end: Label; i,elsifs: LONGINT; elsif: SyntaxTree.IfPart; escape: BOOLEAN;
 		VAR end: Label; i,elsifs: LONGINT; elsif: SyntaxTree.IfPart; escape: BOOLEAN;
 
 
@@ -11643,7 +11568,6 @@ TYPE
 			IF Trace THEN TraceExit("VisitCaseStatement") END;
 			IF Trace THEN TraceExit("VisitCaseStatement") END;
 		END VisitCaseStatement;
 		END VisitCaseStatement;
 
 
-
 		PROCEDURE VisitWhileStatement*(x: SyntaxTree.WhileStatement);
 		PROCEDURE VisitWhileStatement*(x: SyntaxTree.WhileStatement);
 		VAR startL,falseL: Label;
 		VAR startL,falseL: Label;
 		BEGIN
 		BEGIN
@@ -11688,7 +11612,6 @@ TYPE
 			temporaryVariableDesignator := SyntaxTree.NewSymbolDesignator(Basic.invalidPosition, NIL, temporaryVariable);
 			temporaryVariableDesignator := SyntaxTree.NewSymbolDesignator(Basic.invalidPosition, NIL, temporaryVariable);
 			temporaryVariableDesignator.SetType(x.variable.type.resolved);
 			temporaryVariableDesignator.SetType(x.variable.type.resolved);
 
 
-
 			Assign(temporaryVariableDesignator,x.to);
 			Assign(temporaryVariableDesignator,x.to);
 			IF x.by = NIL THEN by := 1 ELSE by := x.by.resolved(SyntaxTree.IntegerValue).value END;
 			IF x.by = NIL THEN by := 1 ELSE by := x.by.resolved(SyntaxTree.IntegerValue).value END;
 			IF by > 0 THEN
 			IF by > 0 THEN
@@ -12236,7 +12159,6 @@ TYPE
 			RETURN ProcedureParametersSize(system, procedure);
 			RETURN ProcedureParametersSize(system, procedure);
 		END ProcParametersSize;
 		END ProcParametersSize;
 
 
-
 		PROCEDURE ParameterCopies(x: SyntaxTree.ProcedureType);
 		PROCEDURE ParameterCopies(x: SyntaxTree.ProcedureType);
 		VAR parameter: SyntaxTree.Parameter; type, base: SyntaxTree.Type;
 		VAR parameter: SyntaxTree.Parameter; type, base: SyntaxTree.Type;
 			op: Operand; temp,size,par,dst, length,null: IntermediateCode.Operand;
 			op: Operand; temp,size,par,dst, length,null: IntermediateCode.Operand;
@@ -12349,7 +12271,6 @@ TYPE
 			END;
 			END;
 		END GetFingerprint;
 		END GetFingerprint;
 
 
-
 		PROCEDURE Body(x: SyntaxTree.Body; scope: SyntaxTree.Scope; ir: IntermediateCode.Section; moduleBody: BOOLEAN);
 		PROCEDURE Body(x: SyntaxTree.Body; scope: SyntaxTree.Scope; ir: IntermediateCode.Section; moduleBody: BOOLEAN);
 		VAR prevScope: SyntaxTree.Scope; procedureType: SyntaxTree.ProcedureType; procedure: SyntaxTree.Procedure;
 		VAR prevScope: SyntaxTree.Scope; procedureType: SyntaxTree.ProcedureType; procedure: SyntaxTree.Procedure;
 			cellScope: SyntaxTree.CellScope; op: Operand; string: SyntaxTree.IdentifierString;
 			cellScope: SyntaxTree.CellScope; op: Operand; string: SyntaxTree.IdentifierString;
@@ -12371,7 +12292,6 @@ TYPE
 				dump := NIL;
 				dump := NIL;
 			END;
 			END;
 
 
-
 			prevScope := currentScope;
 			prevScope := currentScope;
 			currentScope := scope;
 			currentScope := scope;
 
 
@@ -12409,7 +12329,6 @@ TYPE
 
 
 				InitVariables(scope);
 				InitVariables(scope);
 
 
-
 				IF backend.preciseGC & (x.code = NIL) & (~procedureType.noPAF) & ~procedure.isEntry & ~procedure.isExit THEN
 				IF backend.preciseGC & (x.code = NIL) & (~procedureType.noPAF) & ~procedure.isEntry & ~procedure.isExit THEN
 					GetCodeSectionNameForSymbol(procedure, name);
 					GetCodeSectionNameForSymbol(procedure, name);
 					Basic.SuffixSegmentedName (name, Basic.MakeString ("@Descriptor"));
 					Basic.SuffixSegmentedName (name, Basic.MakeString ("@Descriptor"));
@@ -12464,12 +12383,12 @@ TYPE
 		declarationVisitor: DeclarationVisitor;
 		declarationVisitor: DeclarationVisitor;
 		module: Sections.Module;
 		module: Sections.Module;
 		moduleName: ARRAY 128 OF CHAR;
 		moduleName: ARRAY 128 OF CHAR;
- 		moduleNamePool: Basic.HashTableInt;
- 		moduleNamePoolSection: IntermediateCode.Section;
- 		modulePointerSection: IntermediateCode.Section;
- 		modulePointerSizePC: LONGINT;
- 		modulePointerSectionOffset: LONGINT;
- 		modulePointers: LONGINT;
+		moduleNamePool: Basic.HashTableInt;
+		moduleNamePoolSection: IntermediateCode.Section;
+		modulePointerSection: IntermediateCode.Section;
+		modulePointerSizePC: LONGINT;
+		modulePointerSectionOffset: LONGINT;
+		modulePointers: LONGINT;
 
 
 		simple: BOOLEAN; (* simple = no module loading, no reflection *)
 		simple: BOOLEAN; (* simple = no module loading, no reflection *)
 
 
@@ -12484,7 +12403,6 @@ TYPE
 	CONST
 	CONST
 		EmptyBlockOffset = 2;
 		EmptyBlockOffset = 2;
 
 
-
 		PROCEDURE &InitMetaDataGenerator(implementationVisitor: ImplementationVisitor; declarationVisitor: DeclarationVisitor; simple: BOOLEAN);
 		PROCEDURE &InitMetaDataGenerator(implementationVisitor: ImplementationVisitor; declarationVisitor: DeclarationVisitor; simple: BOOLEAN);
 		BEGIN
 		BEGIN
 			IF implementationVisitor.backend.cooperative THEN
 			IF implementationVisitor.backend.cooperative THEN
@@ -12634,7 +12552,6 @@ TYPE
 			section.Emit(Data(Basic.invalidPosition,op));
 			section.Emit(Data(Basic.invalidPosition,op));
 		END Size;
 		END Size;
 
 
-
 		PROCEDURE Set(section: IntermediateCode.Section; value: Basic.Set);
 		PROCEDURE Set(section: IntermediateCode.Section; value: Basic.Set);
 		VAR op: IntermediateCode.Operand;
 		VAR op: IntermediateCode.Operand;
 		BEGIN
 		BEGIN
@@ -12714,7 +12631,6 @@ TYPE
 			String(section, s);
 			String(section, s);
 		END String0;
 		END String0;
 
 
-
 		PROCEDURE NamedSymbol(section: IntermediateCode.Section; name: Basic.SegmentedName; symbol: SyntaxTree.Symbol; virtualOffset, realOffset: LONGINT);
 		PROCEDURE NamedSymbol(section: IntermediateCode.Section; name: Basic.SegmentedName; symbol: SyntaxTree.Symbol; virtualOffset, realOffset: LONGINT);
 		VAR op: IntermediateCode.Operand;
 		VAR op: IntermediateCode.Operand;
 		BEGIN
 		BEGIN
@@ -12731,7 +12647,6 @@ TYPE
 			section.EmitAt(pc, Data(Basic.invalidPosition,op));
 			section.EmitAt(pc, Data(Basic.invalidPosition,op));
 		END NamedSymbolAt;
 		END NamedSymbolAt;
 
 
-
 		PROCEDURE Symbol(section: IntermediateCode.Section; symbol: Sections.Section; virtualOffset, realOffset: LONGINT);
 		PROCEDURE Symbol(section: IntermediateCode.Section; symbol: Sections.Section; virtualOffset, realOffset: LONGINT);
 		BEGIN
 		BEGIN
 			IF symbol= NIL THEN
 			IF symbol= NIL THEN
@@ -12911,8 +12826,6 @@ TYPE
 			RETURN section
 			RETURN section
 		END NamedBlock;
 		END NamedBlock;
 
 
-
-
 		PROCEDURE Block(CONST mName, typeName, suffix: ARRAY OF CHAR; VAR offset: LONGINT): IntermediateCode.Section;
 		PROCEDURE Block(CONST mName, typeName, suffix: ARRAY OF CHAR; VAR offset: LONGINT): IntermediateCode.Section;
 		VAR name: ARRAY 128 OF CHAR; pooledName: Basic.SegmentedName;
 		VAR name: ARRAY 128 OF CHAR; pooledName: Basic.SegmentedName;
 		BEGIN
 		BEGIN
@@ -13082,7 +12995,6 @@ TYPE
 				scopes[0].section := source;
 				scopes[0].section := source;
 				scopes[0].arraySizePC := MIN(LONGINT);
 				scopes[0].arraySizePC := MIN(LONGINT);
 
 
-
 				FOR s := 0 TO LEN(sections)-1 DO
 				FOR s := 0 TO LEN(sections)-1 DO
 					symbol := sections[s];
 					symbol := sections[s];
 					IF (symbol # NIL) & (implementationVisitor.backend.cooperative) & (symbol.symbol = NIL) OR (symbol.symbol # NIL) & (symbol.type # Sections.InitCodeSection) & (symbol.type # Sections.EntryCodeSection) & (symbol.type # Sections.ExitCodeSection) & (symbol.type # Sections.InlineCodeSection) THEN
 					IF (symbol # NIL) & (implementationVisitor.backend.cooperative) & (symbol.symbol = NIL) OR (symbol.symbol # NIL) & (symbol.type # Sections.InitCodeSection) & (symbol.type # Sections.EntryCodeSection) & (symbol.type # Sections.ExitCodeSection) & (symbol.type # Sections.InlineCodeSection) THEN
@@ -13175,7 +13087,6 @@ TYPE
 			Export(sectionArray^);
 			Export(sectionArray^);
 		END ExportDesc;
 		END ExportDesc;
 
 
-
 		PROCEDURE ExceptionArray(source: IntermediateCode.Section);
 		PROCEDURE ExceptionArray(source: IntermediateCode.Section);
 		VAR
 		VAR
 			p: Sections.Section; finallyPC, sizePC, size, i: LONGINT;
 			p: Sections.Section; finallyPC, sizePC, size, i: LONGINT;
@@ -13277,7 +13188,7 @@ TYPE
 				sfScopeBegin = 0F0X;
 				sfScopeBegin = 0F0X;
 				sfScopeEnd = 0F1X;
 				sfScopeEnd = 0F1X;
 				sfProcedure = 0F2X;
 				sfProcedure = 0F2X;
-				sfVariable = 	0F3X;
+				sfVariable = 0F3X;
 				sfTypeDeclaration = 0F4X;
 				sfTypeDeclaration = 0F4X;
 				sfModule = 0FFX;
 				sfModule = 0FFX;
 
 
@@ -13287,7 +13198,6 @@ TYPE
 				sizePC, startPC, lastOffset: LONGINT;
 				sizePC, startPC, lastOffset: LONGINT;
 				indirectTypes: Basic.HashTable;
 				indirectTypes: Basic.HashTable;
 
 
-
 				PROCEDURE CurrentIndex(): LONGINT;
 				PROCEDURE CurrentIndex(): LONGINT;
 				VAR i: LONGINT;
 				VAR i: LONGINT;
 				BEGIN
 				BEGIN
@@ -13783,8 +13693,6 @@ TYPE
 					Char(section, sfScopeEnd); (* scope ends *)
 					Char(section, sfScopeEnd); (* scope ends *)
 				END NScope;
 				END NScope;
 
 
-
-
 			BEGIN
 			BEGIN
 				NEW(indirectTypes, 32);
 				NEW(indirectTypes, 32);
 				ArrayBlock(section,sizePC,"", FALSE);
 				ArrayBlock(section,sizePC,"", FALSE);
@@ -14056,7 +13964,6 @@ TYPE
 			PatchArray(section, sizePC, numberProcs);
 			PatchArray(section, sizePC, numberProcs);
 		END ProcedureDescriptorArray;
 		END ProcedureDescriptorArray;
 
 
-
 		(*
 		(*
 			Module* = OBJECT (Heaps.RootObject)	(* cf. Linker0 & Heaps.WriteType *)
 			Module* = OBJECT (Heaps.RootObject)	(* cf. Linker0 & Heaps.WriteType *)
 			VAR
 			VAR
@@ -14333,7 +14240,6 @@ TYPE
 			END;
 			END;
 		END PatchCRC;
 		END PatchCRC;
 
 
-
 		PROCEDURE PointerArray(source: IntermediateCode.Section; scope: SyntaxTree.Scope; VAR numberPointers: LONGINT);
 		PROCEDURE PointerArray(source: IntermediateCode.Section; scope: SyntaxTree.Scope; VAR numberPointers: LONGINT);
 		VAR variable: SyntaxTree.Variable; pc: LONGINT; symbol: Sections.Section; parameter: SyntaxTree.Parameter; parametersSize: LONGINT;
 		VAR variable: SyntaxTree.Variable; pc: LONGINT; symbol: Sections.Section; parameter: SyntaxTree.Parameter; parametersSize: LONGINT;
 		BEGIN
 		BEGIN
@@ -14611,7 +14517,6 @@ TYPE
 							source.SetExported(IsExported(td));
 							source.SetExported(IsExported(td));
 						END;
 						END;
 
 
-
 						Info(source, "parent");
 						Info(source, "parent");
 						IF baseRecord # NIL THEN
 						IF baseRecord # NIL THEN
 							Global.GetSymbolSegmentedName(baseTD,name);
 							Global.GetSymbolSegmentedName(baseTD,name);
@@ -14661,7 +14566,7 @@ TYPE
 										---
 										---
 										TypeDesc = TypeInfoAdr
 										TypeDesc = TypeInfoAdr
 										---
 										---
-						td adr ---> 	rec size
+						td adr ---> rec size
 										----
 										----
 										pointer offsets
 										pointer offsets
 										----
 										----
@@ -14755,7 +14660,6 @@ TYPE
 
 
 	END MetaDataGenerator;
 	END MetaDataGenerator;
 
 
-
 	IntermediateBackend*= OBJECT (IntermediateCode.IntermediateBackend)
 	IntermediateBackend*= OBJECT (IntermediateCode.IntermediateBackend)
 	VAR
 	VAR
 		trace-: BOOLEAN;
 		trace-: BOOLEAN;
@@ -14773,8 +14677,6 @@ TYPE
 		preciseGC, trackLeave, writeBarriers: BOOLEAN;
 		preciseGC, trackLeave, writeBarriers: BOOLEAN;
 		experiment: BOOLEAN;
 		experiment: BOOLEAN;
 
 
-
-
 		PROCEDURE &InitIntermediateBackend*;
 		PROCEDURE &InitIntermediateBackend*;
 		BEGIN
 		BEGIN
 			simpleMetaData := FALSE;
 			simpleMetaData := FALSE;
@@ -14927,25 +14829,18 @@ TYPE
 		BEGIN RETURN SymbolFileFormat.Get()
 		BEGIN RETURN SymbolFileFormat.Get()
 		END DefaultSymbolFileFormat;
 		END DefaultSymbolFileFormat;
 
 
-
-
 	END IntermediateBackend;
 	END IntermediateBackend;
 
 
-
 	(* ----------------------------------- register allocation ------------------------------------- *)
 	(* ----------------------------------- register allocation ------------------------------------- *)
 
 
-
 		(* register mapping scheme
 		(* register mapping scheme
-			virtual register number	--> register mapping   = 		part(0)		-->	ticket	<-->	physical register
+			virtual register number	--> register mapping   =		part(0)		-->	ticket	<-->	physical register
 																											spill offset
 																											spill offset
 
 
 																	part(n)		-->	ticket	<-->	physical register
 																	part(n)		-->	ticket	<-->	physical register
 																											spill offset
 																											spill offset
 		*)
 		*)
 
 
-
-
-
 	VAR int8-, int16-, int32-, int64-, uint8-, uint16-, uint32-, uint64-, float32-, float64-: IntermediateCode.Type;
 	VAR int8-, int16-, int32-, int64-, uint8-, uint16-, uint32-, uint64-, float32-, float64-: IntermediateCode.Type;
 		emptyOperand: IntermediateCode.Operand;
 		emptyOperand: IntermediateCode.Operand;
 		systemCalls: ARRAY NumberSystemCalls OF SyntaxTree.Symbol;
 		systemCalls: ARRAY NumberSystemCalls OF SyntaxTree.Symbol;
@@ -14981,7 +14876,6 @@ TYPE
 		statCoopTraceModule)
 		statCoopTraceModule)
 	END Statistics;
 	END Statistics;
 
 
-
 	PROCEDURE GCD(a,b: LONGINT): LONGINT;
 	PROCEDURE GCD(a,b: LONGINT): LONGINT;
 	VAR h: LONGINT;
 	VAR h: LONGINT;
 	BEGIN
 	BEGIN
@@ -15272,7 +15166,6 @@ TYPE
 		RETURN (type IS SyntaxTree.ArrayType) & (type(SyntaxTree.ArrayType).form = SyntaxTree.SemiDynamic);
 		RETURN (type IS SyntaxTree.ArrayType) & (type(SyntaxTree.ArrayType).form = SyntaxTree.SemiDynamic);
 	END IsSemiDynamicArray;
 	END IsSemiDynamicArray;
 
 
-
 	PROCEDURE IsStaticArray(type: SyntaxTree.Type): BOOLEAN;
 	PROCEDURE IsStaticArray(type: SyntaxTree.Type): BOOLEAN;
 	BEGIN
 	BEGIN
 		IF type = NIL THEN RETURN FALSE END;
 		IF type = NIL THEN RETURN FALSE END;
@@ -15401,7 +15294,6 @@ TYPE
 			parSize := parSize + (-parSize) MOD system.addressSize;
 			parSize := parSize + (-parSize) MOD system.addressSize;
 		END;
 		END;
 
 
-
 		parameter :=procedureType.lastParameter;
 		parameter :=procedureType.lastParameter;
 		WHILE (parameter # NIL) DO
 		WHILE (parameter # NIL) DO
 			IF procedureType.callingConvention IN SysvABIorWINAPI THEN
 			IF procedureType.callingConvention IN SysvABIorWINAPI THEN
@@ -15413,7 +15305,6 @@ TYPE
 			parameter := parameter.prevParameter;
 			parameter := parameter.prevParameter;
 		END;
 		END;
 
 
-
 		IF procedureType.selfParameter # NIL THEN
 		IF procedureType.selfParameter # NIL THEN
 			parameter := procedureType.selfParameter;
 			parameter := procedureType.selfParameter;
 			INC(parSize,system.SizeOfParameter(parameter));
 			INC(parSize,system.SizeOfParameter(parameter));
@@ -15486,7 +15377,6 @@ TYPE
 		RETURN instruction
 		RETURN instruction
 	END Conv;
 	END Conv;
 
 
-
 	PROCEDURE Call*(position: Basic.Position;op: IntermediateCode.Operand; parSize: LONGINT): IntermediateCode.Instruction;
 	PROCEDURE Call*(position: Basic.Position;op: IntermediateCode.Operand; parSize: LONGINT): IntermediateCode.Instruction;
 	VAR instruction: IntermediateCode.Instruction;
 	VAR instruction: IntermediateCode.Instruction;
 	BEGIN
 	BEGIN
@@ -15520,7 +15410,7 @@ TYPE
 	END Result;
 	END Result;
 
 
 	PROCEDURE Trap(position: Basic.Position;nr: LONGINT): IntermediateCode.Instruction;
 	PROCEDURE Trap(position: Basic.Position;nr: LONGINT): IntermediateCode.Instruction;
- 	VAR op1: IntermediateCode.Operand;
+	VAR op1: IntermediateCode.Operand;
 	VAR instruction: IntermediateCode.Instruction;
 	VAR instruction: IntermediateCode.Instruction;
 	BEGIN
 	BEGIN
 		IntermediateCode.InitNumber(op1,nr);
 		IntermediateCode.InitNumber(op1,nr);
@@ -15733,7 +15623,6 @@ TYPE
 		RETURN instruction
 		RETURN instruction
 	END SpecialInstruction;
 	END SpecialInstruction;
 
 
-
 	PROCEDURE Reserve(position: Basic.Position;units: LONGINT): IntermediateCode.Instruction;
 	PROCEDURE Reserve(position: Basic.Position;units: LONGINT): IntermediateCode.Instruction;
 	VAR op1: IntermediateCode.Operand;
 	VAR op1: IntermediateCode.Operand;
 	VAR instruction: IntermediateCode.Instruction;
 	VAR instruction: IntermediateCode.Instruction;
@@ -15786,7 +15675,6 @@ TYPE
 		RETURN pc
 		RETURN pc
 	END EnterImmediate;
 	END EnterImmediate;
 
 
-
 	PROCEDURE Init;
 	PROCEDURE Init;
 	VAR i: LONGINT; name: SyntaxTree.IdentifierString;
 	VAR i: LONGINT; name: SyntaxTree.IdentifierString;
 	BEGIN
 	BEGIN
@@ -15815,14 +15703,11 @@ TYPE
 		RETURN (symbol # NIL) & symbol.NeedsSection();
 		RETURN (symbol # NIL) & symbol.NeedsSection();
 	END IsExported;
 	END IsExported;
 
 
-
-
 BEGIN
 BEGIN
 	Init;
 	Init;
 
 
 END FoxIntermediateBackend.
 END FoxIntermediateBackend.
 
 
-
 Compiler.Compile -p=Win32 FoxIntermediateBackend.Mod ~
 Compiler.Compile -p=Win32 FoxIntermediateBackend.Mod ~
 
 
 #	Release.Build --path="/temp/obg/" Win32 ~
 #	Release.Build --path="/temp/obg/" Win32 ~

+ 6 - 20
source/FoxIntermediateCode.Mod

@@ -47,7 +47,6 @@ CONST
 	GeneralPurpose*=0;
 	GeneralPurpose*=0;
 	Parameter*=1; (* *)
 	Parameter*=1; (* *)
 
 
-
 	(* special registers *)
 	(* special registers *)
 	None*=-1; (* no register assigned *)
 	None*=-1; (* no register assigned *)
 	SP*=-2; (* stack pointer *)
 	SP*=-2; (* stack pointer *)
@@ -89,9 +88,6 @@ TYPE
 	RegisterMap*= RECORD register*: LONGINT; name*: SyntaxTree.SourceCode END;
 	RegisterMap*= RECORD register*: LONGINT; name*: SyntaxTree.SourceCode END;
 	BackendRules*= POINTER TO ARRAY OF RegisterMap;
 	BackendRules*= POINTER TO ARRAY OF RegisterMap;
 
 
-
-
-
 	Operand* = RECORD
 	Operand* = RECORD
 		mode-: SHORTINT; (* Undefined, ModeRegister, ModeImmediate, ModeMemory, ModeNumber or ModeString *)
 		mode-: SHORTINT; (* Undefined, ModeRegister, ModeImmediate, ModeMemory, ModeNumber or ModeString *)
 		type-: Type; (* size and form *)
 		type-: Type; (* size and form *)
@@ -136,7 +132,6 @@ TYPE
 
 
 	Instructions*=POINTER TO ARRAY OF Instruction;
 	Instructions*=POINTER TO ARRAY OF Instruction;
 
 
-
 	(** code object *)
 	(** code object *)
 	Section*= OBJECT (Sections.Section)
 	Section*= OBJECT (Sections.Section)
 	VAR
 	VAR
@@ -168,7 +163,6 @@ TYPE
 			exported := e
 			exported := e
 		END SetExported;
 		END SetExported;
 
 
-
 		PROCEDURE EnableComments*(enabled: BOOLEAN);
 		PROCEDURE EnableComments*(enabled: BOOLEAN);
 		BEGIN
 		BEGIN
 			IF enabled & (comments = NIL) THEN NEW(comments, GetPC)
 			IF enabled & (comments = NIL) THEN NEW(comments, GetPC)
@@ -189,7 +183,6 @@ TYPE
 			alias := section; aliasOffset := offset;
 			alias := section; aliasOffset := offset;
 		END SetAlias;
 		END SetAlias;
 
 
-
 		PROCEDURE SetFinally*(atPc: LONGINT);
 		PROCEDURE SetFinally*(atPc: LONGINT);
 		BEGIN finally := atPc
 		BEGIN finally := atPc
 		END SetFinally;
 		END SetFinally;
@@ -379,7 +372,6 @@ TYPE
 			END;
 			END;
 		END WriteRaw;
 		END WriteRaw;
 
 
-
 	END Section;
 	END Section;
 
 
 	IntermediateBackend*= OBJECT (Backend.Backend)
 	IntermediateBackend*= OBJECT (Backend.Backend)
@@ -399,7 +391,6 @@ TYPE
 
 
 	END IntermediateBackend;
 	END IntermediateBackend;
 
 
-
 	VAR
 	VAR
 		instructionFormat-: ARRAY NofOpcodes OF InstructionFormat;
 		instructionFormat-: ARRAY NofOpcodes OF InstructionFormat;
 		int8-, int16-, int32-, int64-, uint8-, uint16-, uint32-, uint64-, float32-, float64-, undef-: Type;
 		int8-, int16-, int32-, int64-, uint8-, uint16-, uint32-, uint64-, float32-, float64-, undef-: Type;
@@ -432,7 +423,6 @@ TYPE
 		IF result # NIL THEN
 		IF result # NIL THEN
 			section := result(Section);
 			section := result(Section);
 
 
-
 			(*
 			(*
 			t0 := result.type;
 			t0 := result.type;
 			IF t0 # type THEN
 			IF t0 # type THEN
@@ -602,12 +592,12 @@ TYPE
 						newln := FALSE;
 						newln := FALSE;
 					END;
 					END;
 					IF (ch = '"') OR (ch = '\') THEN
 					IF (ch = '"') OR (ch = '\') THEN
-					 	w.Char( '\' );
-					 	w.Char(ch);
+						w.Char( '\' );
+						w.Char(ch);
 					ELSE
 					ELSE
-					 	w.Char(ch);
-					 END
-				 END;
+						w.Char(ch);
+					END
+				END;
 				INC(i);
 				INC(i);
 				ch := str[i];
 				ch := str[i];
 			END;
 			END;
@@ -758,7 +748,6 @@ TYPE
 		IF instr.opcode = special THEN w.RawLInt(instr.subtype) END;
 		IF instr.opcode = special THEN w.RawLInt(instr.subtype) END;
 	END WriteRawInstruction;
 	END WriteRawInstruction;
 
 
-
 	PROCEDURE DumpInstruction*(w: Streams.Writer; CONST instr: Instruction);
 	PROCEDURE DumpInstruction*(w: Streams.Writer; CONST instr: Instruction);
 	BEGIN
 	BEGIN
 		w.String(instructionFormat[instr.opcode].name);
 		w.String(instructionFormat[instr.opcode].name);
@@ -881,7 +870,6 @@ TYPE
 		Assert(op2.symbol.name[0] # 0, "not intialized operand 2");
 		Assert(op2.symbol.name[0] # 0, "not intialized operand 2");
 		Assert(op3.symbol.name[0] # 0, "not intialized operand 3");
 		Assert(op3.symbol.name[0] # 0, "not intialized operand 3");
 
 
-
 		instr.opcode := opcode;
 		instr.opcode := opcode;
 		instr.op1 := op1;
 		instr.op1 := op1;
 		instr.op2 := op2;
 		instr.op2 := op2;
@@ -909,7 +897,6 @@ TYPE
 		instr.subtype := subType
 		instr.subtype := subType
 	END SetSubType;
 	END SetSubType;
 
 
-
 	PROCEDURE InitOperand*(VAR op: Operand);
 	PROCEDURE InitOperand*(VAR op: Operand);
 	BEGIN
 	BEGIN
 		op.mode := Undefined;
 		op.mode := Undefined;
@@ -1021,7 +1008,6 @@ TYPE
 		END;
 		END;
 	END IsConstantInteger;
 	END IsConstantInteger;
 
 
-
 	PROCEDURE InitImmediate*(VAR op: Operand; type: Type; value: HUGEINT);
 	PROCEDURE InitImmediate*(VAR op: Operand; type: Type; value: HUGEINT);
 	BEGIN
 	BEGIN
 		Assert(type.form IN Integer,"operand type does not match value type");
 		Assert(type.form IN Integer,"operand type does not match value type");
@@ -1289,7 +1275,7 @@ TYPE
 		ELSIF type IS SyntaxTree.CellType THEN
 		ELSIF type IS SyntaxTree.CellType THEN
 			RETURN GetType(system, system.addressType);
 			RETURN GetType(system, system.addressType);
 		ELSE
 		ELSE
- 			HALT(100);
+			HALT(100);
 		END;
 		END;
 	END GetType;
 	END GetType;
 
 

+ 4 - 23
source/FoxIntermediateLinker.Mod

@@ -42,7 +42,6 @@ TYPE
 			backend := defaultBackend;
 			backend := defaultBackend;
 			defaultBackend.GetDescription(platformName);
 			defaultBackend.GetDescription(platformName);
 
 
-
 			NEW(allSections);
 			NEW(allSections);
 			NEW(importList, 128);
 			NEW(importList, 128);
 			NEW(loadedModules, 128);
 			NEW(loadedModules, 128);
@@ -83,7 +82,6 @@ TYPE
 			END
 			END
 		END EmitAt;
 		END EmitAt;
 
 
-
 		PROCEDURE PatchIntegerValue*(CONST sectionName: ARRAY OF CHAR; index: LONGINT; value: HUGEINT; type: SyntaxTree.Type): BOOLEAN;
 		PROCEDURE PatchIntegerValue*(CONST sectionName: ARRAY OF CHAR; index: LONGINT; value: HUGEINT; type: SyntaxTree.Type): BOOLEAN;
 		VAR instruction: IntermediateCode.Instruction; section: Sections.Section; op1: IntermediateCode.Operand;
 		VAR instruction: IntermediateCode.Instruction; section: Sections.Section; op1: IntermediateCode.Operand;
 			pooledName: Basic.SegmentedName; itype: IntermediateCode.Type;
 			pooledName: Basic.SegmentedName; itype: IntermediateCode.Type;
@@ -142,7 +140,6 @@ TYPE
 			RETURN TRUE;
 			RETURN TRUE;
 		END PatchStringValue;
 		END PatchStringValue;
 
 
-
 		PROCEDURE LoadModule*(CONST moduleFileName: ARRAY OF CHAR; recursive: BOOLEAN): BOOLEAN;
 		PROCEDURE LoadModule*(CONST moduleFileName: ARRAY OF CHAR; recursive: BOOLEAN): BOOLEAN;
 		VAR
 		VAR
 			filename, moduleName: SyntaxTree.IdentifierString;
 			filename, moduleName: SyntaxTree.IdentifierString;
@@ -659,7 +656,6 @@ TYPE
 			UNTIL ~Conflict(binaryModule(Sections.Module),sizes^) OR (count > 10) ;
 			UNTIL ~Conflict(binaryModule(Sections.Module),sizes^) OR (count > 10) ;
 			ASSERT(count <=10);
 			ASSERT(count <=10);
 
 
-
 			IF binaryModule = NIL THEN
 			IF binaryModule = NIL THEN
 				Basic.Error(diagnostics, desiredName,Basic.invalidPosition, "the specified backend cannot process intermediate code");
 				Basic.Error(diagnostics, desiredName,Basic.invalidPosition, "the specified backend cannot process intermediate code");
 				result := FALSE
 				result := FALSE
@@ -751,7 +747,6 @@ TYPE
 			END;
 			END;
 		END Generate;
 		END Generate;
 
 
-
 		(*PROCEDURE LinkInstance(CONST typeName, instanceName: ARRAY OF CHAR): BOOLEAN;
 		(*PROCEDURE LinkInstance(CONST typeName, instanceName: ARRAY OF CHAR): BOOLEAN;
 		VAR
 		VAR
 			codeFileName, dataFileName: Files.FileName;
 			codeFileName, dataFileName: Files.FileName;
@@ -895,7 +890,6 @@ TYPE
 					specification.log.String("generated code file: ");specification.log.String(codeFileName); specification.log.Ln;
 					specification.log.String("generated code file: ");specification.log.String(codeFileName); specification.log.Ln;
 					specification.log.String("generated data file: ");specification.log.String(dataFileName); specification.log.Ln;
 					specification.log.String("generated data file: ");specification.log.String(dataFileName); specification.log.Ln;
 
 
-
 				END;
 				END;
 			ELSE
 			ELSE
 				msg := "could not link ";
 				msg := "could not link ";
@@ -934,7 +928,6 @@ TYPE
 			objectFileFormat.GetOptions(options);
 			objectFileFormat.GetOptions(options);
 		END GetOptions;
 		END GetOptions;
 
 
-
 	END SpecificationLinker;
 	END SpecificationLinker;
 
 
 	PROCEDURE Get*(): Backend.Backend;
 	PROCEDURE Get*(): Backend.Backend;
@@ -993,8 +986,6 @@ TYPE
 		END;
 		END;
 	END CopySections;
 	END CopySections;
 
 
-
-
 (*
 (*
 	PROCEDURE LinkActiveCells*(activeCellsSpecification: ActiveCells.Specification; backend: Backend.Backend; objectFileFormat: Formats.ObjectFileFormat): BOOLEAN;
 	PROCEDURE LinkActiveCells*(activeCellsSpecification: ActiveCells.Specification; backend: Backend.Backend; objectFileFormat: Formats.ObjectFileFormat): BOOLEAN;
 	TYPE
 	TYPE
@@ -1149,7 +1140,6 @@ TYPE
 						specification.log.String("generated code file: ");specification.log.String(codeFileName); specification.log.Ln;
 						specification.log.String("generated code file: ");specification.log.String(codeFileName); specification.log.Ln;
 						specification.log.String("generated data file: ");specification.log.String(dataFileName); specification.log.Ln;
 						specification.log.String("generated data file: ");specification.log.String(dataFileName); specification.log.Ln;
 
 
-
 					END;
 					END;
 				ELSE
 				ELSE
 					msg := "could not link ";
 					msg := "could not link ";
@@ -1244,7 +1234,7 @@ TYPE
 			NEW(assemblinker, diagnostics, defaultBackend);
 			NEW(assemblinker, diagnostics, defaultBackend);
 		END;
 		END;
 		WHILE Basic.GetStringParameter(input,filename) & ~error DO
 		WHILE Basic.GetStringParameter(input,filename) & ~error DO
-			IF targetFile = "" THEN NEW(assemblinker, diagnostics, defaultBackend) 	END;
+			IF targetFile = "" THEN NEW(assemblinker, diagnostics, defaultBackend) END;
 			IF assemblinker.LoadModule(filename, FALSE) THEN
 			IF assemblinker.LoadModule(filename, FALSE) THEN
 				assemblinker.MarkReachabilityOfAll(TRUE);
 				assemblinker.MarkReachabilityOfAll(TRUE);
 				FileNameToModuleName(filename, moduleName);
 				FileNameToModuleName(filename, moduleName);
@@ -1261,7 +1251,7 @@ TYPE
 		END;
 		END;
 		IF ~error & (targetFile # "") THEN
 		IF ~error & (targetFile # "") THEN
 			assemblinker.PrearrangeReachableDataSections;
 			assemblinker.PrearrangeReachableDataSections;
-			IF 	assemblinker.GenerateObjectFile(objectFileFormat, context.out, targetFile)
+			IF assemblinker.GenerateObjectFile(objectFileFormat, context.out, targetFile)
 			THEN
 			THEN
 				Basic.Information(diagnostics, targetFile, Basic.invalidPosition, "generated.")
 				Basic.Information(diagnostics, targetFile, Basic.invalidPosition, "generated.")
 			ELSE error := FALSE
 			ELSE error := FALSE
@@ -1292,7 +1282,6 @@ TYPE
 
 
 				system := backend.GetSystem();
 				system := backend.GetSystem();
 
 
-
 				IF (instructionMemorySize > 0) & (instructionMemorySize < code.SizeInBits() DIV system.codeUnit) THEN
 				IF (instructionMemorySize > 0) & (instructionMemorySize < code.SizeInBits() DIV system.codeUnit) THEN
 					Basic.Error(diagnostics, instanceName, Basic.invalidPosition, "specified instruction memory size too small");
 					Basic.Error(diagnostics, instanceName, Basic.invalidPosition, "specified instruction memory size too small");
 					error := TRUE;
 					error := TRUE;
@@ -1314,8 +1303,6 @@ TYPE
 					StaticLinker.WriteOutputFile (code, codeFileName, linker, StaticLinker.WriteTRMCodeFile);
 					StaticLinker.WriteOutputFile (code, codeFileName, linker, StaticLinker.WriteTRMCodeFile);
 					StaticLinker.WriteOutputFile (data, dataFileName, linker, StaticLinker.WriteTRMDataFile);
 					StaticLinker.WriteOutputFile (data, dataFileName, linker, StaticLinker.WriteTRMDataFile);
 
 
-
-
 					IF linkerLog # NIL THEN linkerLog.Update; Files.Register(logFile) END;
 					IF linkerLog # NIL THEN linkerLog.Update; Files.Register(logFile) END;
 					IF log # NIL THEN
 					IF log # NIL THEN
 						log.String(instanceName);
 						log.String(instanceName);
@@ -1329,7 +1316,6 @@ TYPE
 						log.String("generated code file: ");log.String(codeFileName); log.Ln;
 						log.String("generated code file: ");log.String(codeFileName); log.Ln;
 						log.String("generated data file: ");log.String(dataFileName); log.Ln;
 						log.String("generated data file: ");log.String(dataFileName); log.Ln;
 
 
-
 					END;
 					END;
 				ELSE
 				ELSE
 					msg := "could not link ";
 					msg := "could not link ";
@@ -1340,9 +1326,6 @@ TYPE
 
 
 	END WriteCodeAndDataFiles;
 	END WriteCodeAndDataFiles;
 
 
-
-
-
 	(* to link active cells
 	(* to link active cells
 		- load all intermediate code files and collect all sections in one object
 		- load all intermediate code files and collect all sections in one object
 		- for each cell instance
 		- for each cell instance
@@ -1355,7 +1338,6 @@ TYPE
 		- ir code / data units depend on section type, do not necessarily have to be stored
 		- ir code / data units depend on section type, do not necessarily have to be stored
 	*)
 	*)
 
 
-
 	PROCEDURE Test*(context: Commands.Context);
 	PROCEDURE Test*(context: Commands.Context);
 	VAR
 	VAR
 		input: Streams.Reader;
 		input: Streams.Reader;
@@ -1456,7 +1438,7 @@ TYPE
 		*)
 		*)
 		(*
 		(*
 		WHILE Basic.GetStringParameter(input,filename) & ~error DO
 		WHILE Basic.GetStringParameter(input,filename) & ~error DO
-			IF targetFile = "" THEN NEW(assemblinker, diagnostics, defaultBackend, "") 	END;
+			IF targetFile = "" THEN NEW(assemblinker, diagnostics, defaultBackend, "") END;
 			IF assemblinker.LoadModule(filename, FALSE) THEN
 			IF assemblinker.LoadModule(filename, FALSE) THEN
 				assemblinker.MarkReachabilityOfAll(TRUE);
 				assemblinker.MarkReachabilityOfAll(TRUE);
 				FileNameToModuleName(filename, moduleName);
 				FileNameToModuleName(filename, moduleName);
@@ -1475,8 +1457,7 @@ TYPE
 		(*
 		(*
 		IF ~error & (targetFile # "") THEN
 		IF ~error & (targetFile # "") THEN
 			assemblinker.PrearrangeReachableDataSections;
 			assemblinker.PrearrangeReachableDataSections;
-			IF 	assemblinker.GenerateObjectFile(objectFileFormat, context.out, targetFile)
-			THEN
+			IF assemblinker.GenerateObjectFile(objectFileFormat, context.out, targetFile) THEN
 				Basic.Information(diagnostics, targetFile, Streams.Invalid, "generated.")
 				Basic.Information(diagnostics, targetFile, Streams.Invalid, "generated.")
 			ELSE error := FALSE
 			ELSE error := FALSE
 			END;
 			END;

+ 0 - 2
source/FoxIntermediateObjectFile.Mod

@@ -505,7 +505,6 @@ TYPE ObjectFileFormat* = OBJECT (Formats.ObjectFileFormat)
 		END;
 		END;
 	END WriteHeader;
 	END WriteHeader;
 
 
-
 	(* test code to display --not public *)
 	(* test code to display --not public *)
 	PROCEDURE Show*(context: Commands.Context);
 	PROCEDURE Show*(context: Commands.Context);
 	VAR
 	VAR
@@ -548,4 +547,3 @@ FoxIntermediateObjectFile.Show Builtins  ~
 			writer.Update;
 			writer.Update;
 			Files.Register(file);
 			Files.Register(file);
 			*)
 			*)
-

+ 1 - 2
source/FoxIntermediateParser.Mod

@@ -426,7 +426,7 @@ TYPE
 				(* total size of the section in units *)
 				(* total size of the section in units *)
 				ELSIF ThisIdentifier("size") & ExpectSymbol(Scanner.Equal) THEN
 				ELSIF ThisIdentifier("size") & ExpectSymbol(Scanner.Equal) THEN
 					IF ExpectIntegerWithSign(integer) THEN
 					IF ExpectIntegerWithSign(integer) THEN
-						 (* nothing to do (this property is ignored, since the size is calculated from the actual content) *)
+						(* nothing to do (this property is ignored, since the size is calculated from the actual content) *)
 					ELSE
 					ELSE
 						Error(positionOfProperty, "invalid size")
 						Error(positionOfProperty, "invalid size")
 					END
 					END
@@ -620,5 +620,4 @@ TYPE
 		END;
 		END;
 	END ParseFile;
 	END ParseFile;
 
 
-
 END FoxIntermediateParser.
 END FoxIntermediateParser.

+ 3 - 14
source/FoxInterpreter.Mod

@@ -7,7 +7,6 @@ CONST
 	EnableTrace = FALSE;
 	EnableTrace = FALSE;
 	MaxIndex = 8;
 	MaxIndex = 8;
 
 
-
 TYPE
 TYPE
 	Result*= InterpreterSymbols.Result;
 	Result*= InterpreterSymbols.Result;
 	Value*=InterpreterSymbols.Value;
 	Value*=InterpreterSymbols.Value;
@@ -96,7 +95,6 @@ TYPE
 			RETURN print;
 			RETURN print;
 		END Print;
 		END Print;
 
 
-
 	END Parser;
 	END Parser;
 
 
 	Interpreter* = OBJECT (SyntaxTree.Visitor)
 	Interpreter* = OBJECT (SyntaxTree.Visitor)
@@ -111,7 +109,6 @@ TYPE
 		diagnostics: Diagnostics.Diagnostics;
 		diagnostics: Diagnostics.Diagnostics;
 		context-: Commands.Context;
 		context-: Commands.Context;
 
 
-
 		PROCEDURE & Init*(scope: Scope; diagnostics: Diagnostics.Diagnostics; context: Commands.Context);
 		PROCEDURE & Init*(scope: Scope; diagnostics: Diagnostics.Diagnostics; context: Commands.Context);
 		BEGIN
 		BEGIN
 			IF scope = NIL THEN scope := global END;
 			IF scope = NIL THEN scope := global END;
@@ -400,10 +397,8 @@ TYPE
 				item.in := NIL;
 				item.in := NIL;
 			END;
 			END;
 
 
-
 		END VisitQualifiedType;
 		END VisitQualifiedType;
 
 
-
 		(*
 		(*
 		PROCEDURE FindInScope(scope: Scope; symbol: StringPool.Index): Value;
 		PROCEDURE FindInScope(scope: Scope; symbol: StringPool.Index): Value;
 		VAR item: Value;
 		VAR item: Value;
@@ -460,7 +455,7 @@ TYPE
 
 
 		PROCEDURE VisitIdentifierDesignator*(x: SyntaxTree.IdentifierDesignator);
 		PROCEDURE VisitIdentifierDesignator*(x: SyntaxTree.IdentifierDesignator);
 		VAR moduleName: Modules.Name; msg: ARRAY 128 OF CHAR; res: WORD;
 		VAR moduleName: Modules.Name; msg: ARRAY 128 OF CHAR; res: WORD;
-			 builtin : Builtin; anyValue: Any;
+			builtin : Builtin; anyValue: Any;
 		BEGIN
 		BEGIN
 			ASSERT(x.left = NIL);
 			ASSERT(x.left = NIL);
 			item.name := x.identifier;
 			item.name := x.identifier;
@@ -504,7 +499,6 @@ TYPE
 			END;
 			END;
 		END VisitSelectorDesignator;
 		END VisitSelectorDesignator;
 
 
-
 		PROCEDURE VisitParameterDesignator*(x: SyntaxTree.ParameterDesignator);
 		PROCEDURE VisitParameterDesignator*(x: SyntaxTree.ParameterDesignator);
 		VAR e: SyntaxTree.Expression; proc: InterpreterSymbols.ProcedureResult; i: LONGINT;
 		VAR e: SyntaxTree.Expression; proc: InterpreterSymbols.ProcedureResult; i: LONGINT;
 			adr: ADDRESS; adrValue: Value; any: InterpreterSymbols.AnyValue;
 			adr: ADDRESS; adrValue: Value; any: InterpreterSymbols.AnyValue;
@@ -650,7 +644,6 @@ TYPE
 			RETURN NIL;
 			RETURN NIL;
 		END FindType;
 		END FindType;
 
 
-
 		PROCEDURE VisitBuiltinCallDesignator*(x: SyntaxTree.BuiltinCallDesignator);
 		PROCEDURE VisitBuiltinCallDesignator*(x: SyntaxTree.BuiltinCallDesignator);
 		VAR p,p0,p1,p2: SyntaxTree.Expression;
 		VAR p,p0,p1,p2: SyntaxTree.Expression;
 			type,t0,t1,t2: SyntaxTree.Type;
 			type,t0,t1,t2: SyntaxTree.Type;
@@ -901,7 +894,7 @@ TYPE
 			END CreateContext;
 			END CreateContext;
 
 
 			PROCEDURE IsDelimiter(ch : CHAR) : BOOLEAN;
 			PROCEDURE IsDelimiter(ch : CHAR) : BOOLEAN;
-			CONST 	CR = 0DX;  LF = 0AX;  TAB = 9X;
+			CONST CR = 0DX;  LF = 0AX;  TAB = 9X;
 			BEGIN
 			BEGIN
 				RETURN (ch = " ") OR (ch = CR) OR (ch = LF) OR (ch = TAB) OR (ch = ";") OR (ch = 0X);
 				RETURN (ch = " ") OR (ch = CR) OR (ch = LF) OR (ch = TAB) OR (ch = ";") OR (ch = 0X);
 			END IsDelimiter;
 			END IsDelimiter;
@@ -1012,10 +1005,9 @@ TYPE
 		PROCEDURE Evaluate(x: SyntaxTree.Expression): Value;
 		PROCEDURE Evaluate(x: SyntaxTree.Expression): Value;
 		VAR w: Value;
 		VAR w: Value;
 		BEGIN
 		BEGIN
-			 IF GetValue(x, w) THEN RETURN w ELSE RETURN NIL END;
+			IF GetValue(x, w) THEN RETURN w ELSE RETURN NIL END;
 		END Evaluate;
 		END Evaluate;
 
 
-
 		PROCEDURE GetInteger(x: SyntaxTree.Expression; VAR i: Integer): BOOLEAN;
 		PROCEDURE GetInteger(x: SyntaxTree.Expression; VAR i: Integer): BOOLEAN;
 		VAR v: Value;
 		VAR v: Value;
 		BEGIN
 		BEGIN
@@ -1347,7 +1339,6 @@ VAR d: RECORD e: LONGINT END;
 
 
 	END TestO;
 	END TestO;
 
 
-
 BEGIN
 BEGIN
 	InitGlobalScope;
 	InitGlobalScope;
 	c := 10;
 	c := 10;
@@ -1422,8 +1413,6 @@ FoxInterpreter.Statements
 	o := Test.TestO();
 	o := Test.TestO();
 	~
 	~
 
 
-
-
 FoxInterpreter.Statements
 FoxInterpreter.Statements
 	s := {0..10, 15};
 	s := {0..10, 15};
 	a := 10;
 	a := 10;

+ 2 - 3
source/FoxInterpreterBackend.Mod

@@ -187,7 +187,6 @@ TYPE
 			END;
 			END;
 		END Resolve;
 		END Resolve;
 
 
-
 		PROCEDURE Designate (VAR operand: Intermediate.Operand): Address;
 		PROCEDURE Designate (VAR operand: Intermediate.Operand): Address;
 		VAR address: Address;
 		VAR address: Address;
 		BEGIN
 		BEGIN
@@ -259,7 +258,7 @@ TYPE
 				Execute (pc.section.instructions[pc.index], pc);
 				Execute (pc.section.instructions[pc.index], pc);
 				IF pc.index >= pc.section.pc THEN
 				IF pc.index >= pc.section.pc THEN
 					IF sp # StackSize THEN Error ("missing return"); END;
 					IF sp # StackSize THEN Error ("missing return"); END;
-					 pc.section := NIL;
+					pc.section := NIL;
 				END;
 				END;
 			END;
 			END;
 		END Run;
 		END Run;
@@ -385,7 +384,7 @@ TYPE
 
 
 		PROCEDURE ProcessSyntaxTreeModule *(x: SyntaxTree.Module): Formats.GeneratedModule;
 		PROCEDURE ProcessSyntaxTreeModule *(x: SyntaxTree.Module): Formats.GeneratedModule;
 		VAR module: Sections.Module; section: Sections.Section; interpreter: Interpreter;
 		VAR module: Sections.Module; section: Sections.Section; interpreter: Interpreter;
- 		BEGIN
+		BEGIN
 			module := GenerateIntermediate (x, SupportedInstruction, SupportedImmediate);
 			module := GenerateIntermediate (x, SupportedInstruction, SupportedImmediate);
 			NEW (heap); NEW (interpreter, SELF, SHORT (SHORT (addressSize)),module);
 			NEW (heap); NEW (interpreter, SELF, SHORT (SHORT (addressSize)),module);
 			Traverse (module.allSections, interpreter.AllocateSection);
 			Traverse (module.allSections, interpreter.AllocateSection);

+ 5 - 22
source/FoxInterpreterSymbols.Mod

@@ -5,7 +5,6 @@ IMPORT Strings, Basic := FoxBasic, StringPool, Streams, Commands, PersistentObje
 CONST
 CONST
 	TAB = 09X;
 	TAB = 09X;
 
 
-
 TYPE
 TYPE
 
 
 	Item*= PersistentObjects.Object;
 	Item*= PersistentObjects.Object;
@@ -87,8 +86,7 @@ TYPE
 		RETURN 0;
 		RETURN 0;
 	END SymbolAddress;
 	END SymbolAddress;
 
 
-
-	TYPE
+TYPE
 
 
 	Result*= OBJECT (Item)
 	Result*= OBJECT (Item)
 
 
@@ -119,7 +117,6 @@ TYPE
 
 
 	END Result;
 	END Result;
 
 
-
 	SymbolResult*=OBJECT(Result)
 	SymbolResult*=OBJECT(Result)
 	VAR name: ARRAY 32 OF CHAR;
 	VAR name: ARRAY 32 OF CHAR;
 
 
@@ -186,7 +183,6 @@ TYPE
 				RETURN NIL;
 				RETURN NIL;
 		END Find;
 		END Find;
 
 
-
 	END ModuleResult;
 	END ModuleResult;
 
 
 	Callstack = OBJECT
 	Callstack = OBJECT
@@ -273,7 +269,6 @@ TYPE
 			p.a := a;
 			p.a := a;
 		END PushA;
 		END PushA;
 
 
-
 		PROCEDURE PushSz(s: SIZE);
 		PROCEDURE PushSz(s: SIZE);
 		VAR p: POINTER {UNSAFE,UNTRACED} TO RECORD s: SIZE END;
 		VAR p: POINTER {UNSAFE,UNTRACED} TO RECORD s: SIZE END;
 		BEGIN
 		BEGIN
@@ -453,8 +448,8 @@ TYPE
 						CASE type OF
 						CASE type OF
 							Reflection.sfTypeCHAR .. Reflection.sfTypeSIZE, Reflection.sfTypePointerToRecord, Reflection.sfTypePointerToArray:
 							Reflection.sfTypeCHAR .. Reflection.sfTypeSIZE, Reflection.sfTypePointerToRecord, Reflection.sfTypePointerToArray:
 							(*! check type ! *)
 							(*! check type ! *)
-							 stack.PushA(o.Address());
-							 RETURN TRUE;
+							stack.PushA(o.Address());
+							RETURN TRUE;
 						ELSE
 						ELSE
 							RETURN FALSE
 							RETURN FALSE
 						END;
 						END;
@@ -526,7 +521,6 @@ TYPE
 			RETURN FALSE;
 			RETURN FALSE;
 		END PushTyped;
 		END PushTyped;
 
 
-
 		PROCEDURE Push*(o: Result): BOOLEAN;
 		PROCEDURE Push*(o: Result): BOOLEAN;
 		VAR
 		VAR
 			s: SHORTINT; i: INTEGER; l: LONGINT; h: HUGEINT;
 			s: SHORTINT; i: INTEGER; l: LONGINT; h: HUGEINT;
@@ -575,8 +569,8 @@ TYPE
 					NEW(int, stack.CallH(address));
 					NEW(int, stack.CallH(address));
 					RETURN int;
 					RETURN int;
 			|Reflection.sfTypeREAL:
 			|Reflection.sfTypeREAL:
-				 NEW(real, stack.CallR(address));
-				 RETURN real
+				NEW(real, stack.CallR(address));
+				RETURN real
 			|Reflection.sfTypeLONGREAL:
 			|Reflection.sfTypeLONGREAL:
 				NEW(real, stack.CallX(address));
 				NEW(real, stack.CallX(address));
 				RETURN real;
 				RETURN real;
@@ -733,7 +727,6 @@ TYPE
 
 
 	END FieldResult;
 	END FieldResult;
 
 
-
 	(* traverse types and supertypes for first occurence of symbol name *)
 	(* traverse types and supertypes for first occurence of symbol name *)
 	PROCEDURE FindInType(scope: Result; address: ADDRESS; type: ADDRESS; CONST name: ARRAY OF CHAR): Result;
 	PROCEDURE FindInType(scope: Result; address: ADDRESS; type: ADDRESS; CONST name: ARRAY OF CHAR): Result;
 	VAR tag: ADDRESS; typeInfo: Modules.TypeDesc; i, num: LONGINT;
 	VAR tag: ADDRESS; typeInfo: Modules.TypeDesc; i, num: LONGINT;
@@ -764,7 +757,6 @@ TYPE
 		RETURN NIL;
 		RETURN NIL;
 	END FindInType;
 	END FindInType;
 
 
-
 	PROCEDURE FindConstructor(scope: Result; type: ADDRESS): ProcedureResult;
 	PROCEDURE FindConstructor(scope: Result; type: ADDRESS): ProcedureResult;
 	VAR tag: ADDRESS; typeInfo: Modules.TypeDesc; i, num: LONGINT;
 	VAR tag: ADDRESS; typeInfo: Modules.TypeDesc; i, num: LONGINT;
 			proc: ProcedureResult; f: FieldResult;
 			proc: ProcedureResult; f: FieldResult;
@@ -871,7 +863,6 @@ TYPE
 
 
 	END Value;
 	END Value;
 
 
-
 	CONST StrValue="value";
 	CONST StrValue="value";
 	TYPE
 	TYPE
 
 
@@ -969,7 +960,6 @@ TYPE
 			RETURN ADDRESSOF(value)
 			RETURN ADDRESSOF(value)
 		END Address;
 		END Address;
 
 
-
 	END AddressValue;
 	END AddressValue;
 
 
 	IntegerValue*=OBJECT(Value)
 	IntegerValue*=OBJECT(Value)
@@ -1090,7 +1080,6 @@ TYPE
 			x := value; RETURN TRUE;
 			x := value; RETURN TRUE;
 		END GetBoolean;
 		END GetBoolean;
 
 
-
 		PROCEDURE WriteValue*(w: Streams.Writer);
 		PROCEDURE WriteValue*(w: Streams.Writer);
 		BEGIN IF value THEN w.String("TRUE") ELSE w.String("FALSE") END
 		BEGIN IF value THEN w.String("TRUE") ELSE w.String("FALSE") END
 		END WriteValue;
 		END WriteValue;
@@ -1138,7 +1127,6 @@ TYPE
 
 
 	END StringValue;
 	END StringValue;
 
 
-
 	SetValue*=OBJECT(Value)
 	SetValue*=OBJECT(Value)
 	VAR value*: SET;
 	VAR value*: SET;
 
 
@@ -1211,7 +1199,6 @@ TYPE
 			x := value; RETURN TRUE;
 			x := value; RETURN TRUE;
 		END GetRange;
 		END GetRange;
 
 
-
 		PROCEDURE WriteValue*(w: Streams.Writer);
 		PROCEDURE WriteValue*(w: Streams.Writer);
 		BEGIN
 		BEGIN
 			w.Int(FIRST(value),0); w.String(" .. "); w.Int(LAST(value),0); IF STEP(value) # 1 THEN w.String(" BY "); w.Int(STEP(value),0) END;
 			w.Int(FIRST(value),0); w.String(" .. "); w.Int(LAST(value),0); IF STEP(value) # 1 THEN w.String(" BY "); w.Int(STEP(value),0) END;
@@ -1356,7 +1343,6 @@ TYPE
 			w.String("] ");
 			w.String("] ");
 		END WriteValue;
 		END WriteValue;
 
 
-
 	END MathArrayValue;
 	END MathArrayValue;
 
 
 	(* object value represented as ANY wrapped in Value ? *)
 	(* object value represented as ANY wrapped in Value ? *)
@@ -1422,7 +1408,6 @@ TYPE
 			RETURN symbols.Get(index)(Symbol).item
 			RETURN symbols.Get(index)(Symbol).item
 		END GetItem;
 		END GetItem;
 
 
-
 		(* Enter a symbol with its name *)
 		(* Enter a symbol with its name *)
 		PROCEDURE Enter1*(item: Item; name: StringPool.Index);
 		PROCEDURE Enter1*(item: Item; name: StringPool.Index);
 		VAR any: ANY; symbol: Symbol;
 		VAR any: ANY; symbol: Symbol;
@@ -1512,7 +1497,6 @@ TYPE
 
 
 	END Scope;
 	END Scope;
 
 
-
 	PROCEDURE Indent(w: Streams.Writer; level: LONGINT);
 	PROCEDURE Indent(w: Streams.Writer; level: LONGINT);
 	BEGIN
 	BEGIN
 		WHILE level> 0 DO w.Char(TAB); DEC(level) END;
 		WHILE level> 0 DO w.Char(TAB); DEC(level) END;
@@ -1539,7 +1523,6 @@ TYPE
 		c.GetObject(o); IF o = NIL THEN RETURN NIL ELSE RETURN o(Value) END;
 		c.GetObject(o); IF o = NIL THEN RETURN NIL ELSE RETURN o(Value) END;
 	END ContentGetValue;
 	END ContentGetValue;
 
 
-
 	PROCEDURE NewIntegerValue(value: HUGEINT): IntegerValue;
 	PROCEDURE NewIntegerValue(value: HUGEINT): IntegerValue;
 	VAR obj: IntegerValue;
 	VAR obj: IntegerValue;
 	BEGIN
 	BEGIN

+ 10 - 17
source/FoxMinosObjectFile.Mod

@@ -3,14 +3,11 @@ MODULE FoxMinosObjectFile; (** AUTHOR "fof"; PURPOSE "Oberon Compiler Minos Obje
 IMPORT
 IMPORT
 	Scanner := FoxScanner, Basic := FoxBasic, SyntaxTree := FoxSyntaxTree, Global := FoxGlobal, SemanticChecker := FoxSemanticChecker, Fingerprinter := FoxFingerprinter, Sections := FoxSections,
 	Scanner := FoxScanner, Basic := FoxBasic, SyntaxTree := FoxSyntaxTree, Global := FoxGlobal, SemanticChecker := FoxSemanticChecker, Fingerprinter := FoxFingerprinter, Sections := FoxSections,
 	Streams, D := Debugging, Files, SYSTEM,Strings, BinaryCode := FoxBinaryCode, KernelLog, Diagnostics, SymbolFileFormat := FoxTextualSymbolFile, Options,
 	Streams, D := Debugging, Files, SYSTEM,Strings, BinaryCode := FoxBinaryCode, KernelLog, Diagnostics, SymbolFileFormat := FoxTextualSymbolFile, Options,
-	Formats := FoxFormats, IntermediateCode := FoxIntermediateCode, Machine
-	;
-
+	Formats := FoxFormats, IntermediateCode := FoxIntermediateCode, Machine;
 
 
 CONST
 CONST
 	Trace=FALSE;
 	Trace=FALSE;
 
 
-
 TYPE Name=ARRAY 256 OF CHAR;
 TYPE Name=ARRAY 256 OF CHAR;
 	ByteArray = POINTER TO ARRAY OF CHAR;
 	ByteArray = POINTER TO ARRAY OF CHAR;
 
 
@@ -187,14 +184,11 @@ TYPE
 			END;
 			END;
 		END FirstOffsets;
 		END FirstOffsets;
 
 
-
 		(* note: if 'caseSections' is TRUE, only case table sections are processed, otherwise only regular sections (imported symbol/system call sections are never processed) *)
 		(* note: if 'caseSections' is TRUE, only case table sections are processed, otherwise only regular sections (imported symbol/system call sections are never processed) *)
 		PROCEDURE SetOffsets(sectionList: Sections.SectionList);
 		PROCEDURE SetOffsets(sectionList: Sections.SectionList);
 		VAR
 		VAR
 			section: Sections.Section;
 			section: Sections.Section;
 			i: LONGINT;
 			i: LONGINT;
-
-
 		BEGIN
 		BEGIN
 			FOR i := 0 TO sectionList.Length() - 1 DO
 			FOR i := 0 TO sectionList.Length() - 1 DO
 				section := sectionList.GetSection(i);
 				section := sectionList.GetSection(i);
@@ -209,12 +203,12 @@ TYPE
 				IF section.symbol = module.module.moduleScope.bodyProcedure THEN
 				IF section.symbol = module.module.moduleScope.bodyProcedure THEN
 				ELSIF symbolName = "@moduleSelf" THEN
 				ELSIF symbolName = "@moduleSelf" THEN
 				ELSIF section.type = Sections.ConstSection THEN
 				ELSIF section.type = Sections.ConstSection THEN
-					 IF binarySection.os.alignment # 0 THEN
-					 	INC(codeSize,(-codeSize) MOD binarySection.os.alignment);
-					 END;
-					  section.SetOffset(codeSize); INC(codeSize,binarySection.pc); (* global constants: in code *)
-					  Basic.Align(codeSize, 4); (* word alignment *)
-						(*ReportSection(section)*)
+					IF binarySection.os.alignment # 0 THEN
+						INC(codeSize,(-codeSize) MOD binarySection.os.alignment);
+					END;
+					section.SetOffset(codeSize); INC(codeSize,binarySection.pc); (* global constants: in code *)
+					Basic.Align(codeSize, 4); (* word alignment *)
+					(*ReportSection(section)*)
 				ELSIF (section.type = Sections.CodeSection) OR (section.type = Sections.BodyCodeSection) THEN
 				ELSIF (section.type = Sections.CodeSection) OR (section.type = Sections.BodyCodeSection) THEN
 					(*IF section.symbol = module.module.moduleScope.bodyProcedure THEN
 					(*IF section.symbol = module.module.moduleScope.bodyProcedure THEN
 						bodyOffset := codeSize
 						bodyOffset := codeSize
@@ -223,10 +217,10 @@ TYPE
 					section.SetOffset(codeSize); INC(codeSize, binarySection.pc);
 					section.SetOffset(codeSize); INC(codeSize, binarySection.pc);
 					Basic.Align(codeSize, 4); (* word alignment *)
 					Basic.Align(codeSize, 4); (* word alignment *)
 					(*ReportSection(section)*)
 					(*ReportSection(section)*)
- 				ELSIF section.type = Sections.VarSection THEN
+				ELSIF section.type = Sections.VarSection THEN
 					INC(varSize, binarySection.pc);
 					INC(varSize, binarySection.pc);
 					IF binarySection.os.alignment # 0 THEN
 					IF binarySection.os.alignment # 0 THEN
-					 	INC(varSize,(-varSize) MOD binarySection.os.alignment);
+						INC(varSize,(-varSize) MOD binarySection.os.alignment);
 					END;
 					END;
 					section.SetOffset(-varSize); (* global variables: negative offset *)
 					section.SetOffset(-varSize); (* global variables: negative offset *)
 					(*ReportSection(section)*)
 					(*ReportSection(section)*)
@@ -278,7 +272,6 @@ TYPE
 				RETURN (type.declaredType.resolved IS SyntaxTree.RecordType)
 				RETURN (type.declaredType.resolved IS SyntaxTree.RecordType)
 			END TypeNeedsSection;
 			END TypeNeedsSection;
 
 
-
 		BEGIN
 		BEGIN
 			numberEntries := 0;
 			numberEntries := 0;
 			symbol := moduleScope.firstSymbol;
 			symbol := moduleScope.firstSymbol;
@@ -380,7 +373,7 @@ TYPE
 								patchOffset := (fixup.resolved.offset + fixup.displacement);
 								patchOffset := (fixup.resolved.offset + fixup.displacement);
 								IF (patchOffset DIV 4 >= 8000H) OR (patchOffset DIV 4< -8000H)
 								IF (patchOffset DIV 4 >= 8000H) OR (patchOffset DIV 4< -8000H)
 									OR (patchOffset MOD 4 # 0)
 									OR (patchOffset MOD 4 # 0)
-								 THEN
+								THEN
 									msg := "fixup problem: ";
 									msg := "fixup problem: ";
 									Basic.SegmentedNameToString(fixup.symbol.name, name);
 									Basic.SegmentedNameToString(fixup.symbol.name, name);
 									Strings.Append(msg, name);
 									Strings.Append(msg, name);

+ 0 - 2
source/FoxOberonFrontend.Mod

@@ -28,7 +28,6 @@ TYPE
 			RETURN parser.error;
 			RETURN parser.error;
 		END Error;
 		END Error;
 
 
-
 		PROCEDURE Done*(): BOOLEAN;
 		PROCEDURE Done*(): BOOLEAN;
 		BEGIN
 		BEGIN
 			RETURN ~parser.NextModule()
 			RETURN ~parser.NextModule()
@@ -43,5 +42,4 @@ TYPE
 		RETURN frontend;
 		RETURN frontend;
 	END Get;
 	END Get;
 
 
-
 END FoxOberonFrontend.
 END FoxOberonFrontend.

+ 31 - 37
source/FoxParser.Mod

@@ -18,12 +18,12 @@ CONST
 		Import     = Identifier [':=' Identifier] ['in' Identifier].
 		Import     = Identifier [':=' Identifier] ['in' Identifier].
 
 
 		DeclarationSequence  =  {
 		DeclarationSequence  =  {
-							 'const' [ConstDeclaration] {';' [ConstDeclaration]}
+							'const' [ConstDeclaration] {';' [ConstDeclaration]}
 							|'type'  [TypeDeclaration] {';' [TypeDeclaration]}
 							|'type'  [TypeDeclaration] {';' [TypeDeclaration]}
-						 	|'var'   [VariableDeclaration] {';' [VariableDeclaration]}
-						 	| ProcedureDeclaration
-						 	| OperatorDeclaration
-						 	| ';'
+							|'var'   [VariableDeclaration] {';' [VariableDeclaration]}
+							| ProcedureDeclaration
+							| OperatorDeclaration
+							| ';'
 							}
 							}
 
 
 	Declaration = IdentifierDefinition '=' Expression.
 	Declaration = IdentifierDefinition '=' Expression.
@@ -83,7 +83,7 @@ CONST
 	StatementSequence = Statement {';' Statement}.
 	StatementSequence = Statement {';' Statement}.
 
 
 	Statement =
 	Statement =
- 				[
+				[
 					Designator [':=' Expression |'!' Expression | '?' Expression | '<<' Expresssion | '>>' Expression]
 					Designator [':=' Expression |'!' Expression | '?' Expression | '<<' Expresssion | '>>' Expression]
 					| 'if' Expression 'then' StatementSequence
 					| 'if' Expression 'then' StatementSequence
 						{'elsif' Expression 'then' StatementSequence}
 						{'elsif' Expression 'then' StatementSequence}
@@ -92,13 +92,13 @@ CONST
 					| 'with' Identifier ':' QualifiedIdentifier 'do' StatementSequence
 					| 'with' Identifier ':' QualifiedIdentifier 'do' StatementSequence
 						{['|' Identifier ':'] QualifiedIdentifier 'do' StatementSequence}
 						{['|' Identifier ':'] QualifiedIdentifier 'do' StatementSequence}
 						[else StatementSequence]
 						[else StatementSequence]
-						 'end'
+						'end'
 					| 'case' Expression 'of' ['|'] Case {'|' Case} ['else' StatementSequence] 'end'
 					| 'case' Expression 'of' ['|'] Case {'|' Case} ['else' StatementSequence] 'end'
 					| 'while' Expression 'do' StatementSequence 'end'
 					| 'while' Expression 'do' StatementSequence 'end'
 					| 'repeat' StatementSequence 'until' Expression
 					| 'repeat' StatementSequence 'until' Expression
 					| 'for' Identifier ':=' Expression 'to' Expression ['by' Expression] 'do'
 					| 'for' Identifier ':=' Expression 'to' Expression ['by' Expression] 'do'
 						StatementSequence 'end'
 						StatementSequence 'end'
- 					| 'loop' StatementSequence 'end'
+					| 'loop' StatementSequence 'end'
 					| 'exit'
 					| 'exit'
 					| 'return' [Expression]
 					| 'return' [Expression]
 					| 'await' Expression
 					| 'await' Expression
@@ -132,7 +132,7 @@ CONST
 	Set = '{' [ RangeExpression {',' RangeExpression} ] '}'.
 	Set = '{' [ RangeExpression {',' RangeExpression} ] '}'.
 
 
 	Designator  = ('self' | 'result' | Identifier)
 	Designator  = ('self' | 'result' | Identifier)
-		      						{'.' Identifier  | '[' IndexList ']' | '(' [ExpressionList] ')' | '^'} [Flags].
+							{'.' Identifier  | '[' IndexList ']' | '(' [ExpressionList] ')' | '^'} [Flags].
 
 
 	RangeExpression = SimpleExpression | [SimpleExpression] '..' [SimpleExpression] ['by' SimpleExpression] | '*'.
 	RangeExpression = SimpleExpression | [SimpleExpression] '..' [SimpleExpression] ['by' SimpleExpression] | '*'.
 
 
@@ -254,13 +254,11 @@ TYPE
 			error := FALSE;
 			error := FALSE;
 		END Reset;
 		END Reset;
 
 
-
 		PROCEDURE SetLax*;
 		PROCEDURE SetLax*;
 		BEGIN
 		BEGIN
 			Lax := TRUE;
 			Lax := TRUE;
 		END SetLax;
 		END SetLax;
 
 
-
 		(** output error message and / or given code *)
 		(** output error message and / or given code *)
 		PROCEDURE Error(position: Position; code: LONGINT; CONST message: ARRAY OF CHAR);
 		PROCEDURE Error(position: Position; code: LONGINT; CONST message: ARRAY OF CHAR);
 		BEGIN
 		BEGIN
@@ -604,7 +602,7 @@ TYPE
 				IF ~Optional( Scanner.Period )THEN
 				IF ~Optional( Scanner.Period )THEN
 					suffix := prefix;  prefix := SyntaxTree.invalidIdentifier;   (* empty *)
 					suffix := prefix;  prefix := SyntaxTree.invalidIdentifier;   (* empty *)
 				ELSE
 				ELSE
-					 suffix := Identifier(position1);
+					suffix := Identifier(position1);
 				END;
 				END;
 				qualifiedIdentifier := SyntaxTree.NewQualifiedIdentifier( position0, prefix,suffix);
 				qualifiedIdentifier := SyntaxTree.NewQualifiedIdentifier( position0, prefix,suffix);
 			ELSE
 			ELSE
@@ -765,7 +763,7 @@ TYPE
 		END RangeExpression;
 		END RangeExpression;
 
 
 		(** Designator  = ('self' | 'result' | Identifier)
 		(** Designator  = ('self' | 'result' | Identifier)
-		                  {'.' Identifier  | '[' IndexList ']' | '(' [ExpressionList] ')' | '^'} [Flags].
+			{'.' Identifier  | '[' IndexList ']' | '(' [ExpressionList] ')' | '^'} [Flags].
 		**)
 		**)
 		PROCEDURE Designator( ): SyntaxTree.Designator;
 		PROCEDURE Designator( ): SyntaxTree.Designator;
 		VAR
 		VAR
@@ -890,9 +888,9 @@ TYPE
 		END MathArray;
 		END MathArray;
 
 
 		(** Factor = Number | Character | String | 'nil' | 'imag' | 'true' | 'false' | Set
 		(** Factor = Number | Character | String | 'nil' | 'imag' | 'true' | 'false' | Set
-			 			  | '(' Expression ')' | '~' Factor | Factor '`' | Designator | MathArray.
-			 			  | 'SIZE' 'OF' Designator | 'ADDRESS' 'OF' Designator | 'ALIAS' OF Expression
-			 			  **)
+						| '(' Expression ')' | '~' Factor | Factor '`' | Designator | MathArray.
+						| 'SIZE' 'OF' Designator | 'ADDRESS' 'OF' Designator | 'ALIAS' OF Expression
+						**)
 		PROCEDURE Factor( ): SyntaxTree.Expression;
 		PROCEDURE Factor( ): SyntaxTree.Expression;
 		VAR factor: SyntaxTree.Expression; position: Position; operator: LONGINT;
 		VAR factor: SyntaxTree.Expression; position: Position; operator: LONGINT;
 		BEGIN
 		BEGIN
@@ -993,7 +991,7 @@ TYPE
 		END Factor;
 		END Factor;
 
 
 		(** Term = Factor {MulOp Factor}.
 		(** Term = Factor {MulOp Factor}.
-		   MulOp = '*' | '**' | '.*' | '+*' | '/' | '\' | './' | 'div' | 'mod' | '&'.
+			MulOp = '*' | '**' | '.*' | '+*' | '/' | '\' | './' | 'div' | 'mod' | '&'.
 		**)
 		**)
 		PROCEDURE Term( ): SyntaxTree.Expression;
 		PROCEDURE Term( ): SyntaxTree.Expression;
 		VAR term, factor: SyntaxTree.Expression;  operator: LONGINT; position: Position;
 		VAR term, factor: SyntaxTree.Expression;  operator: LONGINT; position: Position;
@@ -1040,9 +1038,9 @@ TYPE
 		(**
 		(**
 			Expression           = RangeExpression [RelationOp RangeExpression].
 			Expression           = RangeExpression [RelationOp RangeExpression].
 			RelationOp           = '=' | '.=' | '#' | '.#'
 			RelationOp           = '=' | '.=' | '#' | '.#'
-			                     | '<' | '.<' | '<=' | '.<=' | '>' | '.>' | '>=' | '.>='
-			                     | '??' | '!!' | '<<?' | '>>?'
-			                     | 'in' | 'is'
+						| '<' | '.<' | '<=' | '.<=' | '>' | '.>' | '>=' | '.>='
+						| '??' | '!!' | '<<?' | '>>?'
+						| 'in' | 'is'
 		**)
 		**)
 		PROCEDURE Expression*( ): SyntaxTree.Expression;
 		PROCEDURE Expression*( ): SyntaxTree.Expression;
 		VAR expression, rightExpression: SyntaxTree.Expression;  operator: LONGINT;  position: Position;
 		VAR expression, rightExpression: SyntaxTree.Expression;  operator: LONGINT;  position: Position;
@@ -1085,7 +1083,6 @@ TYPE
 			IF Trace THEN E( "Case" ) END;
 			IF Trace THEN E( "Case" ) END;
 		END Case;
 		END Case;
 
 
-
 		(**		Statement =
 		(**		Statement =
                      [
                      [
                      Designator [':=' Expression |'!' Expression | '?' Expression | '<<' Expresssion | '>>' Expression]
                      Designator [':=' Expression |'!' Expression | '?' Expression | '<<' Expresssion | '>>' Expression]
@@ -1095,7 +1092,7 @@ TYPE
                         'end'
                         'end'
                      | 'with' Identifier ':' QualifiedIdentifier 'do' StatementSequence
                      | 'with' Identifier ':' QualifiedIdentifier 'do' StatementSequence
                          {'|' [Identifier ':'] QualifiedIdentifier 'do' StatementSequence}
                          {'|' [Identifier ':'] QualifiedIdentifier 'do' StatementSequence}
-                				[else StatementSequence]
+                         [else StatementSequence]
                          'end'
                          'end'
                      | 'case' Expression 'of' ['|'] Case {'|' Case} ['else' StatementSequence] 'end'
                      | 'case' Expression 'of' ['|'] Case {'|' Case} ['else' StatementSequence] 'end'
                      | 'while' Expression 'do' StatementSequence 'end'
                      | 'while' Expression 'do' StatementSequence 'end'
@@ -1433,7 +1430,7 @@ TYPE
 		END Code;
 		END Code;
 
 
 		(** Body = 'begin' [Flags] StatementSequence ['finally' StatementSequence]
 		(** Body = 'begin' [Flags] StatementSequence ['finally' StatementSequence]
-		         			| 'code' Code. **)
+						| 'code' Code. **)
 		PROCEDURE Body( scope: SyntaxTree.ProcedureScope ): SyntaxTree.Body;
 		PROCEDURE Body( scope: SyntaxTree.ProcedureScope ): SyntaxTree.Body;
 		VAR body: SyntaxTree.Body; code: SyntaxTree.Code; position: Position;  previousScope: SyntaxTree.Scope;
 		VAR body: SyntaxTree.Body; code: SyntaxTree.Code; position: Position;  previousScope: SyntaxTree.Scope;
 		BEGIN
 		BEGIN
@@ -1516,7 +1513,7 @@ TYPE
 			(* generic empty OBJECT type *)
 			(* generic empty OBJECT type *)
 			IF Peek(Scanner.Semicolon) OR Peek(Scanner.RightParenthesis) THEN
 			IF Peek(Scanner.Semicolon) OR Peek(Scanner.RightParenthesis) THEN
 				Scanner.GetKeyword(scanner.case,Scanner.Object,identifier);
 				Scanner.GetKeyword(scanner.case,Scanner.Object,identifier);
-	      		qualifiedIdentifier := SyntaxTree.NewQualifiedIdentifier(position,SyntaxTree.invalidIdentifier,identifier);
+				qualifiedIdentifier := SyntaxTree.NewQualifiedIdentifier(position,SyntaxTree.invalidIdentifier,identifier);
 				type := SyntaxTree.NewQualifiedType( position, parentScope, qualifiedIdentifier );
 				type := SyntaxTree.NewQualifiedType( position, parentScope, qualifiedIdentifier );
 				RETURN type
 				RETURN type
 			END;
 			END;
@@ -1593,14 +1590,12 @@ TYPE
 				cellType.SetModifiers(modifiers);
 				cellType.SetModifiers(modifiers);
 			END;
 			END;
 
 
-
 			IF Optional( Scanner.LeftParenthesis ) THEN
 			IF Optional( Scanner.LeftParenthesis ) THEN
 				PortList(cellType,cellScope);
 				PortList(cellType,cellScope);
 			END;
 			END;
 
 
 			IF Optional( Scanner.Semicolon ) THEN END;
 			IF Optional( Scanner.Semicolon ) THEN END;
 
 
-
 			WHILE Optional(Scanner.Import) DO ImportList(cellScope) END;
 			WHILE Optional(Scanner.Import) DO ImportList(cellScope) END;
 			DeclarationSequence( cellScope);
 			DeclarationSequence( cellScope);
 			IF Peek(Scanner.Begin) OR Peek(Scanner.Code) THEN
 			IF Peek(Scanner.Begin) OR Peek(Scanner.Code) THEN
@@ -1617,7 +1612,7 @@ TYPE
 
 
 		(** PointerType = 'pointer' [Flags] 'to' Type. **)
 		(** PointerType = 'pointer' [Flags] 'to' Type. **)
 		PROCEDURE PointerType( position: Position; parentScope: SyntaxTree.Scope ): SyntaxTree.PointerType;
 		PROCEDURE PointerType( position: Position; parentScope: SyntaxTree.Scope ): SyntaxTree.PointerType;
-		VAR pointerType: SyntaxTree.PointerType;  base: SyntaxTree.Type; 	modifiers: SyntaxTree.Modifier;
+		VAR pointerType: SyntaxTree.PointerType; base: SyntaxTree.Type; modifiers: SyntaxTree.Modifier;
 		BEGIN
 		BEGIN
 			IF Trace THEN S( "PointerType" ) END;
 			IF Trace THEN S( "PointerType" ) END;
 			(* pointer token already consumed *)
 			(* pointer token already consumed *)
@@ -1683,7 +1678,7 @@ TYPE
 
 
 		(** ArrayType     = 'array' 'of' Type | 'array' Expression {',' Expression} 'of' Type
 		(** ArrayType     = 'array' 'of' Type | 'array' Expression {',' Expression} 'of' Type
 													| 'array' '[' MathArraySize {',' MathArraySize} ']' ['of' Type].
 													| 'array' '[' MathArraySize {',' MathArraySize} ']' ['of' Type].
-	  		 MathArraySize = Expression | '*' | '?'.
+			MathArraySize = Expression | '*' | '?'.
 		**)
 		**)
 		PROCEDURE ArrayType(position: Position;   parentScope: SyntaxTree.Scope ): SyntaxTree.Type;
 		PROCEDURE ArrayType(position: Position;   parentScope: SyntaxTree.Scope ): SyntaxTree.Type;
 		VAR
 		VAR
@@ -2044,7 +2039,7 @@ TYPE
 		END CommentWithPart;
 		END CommentWithPart;
 
 
 		(** ProcedureDeclaration = 'procedure' ['^'|'&'|'~'|'-'|Flags ['-']] IdentifierDefinition [FormalParameters]';'
 		(** ProcedureDeclaration = 'procedure' ['^'|'&'|'~'|'-'|Flags ['-']] IdentifierDefinition [FormalParameters]';'
-			                       DeclarationSequence  [Body] 'end' Identifier.
+					DeclarationSequence  [Body] 'end' Identifier.
 			Forward declarations ignored.
 			Forward declarations ignored.
 		**)
 		**)
 		PROCEDURE ProcedureDeclaration( parentScope: SyntaxTree.Scope);
 		PROCEDURE ProcedureDeclaration( parentScope: SyntaxTree.Scope);
@@ -2148,7 +2143,7 @@ TYPE
 		END ProcedureDeclaration;
 		END ProcedureDeclaration;
 
 
 		(** OperatorDeclaration  = 'operator' [Flags] ['-'] String ['*'|'-'] FormalParameters ';'
 		(** OperatorDeclaration  = 'operator' [Flags] ['-'] String ['*'|'-'] FormalParameters ';'
-			                       DeclarationSequence [Body] 'end' String.
+					DeclarationSequence [Body] 'end' String.
 		**)
 		**)
 		PROCEDURE OperatorDeclaration(parentScope: SyntaxTree.Scope );
 		PROCEDURE OperatorDeclaration(parentScope: SyntaxTree.Scope );
 		VAR
 		VAR
@@ -2189,7 +2184,6 @@ TYPE
 			ELSE access := SyntaxTree.Internal;
 			ELSE access := SyntaxTree.Internal;
 			END;
 			END;
 
 
-
 			procedureScope := SyntaxTree.NewProcedureScope(parentScope);
 			procedureScope := SyntaxTree.NewProcedureScope(parentScope);
 			operator := SyntaxTree.NewOperator( token.position, SyntaxTree.NewIdentifier(string^), procedureScope);
 			operator := SyntaxTree.NewOperator( token.position, SyntaxTree.NewIdentifier(string^), procedureScope);
 			CommentSymbol(operator);
 			CommentSymbol(operator);
@@ -2297,12 +2291,12 @@ TYPE
 		END ConstDeclaration;
 		END ConstDeclaration;
 
 
 		(** DeclarationSequence  =  { 'const' [ConstDeclaration] {';' [ConstDeclaration]}
 		(** DeclarationSequence  =  { 'const' [ConstDeclaration] {';' [ConstDeclaration]}
-			                         |'type'  [TypeDeclaration] {';' [TypeDeclaration]}
-			                         |'var'   [VariableDeclaration] {';' [VariableDeclaration]}
-			                         | ProcedureDeclaration
-			                         | OperatorDeclaration
-			                         | ';'
-			                        }
+						|'type'  [TypeDeclaration] {';' [TypeDeclaration]}
+						|'var'   [VariableDeclaration] {';' [VariableDeclaration]}
+						| ProcedureDeclaration
+						| OperatorDeclaration
+						| ';'
+					}
 		**)
 		**)
 		PROCEDURE DeclarationSequence( parentScope: SyntaxTree.Scope);
 		PROCEDURE DeclarationSequence( parentScope: SyntaxTree.Scope);
 		VAR previousScope: SyntaxTree.Scope;
 		VAR previousScope: SyntaxTree.Scope;

+ 9 - 17
source/FoxPrintout.Mod

@@ -225,7 +225,6 @@ TYPE
 			VisitBasicType(x);
 			VisitBasicType(x);
 		END VisitAnyType;
 		END VisitAnyType;
 
 
-
 		PROCEDURE VisitMathArrayType*(x: SyntaxTree.MathArrayType);
 		PROCEDURE VisitMathArrayType*(x: SyntaxTree.MathArrayType);
 		BEGIN
 		BEGIN
 			Keyword("ARRAY " );
 			Keyword("ARRAY " );
@@ -279,7 +278,6 @@ TYPE
 			FlagEnd(first);
 			FlagEnd(first);
 		END ObjectFlags;
 		END ObjectFlags;
 
 
-
 		PROCEDURE VisitPointerType*(x: SyntaxTree.PointerType);
 		PROCEDURE VisitPointerType*(x: SyntaxTree.PointerType);
 		VAR pointerBase: SyntaxTree.Type;
 		VAR pointerBase: SyntaxTree.Type;
 		BEGIN
 		BEGIN
@@ -398,14 +396,12 @@ TYPE
 			IF ~first THEN w.String("} ") END;
 			IF ~first THEN w.String("} ") END;
 		END FlagEnd;
 		END FlagEnd;
 
 
-
 		PROCEDURE Value(identifier: SyntaxTree.Identifier; value: HUGEINT; VAR first: BOOLEAN);
 		PROCEDURE Value(identifier: SyntaxTree.Identifier; value: HUGEINT; VAR first: BOOLEAN);
 		BEGIN
 		BEGIN
 			Flag(identifier,first);
 			Flag(identifier,first);
 			w.String("("); w.Int(value,1); w.String(")");
 			w.String("("); w.Int(value,1); w.String(")");
 		END Value;
 		END Value;
 
 
-
 		PROCEDURE VisitProcedureType*(x: SyntaxTree.ProcedureType);
 		PROCEDURE VisitProcedureType*(x: SyntaxTree.ProcedureType);
 		VAR first: BOOLEAN;
 		VAR first: BOOLEAN;
 		BEGIN
 		BEGIN
@@ -588,8 +584,8 @@ TYPE
 		PROCEDURE VisitBracketDesignator*(x: SyntaxTree.BracketDesignator);
 		PROCEDURE VisitBracketDesignator*(x: SyntaxTree.BracketDesignator);
 		BEGIN
 		BEGIN
 			Expression(x.left);
 			Expression(x.left);
-		 	IF info THEN AlertString("(*<BracketDesignator>*)") END;
-		 	w.String("["); ExpressionList(x.parameters); w.String("]");
+			IF info THEN AlertString("(*<BracketDesignator>*)") END;
+			w.String("["); ExpressionList(x.parameters); w.String("]");
 		END VisitBracketDesignator;
 		END VisitBracketDesignator;
 
 
 		PROCEDURE VisitParameterDesignator*(x: SyntaxTree.ParameterDesignator);
 		PROCEDURE VisitParameterDesignator*(x: SyntaxTree.ParameterDesignator);
@@ -738,7 +734,6 @@ TYPE
 			VisitStatementBlock(x.block);
 			VisitStatementBlock(x.block);
 		END VisitInlineCallDesignator;
 		END VisitInlineCallDesignator;
 
 
-
 		PROCEDURE VisitStatementDesignator*(x: SyntaxTree.StatementDesignator);
 		PROCEDURE VisitStatementDesignator*(x: SyntaxTree.StatementDesignator);
 		BEGIN
 		BEGIN
 			Indent; Keyword("STATEMENT-DESIGNATOR ");
 			Indent; Keyword("STATEMENT-DESIGNATOR ");
@@ -749,7 +744,6 @@ TYPE
 			Indent; Statement(x.statement);
 			Indent; Statement(x.statement);
 		END VisitStatementDesignator;
 		END VisitStatementDesignator;
 
 
-
 		PROCEDURE VisitBuiltinCallDesignator*(x: SyntaxTree.BuiltinCallDesignator);
 		PROCEDURE VisitBuiltinCallDesignator*(x: SyntaxTree.BuiltinCallDesignator);
 		BEGIN
 		BEGIN
 			IF x.left # NIL THEN
 			IF x.left # NIL THEN
@@ -1178,7 +1172,6 @@ TYPE
 			w.String( ")" );
 			w.String( ")" );
 		END ParameterList;
 		END ParameterList;
 
 
-
 		PROCEDURE Access(access: SET);
 		PROCEDURE Access(access: SET);
 		BEGIN
 		BEGIN
 			IF SyntaxTree.PublicWrite IN access THEN w.String(" PublicWrite") END;
 			IF SyntaxTree.PublicWrite IN access THEN w.String(" PublicWrite") END;
@@ -1297,7 +1290,6 @@ TYPE
 				type := x.type(SyntaxTree.ProcedureType);
 				type := x.type(SyntaxTree.ProcedureType);
 				PrintSymbol(x);
 				PrintSymbol(x);
 
 
-
 				ParameterList(type.firstParameter);
 				ParameterList(type.firstParameter);
 				IF type.returnType # NIL THEN
 				IF type.returnType # NIL THEN
 					w.String( ": " );
 					w.String( ": " );
@@ -1322,7 +1314,7 @@ TYPE
 						IF mode >= SymbolFile THEN
 						IF mode >= SymbolFile THEN
 							ProcedureScope(x.procedureScope);
 							ProcedureScope(x.procedureScope);
 						END;
 						END;
-						Indent;  Keyword("END " );  	w.String( '"' );  Identifier(x.name);  w.String( '"' );
+						Indent; Keyword("END " ); w.String( '"' ); Identifier(x.name); w.String( '"' );
 					END;
 					END;
 				END;
 				END;
 			END
 			END
@@ -1522,14 +1514,14 @@ TYPE
 			Expression(x.left);
 			Expression(x.left);
 			identifier := Global.GetIdentifier(x.op,case);
 			identifier := Global.GetIdentifier(x.op,case);
 			w.String(" "); Identifier(identifier); w.String(" ");
 			w.String(" "); Identifier(identifier); w.String(" ");
-			 Expression(x.right);
+			Expression(x.right);
 		END VisitCommunicationStatement;
 		END VisitCommunicationStatement;
 
 
 		PROCEDURE IfPart(x: SyntaxTree.IfPart);
 		PROCEDURE IfPart(x: SyntaxTree.IfPart);
 		BEGIN
 		BEGIN
 			IF DebugPosition THEN TRACE(x.position.start, x.position.end, x.end.start, x.end.end) END;
 			IF DebugPosition THEN TRACE(x.position.start, x.position.end, x.end.start, x.end.end) END;
 			Comments(x.comment, x, FALSE);
 			Comments(x.comment, x, FALSE);
-	 		Keyword("IF " );
+			Keyword("IF " );
 			Expression(x.condition);
 			Expression(x.condition);
 			Keyword(" THEN " );
 			Keyword(" THEN " );
 			Comments(x.comment,x,TRUE);
 			Comments(x.comment,x,TRUE);
@@ -1683,7 +1675,9 @@ TYPE
 		END VisitExitableBlock;
 		END VisitExitableBlock;
 
 
 		PROCEDURE VisitExitStatement*(x: SyntaxTree.ExitStatement);
 		PROCEDURE VisitExitStatement*(x: SyntaxTree.ExitStatement);
-		BEGIN 	Keyword("EXIT" ) END VisitExitStatement;
+		BEGIN
+			Keyword("EXIT" );
+		END VisitExitStatement;
 
 
 		PROCEDURE VisitReturnStatement*(x: SyntaxTree.ReturnStatement);
 		PROCEDURE VisitReturnStatement*(x: SyntaxTree.ReturnStatement);
 		BEGIN
 		BEGIN
@@ -1892,7 +1886,6 @@ TYPE
 
 
 	END Printer;
 	END Printer;
 
 
-
 (* debugging helper *)
 (* debugging helper *)
 VAR
 VAR
 	debug: Printer;
 	debug: Printer;
@@ -1903,7 +1896,6 @@ VAR
 		NEW(p,w,mode,info); RETURN p
 		NEW(p,w,mode,info); RETURN p
 	END NewPrinter;
 	END NewPrinter;
 
 
-
 	PROCEDURE Info*(CONST info: ARRAY OF CHAR; a: ANY);
 	PROCEDURE Info*(CONST info: ARRAY OF CHAR; a: ANY);
 	VAR symbol: SyntaxTree.Symbol; scope: SyntaxTree.Scope;
 	VAR symbol: SyntaxTree.Symbol; scope: SyntaxTree.Scope;
 	BEGIN
 	BEGIN
@@ -1934,7 +1926,7 @@ VAR
 		ELSIF a IS SyntaxTree.Scope THEN
 		ELSIF a IS SyntaxTree.Scope THEN
 			scope := a(SyntaxTree.Scope);
 			scope := a(SyntaxTree.Scope);
 			WHILE(scope # NIL) DO
 			WHILE(scope # NIL) DO
-				D.Ln; 		D.Str("      ");
+				D.Ln; D.Str("      ");
 				IF scope IS SyntaxTree.ModuleScope THEN D.Str("ModuleScope: ")
 				IF scope IS SyntaxTree.ModuleScope THEN D.Str("ModuleScope: ")
 				ELSIF scope IS SyntaxTree.ProcedureScope THEN D.Str("ProcedureScope: ");
 				ELSIF scope IS SyntaxTree.ProcedureScope THEN D.Str("ProcedureScope: ");
 				ELSIF scope IS SyntaxTree.RecordScope THEN D.Str("RecordScope: ");
 				ELSIF scope IS SyntaxTree.RecordScope THEN D.Str("RecordScope: ");

+ 1 - 4
source/FoxProfiler.Mod

@@ -89,7 +89,6 @@ TYPE
 	END;
 	END;
 	HashIntArray = ARRAY 2*MaxProcesses OF HashEntryInt;
 	HashIntArray = ARRAY 2*MaxProcesses OF HashEntryInt;
 
 
-
 VAR
 VAR
 	(* modules *)
 	(* modules *)
 	modules:Modules;
 	modules:Modules;
@@ -185,7 +184,7 @@ VAR
 	VAR time: HUGEINT; p: Process;
 	VAR time: HUGEINT; p: Process;
 	BEGIN
 	BEGIN
 		time:= GetTimer();
 		time:= GetTimer();
-		IF TraceEnter THEN log.String("Enter procedure: "); log.Int(moduleId,1); log.String(", "); log.Int(procedureId,1); log.Ln; log.Update 	END;
+		IF TraceEnter THEN log.String("Enter procedure: "); log.Int(moduleId,1); log.String(", "); log.Int(procedureId,1); log.Ln; log.Update END;
 		p := GetProcess();
 		p := GetProcess();
 		p.Enter(moduleId,procedureId,time);
 		p.Enter(moduleId,procedureId,time);
 	END EnterProcedure;
 	END EnterProcedure;
@@ -338,7 +337,6 @@ VAR
 		END;
 		END;
 		log.Update;
 		log.Update;
 
 
-
 		FOR k := 0 TO numberProcesses-1 DO
 		FOR k := 0 TO numberProcesses-1 DO
 			IF processes[k].stackPosition # 0 THEN
 			IF processes[k].stackPosition # 0 THEN
 				log.String("warning: process "); log.Int(k,1); log.String(" still running with a stack of "); log.Int(processes[k].stackPosition,1); log.Ln;
 				log.String("warning: process "); log.Int(k,1); log.String(" still running with a stack of "); log.Int(processes[k].stackPosition,1); log.Ln;
@@ -365,7 +363,6 @@ VAR
 		ExitProcedure(0,0);
 		ExitProcedure(0,0);
 	END CalibrateProc;
 	END CalibrateProc;
 
 
-
 	PROCEDURE Calibrate;
 	PROCEDURE Calibrate;
 	VAR cal: LONGINT; i: SIZE; process: Process;
 	VAR cal: LONGINT; i: SIZE; process: Process;
 	BEGIN
 	BEGIN

+ 3 - 22
source/FoxProgTools.Mod

@@ -44,7 +44,7 @@ TYPE
 		PROCEDURE DumpNames(w: Streams.Writer);
 		PROCEDURE DumpNames(w: Streams.Writer);
 		VAR
 		VAR
 			i: LONGINT;
 			i: LONGINT;
-			name: 	ARRAY 256 OF CHAR;
+			name: ARRAY 256 OF CHAR;
 		BEGIN
 		BEGIN
 			w.Int(Length(), 0); w.String(" names:"); w.Ln;
 			w.Int(Length(), 0); w.String(" names:"); w.Ln;
 			FOR i := 0 TO Length() - 1 DO
 			FOR i := 0 TO Length() - 1 DO
@@ -392,7 +392,6 @@ TYPE
 				END;
 				END;
 			END Comment;
 			END Comment;
 
 
-
 		BEGIN
 		BEGIN
 			ch := context.arg.Get();
 			ch := context.arg.Get();
 			SkipBlanks;  i := 0;
 			SkipBlanks;  i := 0;
@@ -416,7 +415,6 @@ TYPE
 			RETURN (i>0);
 			RETURN (i>0);
 		END GetNextSymbol;
 		END GetNextSymbol;
 
 
-
 	BEGIN
 	BEGIN
 		NEW(options);
 		NEW(options);
 		options.Add("e", "export", Options.Flag);
 		options.Add("e", "export", Options.Flag);
@@ -508,10 +506,6 @@ TYPE
 
 
 		END Replacer;
 		END Replacer;
 
 
-
-
-
-
 	VAR fileName,instr: ARRAY 256 OF CHAR; w: Streams.Writer; reader: Files.Reader; file: Files.File; ch: CHAR;
 	VAR fileName,instr: ARRAY 256 OF CHAR; w: Streams.Writer; reader: Files.Reader; file: Files.File; ch: CHAR;
 		line: ARRAY 1024 OF CHAR;
 		line: ARRAY 1024 OF CHAR;
 
 
@@ -522,14 +516,11 @@ TYPE
 		cpuoptionReplacer: Replacer;
 		cpuoptionReplacer: Replacer;
 		bitwidthReplacer: Replacer;
 		bitwidthReplacer: Replacer;
 
 
-
-
 		numberMnemonics: LONGINT;
 		numberMnemonics: LONGINT;
 		numberInstructions : LONGINT;
 		numberInstructions : LONGINT;
 		maxMnemonicNameLength: LONGINT;
 		maxMnemonicNameLength: LONGINT;
 		maxOpcodeLength: LONGINT;
 		maxOpcodeLength: LONGINT;
 
 
-
 		PROCEDURE Priority(i: Instruction): LONGINT;
 		PROCEDURE Priority(i: Instruction): LONGINT;
 		VAR prio: LONGINT;
 		VAR prio: LONGINT;
 
 
@@ -587,7 +578,7 @@ TYPE
 		PROCEDURE GetLine(VAR line: ARRAY OF CHAR);
 		PROCEDURE GetLine(VAR line: ARRAY OF CHAR);
 		VAR i : LONGINT;
 		VAR i : LONGINT;
 		BEGIN
 		BEGIN
-			 i := 0;
+			i := 0;
 			WHILE(ch # CR) & (ch # LF) & (ch # 0X) DO
 			WHILE(ch # CR) & (ch # LF) & (ch # 0X) DO
 				line[i] := ch; INC(i);
 				line[i] := ch; INC(i);
 				GetCh();
 				GetCh();
@@ -645,7 +636,6 @@ TYPE
 				END;
 				END;
 			END Follows;
 			END Follows;
 
 
-
 			PROCEDURE OpCode(CONST code: ARRAY OF CHAR);
 			PROCEDURE OpCode(CONST code: ARRAY OF CHAR);
 			VAR ch: CHAR; i: LONGINT;
 			VAR ch: CHAR; i: LONGINT;
 				op: ARRAY 3 OF CHAR;
 				op: ARRAY 3 OF CHAR;
@@ -669,7 +659,6 @@ TYPE
 					END;
 					END;
 				END Hex;
 				END Hex;
 
 
-
 			BEGIN
 			BEGIN
 				error := FALSE;
 				error := FALSE;
 				ModRM := "";
 				ModRM := "";
@@ -816,7 +805,6 @@ TYPE
 				w.String("}");
 				w.String("}");
 			END Options;
 			END Options;
 
 
-
 		PROCEDURE ParseLine(CONST  line: ARRAY OF CHAR);
 		PROCEDURE ParseLine(CONST  line: ARRAY OF CHAR);
 		VAR ch: CHAR; i : LONGINT;
 		VAR ch: CHAR; i : LONGINT;
 
 
@@ -826,16 +814,13 @@ TYPE
 				len := 0;
 				len := 0;
 				ch:= line[i]; INC(i);
 				ch:= line[i]; INC(i);
 				WHILE(ch # TAB) & (ch # LF) & (ch # 0X) DO
 				WHILE(ch # TAB) & (ch # LF) & (ch # 0X) DO
-					WHILE(ch = " ") DO 	ch:= line[i]; INC(i); END;
+					WHILE (ch = " ") DO ch:= line[i]; INC(i); END;
 					sym[len] := ch; INC(len);
 					sym[len] := ch; INC(len);
 					ch:= line[i]; INC(i);
 					ch:= line[i]; INC(i);
 				END;
 				END;
 				sym[len] := 0X;
 				sym[len] := 0X;
 			END NextSym;
 			END NextSym;
 
 
-
-
-
 		BEGIN
 		BEGIN
 			i := 0; ch := line[0];
 			i := 0; ch := line[0];
 			IF (ch = '"') OR (ch = ";") THEN (* comment line skipped *)
 			IF (ch = '"') OR (ch = ";") THEN (* comment line skipped *)
@@ -880,7 +865,6 @@ TYPE
 				END;
 				END;
 			END;
 			END;
 
 
-
 		END ParseLine;
 		END ParseLine;
 
 
 	BEGIN
 	BEGIN
@@ -990,7 +974,6 @@ TYPE
 			mnemonic := firstMnemonic;
 			mnemonic := firstMnemonic;
 			maxOpcodeLength:= 0;
 			maxOpcodeLength:= 0;
 
 
-
 			WHILE(mnemonic # NIL) DO
 			WHILE(mnemonic # NIL) DO
 				(*
 				(*
 				IF Strings.Length(mnemonic.name)+1 > maxMnemonicNameLength THEN maxMnemonicNameLength := Strings.Length(mnemonic.name)+1 END;
 				IF Strings.Length(mnemonic.name)+1 > maxMnemonicNameLength THEN maxMnemonicNameLength := Strings.Length(mnemonic.name)+1 END;
@@ -1080,7 +1063,6 @@ TYPE
 				mnemonic := mnemonic.next;
 				mnemonic := mnemonic.next;
 			END;
 			END;
 
 
-
 			w.Char(09X); w.String("numberMnemonics = "); w.Int(numberMnemonics,1); w.String(";"); w.Ln;
 			w.Char(09X); w.String("numberMnemonics = "); w.Int(numberMnemonics,1); w.String(";"); w.Ln;
 			w.Char(09X); w.String("numberInstructions = "); w.Int(numberInstructions,1); w.String(";");w.Ln;
 			w.Char(09X); w.String("numberInstructions = "); w.Int(numberInstructions,1); w.String(";");w.Ln;
 			w.Char(09X); w.String("maxMnemonicNameLength ="); w.Int(maxMnemonicNameLength,1); w.String(";"); w.Ln;
 			w.Char(09X); w.String("maxMnemonicNameLength ="); w.Int(maxMnemonicNameLength,1); w.String(";"); w.Ln;
@@ -1112,7 +1094,6 @@ FoxProgTools.Enum --incremental a b c d e ~
 FoxProgTools.Enum --start=10 a b c  d e ~
 FoxProgTools.Enum --start=10 a b c  d e ~
 FoxProgTools.Enum --start=10 --hex  a b c  d e ~
 FoxProgTools.Enum --start=10 --hex  a b c  d e ~
 
 
-
 FoxProgTools.ParseAMDInstructionSet FoxInstructionSetAMD64TabSeperated.txt ~
 FoxProgTools.ParseAMDInstructionSet FoxInstructionSetAMD64TabSeperated.txt ~
 
 
 FoxProgTools.ParseARMInstructionSet OC/FoxInstructionSetARM.txt ~
 FoxProgTools.ParseARMInstructionSet OC/FoxInstructionSetARM.txt ~

+ 29 - 37
source/FoxScanner.Mod

@@ -30,19 +30,19 @@ CONST
 	note: order of symbols is important for the parser, do not modify without looking it up
 	note: order of symbols is important for the parser, do not modify without looking it up
 
 
 	FoxProgTools.Enum --export --linefeed=6
 	FoxProgTools.Enum --export --linefeed=6
-    	None
+	None
 	(* RelationOps: Equal ... Is *)
 	(* RelationOps: Equal ... Is *)
-    	Equal DotEqual Unequal DotUnequal
-    	Less DotLess  LessEqual DotLessEqual Greater DotGreater GreaterEqual DotGreaterEqual
-    	LessLessQ GreaterGreaterQ Questionmarks ExclamationMarks
-    	In Is
-    	(* MulOps: Times ... And *)
-    	Times TimesTimes DotTimes PlusTimes Slash Backslash DotSlash Div Mod And
-    	(* AddOps: Or ... Minus *)
-    	Or Plus Minus
-    	(* Prefix Unary Operators Plus ... Not *)
+	Equal DotEqual Unequal DotUnequal
+	Less DotLess  LessEqual DotLessEqual Greater DotGreater GreaterEqual DotGreaterEqual
+	LessLessQ GreaterGreaterQ Questionmarks ExclamationMarks
+	In Is
+	(* MulOps: Times ... And *)
+	Times TimesTimes DotTimes PlusTimes Slash Backslash DotSlash Div Mod And
+	(* AddOps: Or ... Minus *)
+	Or Plus Minus
+	(* Prefix Unary Operators Plus ... Not *)
 		Not
 		Not
-    	(* expressions may start with Plus ... Identifier *)
+	(* expressions may start with Plus ... Identifier *)
 		LeftParenthesis LeftBracket LeftBrace Number Character String Nil Imag True False Self Result New Identifier
 		LeftParenthesis LeftBracket LeftBrace Number Character String Nil Imag True False Self Result New Identifier
 		(* statementy may start with Self ... Begin *)
 		(* statementy may start with Self ... Begin *)
 		If Case While Repeat For Loop With Exit Await Return Ignore Begin
 		If Case While Repeat For Loop With Exit Await Return Ignore Begin
@@ -107,7 +107,6 @@ CONST
 	Lowercase*=1;
 	Lowercase*=1;
 	Unknown*=2;
 	Unknown*=2;
 
 
-
 TYPE
 TYPE
 	(* keywords  book keeping *)
 	(* keywords  book keeping *)
 	Keyword* = ARRAY 32 OF CHAR;
 	Keyword* = ARRAY 32 OF CHAR;
@@ -256,14 +255,13 @@ TYPE
 			RETURN new
 			RETURN new
 		END GetStringCopy;
 		END GetStringCopy;
 
 
-
 	END StringMaker;
 	END StringMaker;
 
 
 	(** scanner reflects the following EBNF
 	(** scanner reflects the following EBNF
-		Token 				= String | Symbol | Number | Keyword | Identifier.
-		Symbol 				=  | '#' | '&' | '(' ['*' any '*' ')'] | ')' | '*'['*'] | '+'['*'] | ',' | '-' | '.' [ '.' | '*' | '/' | '=' | '#' | '>'['='] | '<' ['=']
-											  | '/' | ':' ['='] | ';'  | '<' ['=' | '<' ['?'] ] | '=' | '>' [ '=' | '>' ['?']]
-											  | '[' | ']' | '^' | '{' | '|' | '}' | '~' | '\' |  '`' |  '?' ['?'] | '!' ['!']
+		Token				= String | Symbol | Number | Keyword | Identifier.
+		Symbol				=  | '#' | '&' | '(' ['*' any '*' ')'] | ')' | '*'['*'] | '+'['*'] | ',' | '-' | '.' [ '.' | '*' | '/' | '=' | '#' | '>'['='] | '<' ['=']
+											| '/' | ':' ['='] | ';'  | '<' ['=' | '<' ['?'] ] | '=' | '>' [ '=' | '>' ['?']]
+											| '[' | ']' | '^' | '{' | '|' | '}' | '~' | '\' |  '`' |  '?' ['?'] | '!' ['!']
 		Identifier			= Letter {Letter | Digit | '_'}.
 		Identifier			= Letter {Letter | Digit | '_'}.
 		Letter					= 'A' | 'B' | .. | 'Z' | 'a' | 'b' | .. | 'z'.
 		Letter					= 'A' | 'B' | .. | 'Z' | 'a' | 'b' | .. | 'z'.
 		Digit						= '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' .
 		Digit						= '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' .
@@ -316,8 +314,8 @@ TYPE
 			firstIdentifier := TRUE;
 			firstIdentifier := TRUE;
 			SELF.position := pos;
 			SELF.position := pos;
 			DEC(position.start, 1); (* one token lookahead *)
 			DEC(position.start, 1); (* one token lookahead *)
-			IF reader = NIL THEN ch := EOT ELSE 	GetNextCharacter END;
-			IF Trace THEN D.Str( "New scanner  " );   D.Ln;  END;
+			IF reader = NIL THEN ch := EOT ELSE GetNextCharacter END;
+			IF Trace THEN D.Str( "New scanner  " ); D.Ln; END;
 			IF source = "" THEN SELF.position.reader := reader END;
 			IF source = "" THEN SELF.position.reader := reader END;
 			useLineNumbers := FALSE;
 			useLineNumbers := FALSE;
 		END InitializeScanner;
 		END InitializeScanner;
@@ -516,7 +514,6 @@ TYPE
 			token.string := stringMaker.GetStringCopy(token.stringLength);
 			token.string := stringMaker.GetStringCopy(token.stringLength);
 		END GetEscapedString;
 		END GetEscapedString;
 
 
-
 		(** get a string starting at current position
 		(** get a string starting at current position
 			string = {'"' {Character} '"'} | {"'" {Character} "'"}.
 			string = {'"' {Character} '"'} | {"'" {Character} "'"}.
 		**)
 		**)
@@ -643,7 +640,6 @@ TYPE
 				RETURN (ch >= "0") & (ch <= "1")
 				RETURN (ch >= "0") & (ch <= "1")
 			END IsBinaryDigit;
 			END IsBinaryDigit;
 
 
-
 		BEGIN  (* ("0" <= ch) & (ch <= "9") *)
 		BEGIN  (* ("0" <= ch) & (ch <= "9") *)
 			result := Number;
 			result := Number;
 			i := 0;  m := 0;  n := 0;  d := 0;  si := 0;  long := FALSE;
 			i := 0;  m := 0;  n := 0;  d := 0;  si := 0;  long := FALSE;
@@ -913,9 +909,9 @@ TYPE
 			| ',':     s := Comma;  GetNextCharacter
 			| ',':     s := Comma;  GetNextCharacter
 			| '-':    s := Minus;  GetNextCharacter
 			| '-':    s := Minus;  GetNextCharacter
 			| '.':     GetNextCharacter;
 			| '.':     GetNextCharacter;
-					IF ch = '.' THEN GetNextCharacter;  s := Upto;
-					ELSIF ch = '*' THEN GetNextCharacter;  s := DotTimes;
-					ELSIF ch = '/' THEN 	GetNextCharacter;  s := DotSlash;
+					IF ch = '.' THEN GetNextCharacter; s := Upto;
+					ELSIF ch = '*' THEN GetNextCharacter; s := DotTimes;
+					ELSIF ch = '/' THEN GetNextCharacter; s := DotSlash;
 					ELSIF ch='=' THEN GetNextCharacter; s := DotEqual;
 					ELSIF ch='=' THEN GetNextCharacter; s := DotEqual;
 					ELSIF ch='#' THEN GetNextCharacter; s := DotUnequal;
 					ELSIF ch='#' THEN GetNextCharacter; s := DotUnequal;
 					ELSIF ch='>' THEN GetNextCharacter;
 					ELSIF ch='>' THEN GetNextCharacter;
@@ -966,8 +962,8 @@ TYPE
 						s := String;
 						s := String;
 						GetEscapedString(token);
 						GetEscapedString(token);
 					END;
 					END;
-			| '`':	s := Transpose; GetNextCharacter
-			| '?': 	s := Questionmark; GetNextCharacter; IF ch = '?' THEN s := Questionmarks; GetNextCharacter END;
+			| '`':     s := Transpose; GetNextCharacter
+			| '?':     s := Questionmark; GetNextCharacter; IF ch = '?' THEN s := Questionmarks; GetNextCharacter END;
 			| '!':     s := ExclamationMark; GetNextCharacter; IF ch = '!' THEN s := ExclamationMarks; GetNextCharacter END;
 			| '!':     s := ExclamationMark; GetNextCharacter; IF ch = '!' THEN s := ExclamationMarks; GetNextCharacter END;
 			| Ellipsis:
 			| Ellipsis:
 					s := Upto;  GetNextCharacter
 					s := Upto;  GetNextCharacter
@@ -1018,13 +1014,13 @@ TYPE
 	END;
 	END;
 
 
 	(** assembler scanner reflects the following EBNF
 	(** assembler scanner reflects the following EBNF
-		Token 			= String | Symbol | Number | Identifier.
-		Symbol 			= '\' | '#' | '(' ['*' any '*' ')'] | ')' | CR [LF] | LF | '*' | '+' | ',' | '-' | '~' | '.' | '/' | '%' | ':' | ';' | '=' | '[' | ']' | '{' | '}' | '!' | '^' | '$'['$'].
+		Token			= String | Symbol | Number | Identifier.
+		Symbol			= '\' | '#' | '(' ['*' any '*' ')'] | ')' | CR [LF] | LF | '*' | '+' | ',' | '-' | '~' | '.' | '/' | '%' | ':' | ';' | '=' | '[' | ']' | '{' | '}' | '!' | '^' | '$'['$'].
 		String				= '"' {Character} '"' | "'" {Character} "'".
 		String				= '"' {Character} '"' | "'" {Character} "'".
 		Identifier		= '@' | Letter {'@' | '.' | Letter | Digit | '_'} .
 		Identifier		= '@' | Letter {'@' | '.' | Letter | Digit | '_'} .
-		Letter 				= 'A' | 'B' | .. |  'Z' | 'a' | 'b' |  .. | 'z' .
-		Digit 				= '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'.
-		BinaryDigit 	= '0' | '1' .
+		Letter				= 'A' | 'B' | .. |  'Z' | 'a' | 'b' |  .. | 'z' .
+		Digit				= '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'.
+		BinaryDigit	= '0' | '1' .
 		Number			= Integer | Real.
 		Number			= Integer | Real.
 		Character		= Digit [HexDigit] 'X'.
 		Character		= Digit [HexDigit] 'X'.
 		Integer			=  Digit {Digit} | Digit {HexDigit} 'H' | '0x' {HexDigit} | '0b' {BinaryDigit}.
 		Integer			=  Digit {Digit} | Digit {HexDigit} 'H' | '0x' {HexDigit} | '0b' {BinaryDigit}.
@@ -1057,7 +1053,6 @@ TYPE
 			position := context.position;
 			position := context.position;
 		END SetContext;
 		END SetContext;
 
 
-
 		PROCEDURE SkipToEndOfLine*;
 		PROCEDURE SkipToEndOfLine*;
 		BEGIN
 		BEGIN
 			WHILE (ch # EOT) & (ch # CR) & (ch # LF) DO
 			WHILE (ch # EOT) & (ch # CR) & (ch # LF) DO
@@ -1111,7 +1106,7 @@ TYPE
 				SkipBlanks;
 				SkipBlanks;
 				token.position := position;
 				token.position := position;
 				CASE ch OF  (* ch > ' ' *)
 				CASE ch OF  (* ch > ' ' *)
-				| EOT: 	s := EndOfText;
+				| EOT:	s := EndOfText;
 				| DoubleQuote:
 				| DoubleQuote:
 						s := String; GetString(token, TRUE, FALSE, TRUE);
 						s := String; GetString(token, TRUE, FALSE, TRUE);
 				| SingleQuote:
 				| SingleQuote:
@@ -1164,13 +1159,11 @@ TYPE
 
 
 	END AssemblerScanner;
 	END AssemblerScanner;
 
 
-
 	VAR
 	VAR
 		reservedCharacter: ARRAY 256 OF BOOLEAN;
 		reservedCharacter: ARRAY 256 OF BOOLEAN;
 		symbols-: ARRAY EndOfText+1 OF Keyword;
 		symbols-: ARRAY EndOfText+1 OF Keyword;
 		keywordsLower, keywordsUpper: KeywordTable;
 		keywordsLower, keywordsUpper: KeywordTable;
 
 
-
 	(** return a new scanner on a stream, error output via diagnostics  **)
 	(** return a new scanner on a stream, error output via diagnostics  **)
 	PROCEDURE NewScanner*( CONST source: ARRAY OF CHAR; reader: Streams.Reader; position: LONGINT; diagnostics: Diagnostics.Diagnostics ): Scanner;
 	PROCEDURE NewScanner*( CONST source: ARRAY OF CHAR; reader: Streams.Reader; position: LONGINT; diagnostics: Diagnostics.Diagnostics ): Scanner;
 	VAR s: Scanner; pos: Position;
 	VAR s: Scanner; pos: Position;
@@ -1527,7 +1520,7 @@ TYPE
 		Basic.SetErrorMessage(Character,"missing character");
 		Basic.SetErrorMessage(Character,"missing character");
 		Basic.SetErrorMessage(Identifier,"missing identifier");
 		Basic.SetErrorMessage(Identifier,"missing identifier");
 		Basic.SetErrorMessage(EndOfText,"unexpected token before end");
 		Basic.SetErrorMessage(EndOfText,"unexpected token before end");
-	  END InitKeywords;
+	END InitKeywords;
 
 
 	(** debugging / reporting **)
 	(** debugging / reporting **)
 	PROCEDURE ReportKeywords*(context: Commands.Context);
 	PROCEDURE ReportKeywords*(context: Commands.Context);
@@ -1548,7 +1541,6 @@ TYPE
 		END;
 		END;
 	END ReportKeywords;
 	END ReportKeywords;
 
 
-
 	(*
 	(*
 	PROCEDURE TestScanner*(context: Commands.Context);
 	PROCEDURE TestScanner*(context: Commands.Context);
 	VAR filename: ARRAY 256 OF CHAR; reader: Streams.Reader; scanner: Scanner;token: Token;
 	VAR filename: ARRAY 256 OF CHAR; reader: Streams.Reader; scanner: Scanner;token: Token;

+ 2 - 5
source/FoxSections.Mod

@@ -189,8 +189,8 @@ TYPE
 				IF (ch = 0DX) OR (ch = 0AX) THEN newln := TRUE
 				IF (ch = 0DX) OR (ch = 0AX) THEN newln := TRUE
 				ELSE
 				ELSE
 					IF newln THEN w.Ln; w.String(LineCommentStart); newln := FALSE;  END;
 					IF newln THEN w.Ln; w.String(LineCommentStart); newln := FALSE;  END;
-				 	w.Char(ch);
-				 END;
+					w.Char(ch);
+				END;
 				INC(i); ch := str[i];
 				INC(i); ch := str[i];
 			END;
 			END;
 			IF w IS Basic.Writer THEN w(Basic.Writer).EndComment; w(Basic.Writer).DecIndent;END;
 			IF w IS Basic.Writer THEN w(Basic.Writer).EndComment; w(Basic.Writer).DecIndent;END;
@@ -360,11 +360,8 @@ TYPE
 			END;
 			END;
 		END WriteRaw;
 		END WriteRaw;
 
 
-
 	END SectionList;
 	END SectionList;
 
 
-
-
 	NameEntry = POINTER TO RECORD
 	NameEntry = POINTER TO RECORD
 		name: SyntaxTree.IdentifierString;
 		name: SyntaxTree.IdentifierString;
 	END;
 	END;

+ 47 - 120
source/FoxSemanticChecker.Mod

@@ -90,9 +90,8 @@ TYPE
 		backendName-: ARRAY 32 OF CHAR;
 		backendName-: ARRAY 32 OF CHAR;
 		inConversion: LONGINT;
 		inConversion: LONGINT;
 
 
-
 		(* temporary variables for the visitors
 		(* temporary variables for the visitors
-		    they replace variables on a stack during use of the visitor pattern and may only be
+			they replace variables on a stack during use of the visitor pattern and may only be
 			- set in AcceptXXX procedures
 			- set in AcceptXXX procedures
 			- set and read in ResolveXXX procedures
 			- set and read in ResolveXXX procedures
 		*)
 		*)
@@ -173,7 +172,6 @@ TYPE
 			Basic.Information(diagnostics, currentScope.ownerModule.sourceName, position, msg);
 			Basic.Information(diagnostics, currentScope.ownerModule.sourceName, position, msg);
 		END InfoSS;
 		END InfoSS;
 
 
-
 		(*** symbol lookup ***)
 		(*** symbol lookup ***)
 
 
 		(** find a symbol in the current scope, traverse to outer scope if traverse=true and no symbol found yet
 		(** find a symbol in the current scope, traverse to outer scope if traverse=true and no symbol found yet
@@ -494,14 +492,13 @@ TYPE
 			pointed to by a pointer to record. The following diagram shows the possible cases for records and pointer to records.
 			pointed to by a pointer to record. The following diagram shows the possible cases for records and pointer to records.
 
 
 			(1) Rec = RECORD ... END;					Ptr		<--->		Rec
 			(1) Rec = RECORD ... END;					Ptr		<--->		Rec
-				Ptr = POINTER TO Rec;						^				 |
-																|				 |
+				Ptr = POINTER TO Rec;						^				|
+																|				|
 															TypeDesc			TypeDesc
 															TypeDesc			TypeDesc
 
 
-
 			(2)	Obj = POINTER TO RECORD .. END;		Obj		<--->		Record
 			(2)	Obj = POINTER TO RECORD .. END;		Obj		<--->		Record
 																^				/
 																^				/
-																|			   /
+																|			/
 															TypeDesc	<-- /
 															TypeDesc	<-- /
 		*)
 		*)
 
 
@@ -520,7 +517,6 @@ TYPE
 			typeDeclaration.SetScope(currentScope);
 			typeDeclaration.SetScope(currentScope);
 		END AnonymousTypeDeclaration;
 		END AnonymousTypeDeclaration;
 
 
-
 		(**
 		(**
 			deferred pointer type resolving
 			deferred pointer type resolving
 			- resolve base type
 			- resolve base type
@@ -769,7 +765,6 @@ TYPE
 			END;
 			END;
 		END CheckModifiers;
 		END CheckModifiers;
 
 
-
 		(**
 		(**
 			resolve procedure type
 			resolve procedure type
 			- enter procedure to list of deferred fixes (to avoid infinite loops in the declaration phase)
 			- enter procedure to list of deferred fixes (to avoid infinite loops in the declaration phase)
@@ -832,7 +827,6 @@ TYPE
 				END;
 				END;
 			END IsPointerToRecord;
 			END IsPointerToRecord;
 
 
-
 		BEGIN
 		BEGIN
 			hasPointers := FALSE;
 			hasPointers := FALSE;
 
 
@@ -1009,7 +1003,6 @@ TYPE
 			ELSE numberMethods := recordBase.recordScope.numberMethods
 			ELSE numberMethods := recordBase.recordScope.numberMethods
 			END;
 			END;
 
 
-
 			modifier := x.modifiers;
 			modifier := x.modifiers;
 			(*IF ~x.isCellNet THEN*)
 			(*IF ~x.isCellNet THEN*)
 				IF HasValue(modifier,Global.NameDataMemorySize,position,value) THEN END;
 				IF HasValue(modifier,Global.NameDataMemorySize,position,value) THEN END;
@@ -1114,7 +1107,6 @@ TYPE
 			END;
 			END;
 		END ResolveCellType;
 		END ResolveCellType;
 
 
-
 		(** Check if a node has already been resolved. If not then mark as currently being resolved.
 		(** Check if a node has already been resolved. If not then mark as currently being resolved.
 			If node is currently being resolved then emit a cyclic definition error.
 			If node is currently being resolved then emit a cyclic definition error.
 			Return TRUE only if node is fully resolved.
 			Return TRUE only if node is fully resolved.
@@ -1159,7 +1151,6 @@ TYPE
 			END;
 			END;
 		END ResolveType;
 		END ResolveType;
 
 
-
 		(** resolve all pending types (late resolving).
 		(** resolve all pending types (late resolving).
 			- type fixes are resolved at the end of the declaration phase
 			- type fixes are resolved at the end of the declaration phase
 			- type fixes may imply new type fixes that are also entered at the end of the list
 			- type fixes may imply new type fixes that are also entered at the end of the list
@@ -1203,7 +1194,6 @@ TYPE
 			RETURN result
 			RETURN result
 		END RegularType;
 		END RegularType;
 
 
-
 		(** returns signature compatibility of procedure types this and to
 		(** returns signature compatibility of procedure types this and to
 			- if not compatible then error is reported
 			- if not compatible then error is reported
 			- compatibility means type equality
 			- compatibility means type equality
@@ -1582,7 +1572,6 @@ TYPE
 				RETURN ResolveType(arrayType);
 				RETURN ResolveType(arrayType);
 			END RecursivelySetType;
 			END RecursivelySetType;
 
 
-
 		BEGIN
 		BEGIN
 			type := NIL;
 			type := NIL;
 			RecursivelyFindType(x);
 			RecursivelyFindType(x);
@@ -1720,7 +1709,7 @@ TYPE
 							determined via the type descriptor, implement that ? *)
 							determined via the type descriptor, implement that ? *)
 						Error(left.position,"is not a type symbol");
 						Error(left.position,"is not a type symbol");
 					END
 					END
-				 (* ALIAS OF *)
+				(* ALIAS OF *)
 				|Scanner.Alias:
 				|Scanner.Alias:
 					type := left.type.resolved;
 					type := left.type.resolved;
 					IF ~(type IS SyntaxTree.MathArrayType) THEN
 					IF ~(type IS SyntaxTree.MathArrayType) THEN
@@ -1773,7 +1762,6 @@ TYPE
 				END;
 				END;
 			END RecursivelyConvert;
 			END RecursivelyConvert;
 
 
-
 			PROCEDURE RecursivelySetType(x: SyntaxTree.MathArrayExpression): SyntaxTree.Type;
 			PROCEDURE RecursivelySetType(x: SyntaxTree.MathArrayExpression): SyntaxTree.Type;
 			VAR numberElements,i,size,gsize: LONGINT; baseType: SyntaxTree.Type;expression: SyntaxTree.Expression;
 			VAR numberElements,i,size,gsize: LONGINT; baseType: SyntaxTree.Type;expression: SyntaxTree.Expression;
 				arrayType: SyntaxTree.MathArrayType;
 				arrayType: SyntaxTree.MathArrayType;
@@ -2362,12 +2350,12 @@ TYPE
 
 
 				Times, Plus, Minus		numeric		numeric		numeric
 				Times, Plus, Minus		numeric		numeric		numeric
 											set				set				set
 											set				set				set
-				Slash 						numeric		numeric		real	/complex
+				Slash						numeric		numeric		real	/complex
 											set				set				set
 											set				set				set
 				Div , Mod					integer			integer			integer
 				Div , Mod					integer			integer			integer
 				And, Or					bool			bool			bool
 				And, Or					bool			bool			bool
-				Equal, Unequal 			basic			basic			bool
-											pointer 		pointer 		bool
+				Equal, Unequal			basic			basic			bool
+											pointer		pointer			bool
 											object			object			bool
 											object			object			bool
 											record			record			bool
 											record			record			bool
 											string			string			bool
 											string			string			bool
@@ -2379,10 +2367,10 @@ TYPE
 
 
 				In							integer			set				bool
 				In							integer			set				bool
 				Is							pointer			type			bool
 				Is							pointer			type			bool
-				 							object			type			bool
-				 							record			type			bool
+											object			type			bool
+											record			type			bool
 
 
-				 Upto: special abbreviation for a..b
+				Upto: special abbreviation for a..b
 			*)
 			*)
 
 
 			ELSIF (left.type = NIL) THEN
 			ELSIF (left.type = NIL) THEN
@@ -2486,7 +2474,7 @@ TYPE
 					Error(binaryExpression.position,"operator not defined 5");
 					Error(binaryExpression.position,"operator not defined 5");
 				END;
 				END;
 				IF (operator = Scanner.Equal) OR (operator=Scanner.Unequal)
 				IF (operator = Scanner.Equal) OR (operator=Scanner.Unequal)
-					OR 	(operator = Scanner.Less) OR (operator = Scanner.LessEqual)
+					OR (operator = Scanner.Less) OR (operator = Scanner.LessEqual)
 					OR (operator = Scanner.Greater) OR (operator = Scanner.GreaterEqual) THEN
 					OR (operator = Scanner.Greater) OR (operator = Scanner.GreaterEqual) THEN
 					type := system.booleanType;
 					type := system.booleanType;
 				ELSE
 				ELSE
@@ -2773,7 +2761,7 @@ TYPE
 		END ResolveBinaryExpression;
 		END ResolveBinaryExpression;
 
 
 		(** resolve a range expression of the from <<first .. last BY step>>
 		(** resolve a range expression of the from <<first .. last BY step>>
-		    - depending on the context different things are checked:
+			- depending on the context different things are checked:
 				ArrayIndex:
 				ArrayIndex:
 					- components must be integers
 					- components must be integers
 					- replace missing lower bound with 0
 					- replace missing lower bound with 0
@@ -2790,7 +2778,7 @@ TYPE
 					- must have lower and upper bound present
 					- must have lower and upper bound present
 					- components are made compatible
 					- components are made compatible
 					- must not have step size
 					- must not have step size
-		    - if error: return invalidExpression
+			- if error: return invalidExpression
 		**)
 		**)
 		PROCEDURE ResolveRangeExpression(x: SyntaxTree.RangeExpression): SyntaxTree.Expression;
 		PROCEDURE ResolveRangeExpression(x: SyntaxTree.RangeExpression): SyntaxTree.Expression;
 		VAR
 		VAR
@@ -2934,15 +2922,14 @@ TYPE
 			ELSIF resolved IS SyntaxTree.Designator THEN
 			ELSIF resolved IS SyntaxTree.Designator THEN
 				result := resolved(SyntaxTree.Designator);
 				result := resolved(SyntaxTree.Designator);
 			ELSE
 			ELSE
-				 Error(d.position,"is no designator ! ");
-				 result := SyntaxTree.invalidDesignator;
+				Error(d.position,"is no designator ! ");
+				result := SyntaxTree.invalidDesignator;
 			END;
 			END;
 
 
 			(* result.type might be nil.  *)
 			(* result.type might be nil.  *)
 			RETURN result
 			RETURN result
 		END ResolveDesignator;
 		END ResolveDesignator;
 
 
-
 		(**
 		(**
 			self designator generated in this module
 			self designator generated in this module
 			nothing to be resolved
 			nothing to be resolved
@@ -3000,7 +2987,6 @@ TYPE
 			RETURN x;
 			RETURN x;
 		END ResolveResultDesignator;
 		END ResolveResultDesignator;
 
 
-
 		(**
 		(**
 			return symbol designator as an expression
 			return symbol designator as an expression
 			- if symbol is a constant then return the constant value expression
 			- if symbol is a constant then return the constant value expression
@@ -3059,7 +3045,6 @@ TYPE
 				assignable := assignable & (SyntaxTree.InternalWrite IN symbol.access);
 				assignable := assignable & (SyntaxTree.InternalWrite IN symbol.access);
 			END;
 			END;
 
 
-
 			assignable := assignable & ((symbol IS SyntaxTree.Variable) OR (symbol IS SyntaxTree.Parameter)
 			assignable := assignable & ((symbol IS SyntaxTree.Variable) OR (symbol IS SyntaxTree.Parameter)
 				& (symbol(SyntaxTree.Parameter).kind # SyntaxTree.ConstParameter) & ~(symbol(SyntaxTree.Parameter).ownerType IS SyntaxTree.CellType));
 				& (symbol(SyntaxTree.Parameter).kind # SyntaxTree.ConstParameter) & ~(symbol(SyntaxTree.Parameter).ownerType IS SyntaxTree.CellType));
 
 
@@ -3112,7 +3097,6 @@ TYPE
 			END;
 			END;
 		END ResolveIdentifierDesignator;
 		END ResolveIdentifierDesignator;
 
 
-
 		(** check and resolve a selector designator of the form left.designator
 		(** check and resolve a selector designator of the form left.designator
 			- if left is a pointer type then do auto dereferenciation
 			- if left is a pointer type then do auto dereferenciation
 			- left denotes a search scope:
 			- left denotes a search scope:
@@ -3214,7 +3198,7 @@ TYPE
 			NIL						z					z
 			NIL						z					z
 			ARRAY [x, y]			z					ARRAY [x, y] OF z
 			ARRAY [x, y]			z					ARRAY [x, y] OF z
 			ARRAY [x, y]			ARRAY [z]			ARRAY [x, y, z]
 			ARRAY [x, y]			ARRAY [z]			ARRAY [x, y, z]
-			ARRAY [x, y]	 		ARRAY [*]			ARRAY [*, *, *]
+			ARRAY [x, y]			ARRAY [*]			ARRAY [*, *, *]
 		*)
 		*)
 		PROCEDURE SetIndexBaseType(indexDesignator: SyntaxTree.IndexDesignator; newBaseType: SyntaxTree.Type);
 		PROCEDURE SetIndexBaseType(indexDesignator: SyntaxTree.IndexDesignator; newBaseType: SyntaxTree.Type);
 		VAR
 		VAR
@@ -3386,7 +3370,6 @@ TYPE
 			PROCEDURE FindOperator(recordType: SyntaxTree.RecordType; identifier: SyntaxTree.Identifier; actualParameters: SyntaxTree.ExpressionList): SyntaxTree.Operator;
 			PROCEDURE FindOperator(recordType: SyntaxTree.RecordType; identifier: SyntaxTree.Identifier; actualParameters: SyntaxTree.ExpressionList): SyntaxTree.Operator;
 			VAR bestOperator: SyntaxTree.Operator; bestDistance: LONGINT; numberParameters: LONGINT; procedureType: SyntaxTree.ProcedureType;
 			VAR bestOperator: SyntaxTree.Operator; bestDistance: LONGINT; numberParameters: LONGINT; procedureType: SyntaxTree.ProcedureType;
 
 
-
 				PROCEDURE FindInScope(scope: SyntaxTree.RecordScope; access: SET);
 				PROCEDURE FindInScope(scope: SyntaxTree.RecordScope; access: SET);
 				VAR operator: SyntaxTree.Operator; distance,i: LONGINT;
 				VAR operator: SyntaxTree.Operator; distance,i: LONGINT;
 				CONST trace = FALSE;
 				CONST trace = FALSE;
@@ -3529,9 +3512,6 @@ TYPE
 				END
 				END
 			END FinalizeIndexDesignator;
 			END FinalizeIndexDesignator;
 
 
-
-
-
 		BEGIN
 		BEGIN
 			IF Trace THEN D.Str("ResolveBracketDesignator"); D.Ln; END;
 			IF Trace THEN D.Str("ResolveBracketDesignator"); D.Ln; END;
 
 
@@ -3639,7 +3619,6 @@ TYPE
 			RETURN result;
 			RETURN result;
 		END ResolveBracketDesignator;
 		END ResolveBracketDesignator;
 
 
-
 		(** check and resolve expression list
 		(** check and resolve expression list
 			- resolve each expression in an expression list
 			- resolve each expression in an expression list
 			- returns true if and only if all statements could have successfully been resolved
 			- returns true if and only if all statements could have successfully been resolved
@@ -3890,8 +3869,6 @@ TYPE
 
 
 			END;
 			END;
 
 
-
-
 			IF result = SyntaxTree.invalidDesignator THEN
 			IF result = SyntaxTree.invalidDesignator THEN
 			ELSIF (left IS SyntaxTree.SymbolDesignator) & (left(SyntaxTree.SymbolDesignator).symbol IS SyntaxTree.Procedure) THEN
 			ELSIF (left IS SyntaxTree.SymbolDesignator) & (left(SyntaxTree.SymbolDesignator).symbol IS SyntaxTree.Procedure) THEN
 				procedure := left(SyntaxTree.SymbolDesignator).symbol(SyntaxTree.Procedure);
 				procedure := left(SyntaxTree.SymbolDesignator).symbol(SyntaxTree.Procedure);
@@ -3931,7 +3908,7 @@ TYPE
 					END;
 					END;
 					formalParameter := formalParameter.nextParameter;
 					formalParameter := formalParameter.nextParameter;
 					INC(i);
 					INC(i);
- 				END;
+				END;
 			(*IF ~tooComplex & (procedureType.returnType # NIL) THEN
 			(*IF ~tooComplex & (procedureType.returnType # NIL) THEN
 				IF resultDesignator # NIL THEN
 				IF resultDesignator # NIL THEN
 					returnDesignator := resultDesignator
 					returnDesignator := resultDesignator
@@ -3957,8 +3934,6 @@ TYPE
 			RETURN result
 			RETURN result
 		END NewProcedureCallDesignator;
 		END NewProcedureCallDesignator;
 
 
-
-
 		(**
 		(**
 			builtin call designator generated in ResolveParameterDesignator
 			builtin call designator generated in ResolveParameterDesignator
 			-> nothing to be resolved
 			-> nothing to be resolved
@@ -4003,7 +3978,6 @@ TYPE
 			RETURN result
 			RETURN result
 		END CheckBasicType;
 		END CheckBasicType;
 
 
-
 		(**
 		(**
 			if expression x is of number type then return true else report error and return false
 			if expression x is of number type then return true else report error and return false
 		**)
 		**)
@@ -4119,7 +4093,6 @@ TYPE
 			RETURN result
 			RETURN result
 		END CheckRealType;
 		END CheckRealType;
 
 
-
 		(**
 		(**
 			if expression x is of range type then return true else report error and return false
 			if expression x is of range type then return true else report error and return false
 		**)
 		**)
@@ -4265,7 +4238,6 @@ TYPE
 			RETURN result;
 			RETURN result;
 		END CheckEnumerationValue;
 		END CheckEnumerationValue;
 
 
-
 		PROCEDURE CheckCharacterValue(x: SyntaxTree.Expression; VAR value: CHAR): BOOLEAN;
 		PROCEDURE CheckCharacterValue(x: SyntaxTree.Expression; VAR value: CHAR): BOOLEAN;
 		VAR result: BOOLEAN;
 		VAR result: BOOLEAN;
 		BEGIN
 		BEGIN
@@ -4301,7 +4273,6 @@ TYPE
 			RETURN result;
 			RETURN result;
 		END CheckPositiveIntegerValue;
 		END CheckPositiveIntegerValue;
 
 
-
 		PROCEDURE CheckPortType(x: SyntaxTree.Expression; VAR portType: SyntaxTree.PortType): BOOLEAN;
 		PROCEDURE CheckPortType(x: SyntaxTree.Expression; VAR portType: SyntaxTree.PortType): BOOLEAN;
 		VAR type: SyntaxTree.Type; result: BOOLEAN;
 		VAR type: SyntaxTree.Type; result: BOOLEAN;
 		BEGIN
 		BEGIN
@@ -4382,8 +4353,6 @@ TYPE
 				END;
 				END;
 			END CheckModifiers;
 			END CheckModifiers;
 
 
-
-
 		BEGIN
 		BEGIN
 			type := NIL; result := NIL;
 			type := NIL; result := NIL;
 			type0 := NIL; type1 := NIL; type2 := NIL;
 			type0 := NIL; type1 := NIL; type2 := NIL;
@@ -4443,7 +4412,7 @@ TYPE
 						IF (numberActualParameters > 1) & CheckIntegerValue(parameter1,i1) THEN
 						IF (numberActualParameters > 1) & CheckIntegerValue(parameter1,i1) THEN
 							(* modified: any integer parameter value is allowed, it is in the responsibility of the programmer to adhere to
 							(* modified: any integer parameter value is allowed, it is in the responsibility of the programmer to adhere to
 								rules imposed by the architecture / current runtime
 								rules imposed by the architecture / current runtime
-							 *)
+							*)
 						END;
 						END;
 					END;
 					END;
 				(* ---- COPY ----- *)
 				(* ---- COPY ----- *)
@@ -4493,7 +4462,7 @@ TYPE
 					IF CheckPositiveIntegerValue(parameter0,i0,FALSE) THEN
 					IF CheckPositiveIntegerValue(parameter0,i0,FALSE) THEN
 						(* modified: any integer parameter value is allowed, it is in the responsibility of the programmer to adhere to
 						(* modified: any integer parameter value is allowed, it is in the responsibility of the programmer to adhere to
 							rules imposed by the architecture / current runtime
 							rules imposed by the architecture / current runtime
-						 *)
+						*)
 					END;
 					END;
 				(* ---- WAIT ----- *)
 				(* ---- WAIT ----- *)
 				ELSIF cooperative & (id = Global.Wait) & CheckArity(1,1) THEN
 				ELSIF cooperative & (id = Global.Wait) & CheckArity(1,1) THEN
@@ -4731,7 +4700,7 @@ TYPE
 						END;
 						END;
 
 
 						(*!compatibility with release, remove when resolved
 						(*!compatibility with release, remove when resolved
-						    critical in release : SHORT(ASH(..))), ASH(ORD(..))
+							critical in release : SHORT(ASH(..))), ASH(ORD(..))
 						*)
 						*)
 						parameter1 := NewConversion(parameter1.position,parameter1,system.longintType,NIL);
 						parameter1 := NewConversion(parameter1.position,parameter1,system.longintType,NIL);
 						parameter0 := NewConversion(parameter0.position,parameter0,type,NIL);
 						parameter0 := NewConversion(parameter0.position,parameter0,type,NIL);
@@ -4984,7 +4953,7 @@ TYPE
 						parameter0 := NewConversion(parameter0.position, parameter0, system.characterType,NIL);
 						parameter0 := NewConversion(parameter0.position, parameter0, system.characterType,NIL);
 						actualParameters.SetExpression(0,parameter0);
 						actualParameters.SetExpression(0,parameter0);
 						(* IF CheckCharacterType(parameter0) THEN*)
 						(* IF CheckCharacterType(parameter0) THEN*)
-						 IF IsCharacterValue(parameter0,c)THEN
+						IF IsCharacterValue(parameter0,c)THEN
 							result.SetResolved(Global.NewIntegerValue(system,position,ORD(c)));
 							result.SetResolved(Global.NewIntegerValue(system,position,ORD(c)));
 							type := Global.GetSignedIntegerType(system,ORD(c));
 							type := Global.GetSignedIntegerType(system,ORD(c));
 						END;
 						END;
@@ -5025,7 +4994,7 @@ TYPE
 						ELSIF type.sizeInBits = 128 THEN type := Global.Complex64
 						ELSIF type.sizeInBits = 128 THEN type := Global.Complex64
 						END;
 						END;
 					ELSE
 					ELSE
-						 Error(parameter0.position,"short not applicable")
+						Error(parameter0.position,"short not applicable")
 					END;
 					END;
 					IF (parameter0.resolved # NIL) THEN
 					IF (parameter0.resolved # NIL) THEN
 						parameter0 := ConvertValue(parameter0.position,parameter0.resolved,type);
 						parameter0 := ConvertValue(parameter0.position,parameter0.resolved,type);
@@ -5068,7 +5037,7 @@ TYPE
 						ELSIF type.sizeInBits = 64 THEN type := Global.Complex128
 						ELSIF type.sizeInBits = 64 THEN type := Global.Complex128
 						END;
 						END;
 					ELSE
 					ELSE
-						 Error(parameter0.position,"long not applicable")
+						Error(parameter0.position,"long not applicable")
 					END;
 					END;
 					IF (parameter0.resolved # NIL) THEN
 					IF (parameter0.resolved # NIL) THEN
 						parameter0 := ConvertValue(parameter0.position,parameter0.resolved,type);
 						parameter0 := ConvertValue(parameter0.position,parameter0.resolved,type);
@@ -5180,10 +5149,10 @@ TYPE
 					END;
 					END;
 				(* ---- LSH, LSL, ROT, ROR ----- *)
 				(* ---- LSH, LSL, ROT, ROR ----- *)
 				ELSIF ((id = Global.Lsh) OR (id = Global.Rot) OR (id= Global.Ror)) & CheckArity(2,2) THEN
 				ELSIF ((id = Global.Lsh) OR (id = Global.Rot) OR (id= Global.Ror)) & CheckArity(2,2) THEN
-				 	type := type0;
+					type := type0;
 
 
-				 	parameter1 := NewConversion(parameter1.position,parameter1,system.longintType,NIL);
-				 	actualParameters.SetExpression(1, parameter1);
+					parameter1 := NewConversion(parameter1.position,parameter1,system.longintType,NIL);
+					actualParameters.SetExpression(1, parameter1);
 
 
 					IF IsIntegerValue(parameter0,i0) & IsIntegerValue(parameter1,i1) THEN
 					IF IsIntegerValue(parameter0,i0) & IsIntegerValue(parameter1,i1) THEN
 						IF id = Global.Lsh THEN
 						IF id = Global.Lsh THEN
@@ -5202,7 +5171,7 @@ TYPE
 							result := SyntaxTree.invalidExpression;
 							result := SyntaxTree.invalidExpression;
 							Error(parameter0.position,"is no basic type");
 							Error(parameter0.position,"is no basic type");
 						ELSE
 						ELSE
-							 IF (parameter1.resolved # NIL) THEN
+							IF (parameter1.resolved # NIL) THEN
 								parameter0 := ConvertValue(parameter1.position,parameter1.resolved,type);
 								parameter0 := ConvertValue(parameter1.position,parameter1.resolved,type);
 								IF parameter0 IS SyntaxTree.Value THEN
 								IF parameter0 IS SyntaxTree.Value THEN
 									result.SetResolved(parameter0(SyntaxTree.Value));
 									result.SetResolved(parameter0(SyntaxTree.Value));
@@ -5309,7 +5278,6 @@ TYPE
 						type := system.lenType;
 						type := system.lenType;
 					END;
 					END;
 
 
-
 				(* ---- SUM ----- *)
 				(* ---- SUM ----- *)
 				ELSIF (id = Global.Sum) & CheckArity(1,2) THEN (* can only be found by overloading *)
 				ELSIF (id = Global.Sum) & CheckArity(1,2) THEN (* can only be found by overloading *)
 					Error(position, "sum operator not applicable");
 					Error(position, "sum operator not applicable");
@@ -5411,7 +5379,7 @@ TYPE
 					END;
 					END;
 				(* ------- CONNECT -------*)
 				(* ------- CONNECT -------*)
 				ELSIF (id = Global.Connect) & (CheckArity(2,3)) THEN
 				ELSIF (id = Global.Connect) & (CheckArity(2,3)) THEN
-					(*IF 	~(currentIsCellNet) THEN
+					(*IF ~(currentIsCellNet) THEN
 						Error(position, "connection outside activeCells body block");
 						Error(position, "connection outside activeCells body block");
 					END;*)
 					END;*)
 
 
@@ -5433,7 +5401,7 @@ TYPE
 				(* ---------- DELEGATE --------*)
 				(* ---------- DELEGATE --------*)
 				ELSIF (id = Global.Delegate) & (CheckArity(2,2)) THEN
 				ELSIF (id = Global.Delegate) & (CheckArity(2,2)) THEN
 					(*
 					(*
-					IF 	~(currentIsCellNet) THEN
+					IF ~(currentIsCellNet) THEN
 						Error(position, "connection delegation outside activeCells body block");
 						Error(position, "connection delegation outside activeCells body block");
 					END;
 					END;
 					*)
 					*)
@@ -5615,8 +5583,8 @@ TYPE
 		END ResolveParameterDesignator;
 		END ResolveParameterDesignator;
 
 
 		(** check dereference designator left^
 		(** check dereference designator left^
-			 - check if left is pointer type or left is object type
-			 - return new dereference designator with type = left.baseType.type (if appropriate)
+			- check if left is pointer type or left is object type
+			- return new dereference designator with type = left.baseType.type (if appropriate)
 			with error handling
 			with error handling
 			returns invalidDesignator = invalidExpression if error
 			returns invalidDesignator = invalidExpression if error
 		**)
 		**)
@@ -5739,7 +5707,7 @@ TYPE
 			END;
 			END;
 			result := x;
 			result := x;
 			WITH x:
 			WITH x:
-			  SyntaxTree.ResultDesignator DO result := ResolveResultDesignator(x)
+			| SyntaxTree.ResultDesignator DO result := ResolveResultDesignator(x)
 			| SyntaxTree.SelfDesignator DO result := ResolveSelfDesignator(x)
 			| SyntaxTree.SelfDesignator DO result := ResolveSelfDesignator(x)
 			| SyntaxTree.TypeGuardDesignator DO result := x;
 			| SyntaxTree.TypeGuardDesignator DO result := x;
 			| SyntaxTree.SymbolDesignator DO result := x;
 			| SyntaxTree.SymbolDesignator DO result := x;
@@ -5894,8 +5862,7 @@ TYPE
 
 
 		PROCEDURE ResolveSymbol*(x: SyntaxTree.Symbol);
 		PROCEDURE ResolveSymbol*(x: SyntaxTree.Symbol);
 		BEGIN
 		BEGIN
-			WITH
-			  x:
+			WITH x:
 			| SyntaxTree.TypeDeclaration DO ResolveTypeDeclaration(x)
 			| SyntaxTree.TypeDeclaration DO ResolveTypeDeclaration(x)
 			| SyntaxTree.Constant DO ResolveConstant(x)
 			| SyntaxTree.Constant DO ResolveConstant(x)
 			| SyntaxTree.Parameter DO ResolveParameter(x)
 			| SyntaxTree.Parameter DO ResolveParameter(x)
@@ -5948,12 +5915,11 @@ TYPE
 			RETURN result
 			RETURN result
 		END SymbolNeedsResolution;
 		END SymbolNeedsResolution;
 
 
-
 		(** check and resolve a type declaration symbol = Type
 		(** check and resolve a type declaration symbol = Type
 			- set type to declaration type
 			- set type to declaration type
 				-> the type of a type declaration is NOT the declared type but the "declaration" type.
 				-> the type of a type declaration is NOT the declared type but the "declaration" type.
-				     This is so because the type declaration itself does not have a type but it only stands for a type.
-				     In the implementation of the compiler this made a lot much easier.
+					This is so because the type declaration itself does not have a type but it only stands for a type.
+					In the implementation of the compiler this made a lot much easier.
 			- resolve and set declared type
 			- resolve and set declared type
 			- check symbol
 			- check symbol
 		**)
 		**)
@@ -6045,7 +6011,6 @@ TYPE
 			END;
 			END;
 		END AdaptStackAlignment;
 		END AdaptStackAlignment;
 
 
-
 		(** check and resolve a variable / field
 		(** check and resolve a variable / field
 			- check and set type
 			- check and set type
 			- negative check on open array type
 			- negative check on open array type
@@ -6119,7 +6084,6 @@ TYPE
 			END;
 			END;
 		END ResolveVariable;
 		END ResolveVariable;
 
 
-
 		(** check and resolve a (procedure) parameter
 		(** check and resolve a (procedure) parameter
 			- check and set type
 			- check and set type
 			- check symbol
 			- check symbol
@@ -6257,7 +6221,6 @@ TYPE
 				procedureType.SetUntracedReturn(HasFlag(modifiers, Global.NameUntraced, position));
 				procedureType.SetUntracedReturn(HasFlag(modifiers, Global.NameUntraced, position));
 				CheckModifiers(modifiers, TRUE);
 				CheckModifiers(modifiers, TRUE);
 
 
-
 				procedure.SetState(SyntaxTree.Resolved);
 				procedure.SetState(SyntaxTree.Resolved);
 
 
 				FixProcedureType(procedureType);
 				FixProcedureType(procedureType);
@@ -6569,8 +6532,6 @@ TYPE
 			END
 			END
 		END ResolveOperator;
 		END ResolveOperator;
 
 
-
-
 		PROCEDURE AddImport*(module: SyntaxTree.Module; x: SyntaxTree.Import): BOOLEAN;
 		PROCEDURE AddImport*(module: SyntaxTree.Module; x: SyntaxTree.Import): BOOLEAN;
 		VAR prevScope: SyntaxTree.Scope; prevDiagnostics: Diagnostics.Diagnostics;
 		VAR prevScope: SyntaxTree.Scope; prevDiagnostics: Diagnostics.Diagnostics;
 		BEGIN
 		BEGIN
@@ -6589,7 +6550,6 @@ TYPE
 			IF error THEN error := FALSE; RETURN FALSE ELSE RETURN TRUE END;
 			IF error THEN error := FALSE; RETURN FALSE ELSE RETURN TRUE END;
 		END AddImport;
 		END AddImport;
 
 
-
 		(** check and resolve import
 		(** check and resolve import
 			- check for name = SYSTEM
 			- check for name = SYSTEM
 			- check for forbidden self import
 			- check for forbidden self import
@@ -6983,14 +6943,13 @@ TYPE
 
 
 		END WithPart;
 		END WithPart;
 
 
-
 		(** check and resolve with statement WITH variable: type DO ... END;
 		(** check and resolve with statement WITH variable: type DO ... END;
 			- check type and variable
 			- check type and variable
 			- check that variable type is type extension of type
 			- check that variable type is type extension of type
 			- check that variable is a variable
 			- check that variable is a variable
 			- enter new with scope and enter guardedVariable with same name and reference to variable
 			- enter new with scope and enter guardedVariable with same name and reference to variable
 			- create if statement:
 			- create if statement:
-				WITH variable: type DO ... END; 	--> IF ~(variable IS type) THEN HALT(withTrap) ELSE ... END;
+				WITH variable: type DO ... END; --> IF ~(variable IS type) THEN HALT(withTrap) ELSE ... END;
 		**)
 		**)
 		PROCEDURE ResolveWithStatement(withStatement: SyntaxTree.WithStatement): SyntaxTree.Statement;
 		PROCEDURE ResolveWithStatement(withStatement: SyntaxTree.WithStatement): SyntaxTree.Statement;
 		VAR i,j: LONGINT; prevScope: SyntaxTree.Scope; variable: SyntaxTree.Designator;
 		VAR i,j: LONGINT; prevScope: SyntaxTree.Scope; variable: SyntaxTree.Designator;
@@ -7000,7 +6959,6 @@ TYPE
 			variable := ResolveDesignator(withStatement.variable);
 			variable := ResolveDesignator(withStatement.variable);
 			withStatement.SetVariable(variable);
 			withStatement.SetVariable(variable);
 
 
-
 			FOR i := 0 TO withStatement.WithParts()-1 DO
 			FOR i := 0 TO withStatement.WithParts()-1 DO
 				WithPart(withStatement.GetWithPart(i),variable);
 				WithPart(withStatement.GetWithPart(i),variable);
 			END;
 			END;
@@ -7111,7 +7069,6 @@ TYPE
 			StatementSequence(casePart.statements);
 			StatementSequence(casePart.statements);
 		END CasePart;
 		END CasePart;
 
 
-
 		(** check and resolve case statement CASE variable OF ... END;
 		(** check and resolve case statement CASE variable OF ... END;
 			- check variable
 			- check variable
 			- check case parts
 			- check case parts
@@ -7184,8 +7141,7 @@ TYPE
 			repeatStatement.SetCondition(ResolveCondition(repeatStatement.condition));
 			repeatStatement.SetCondition(ResolveCondition(repeatStatement.condition));
 			StatementSequence(repeatStatement.statements);
 			StatementSequence(repeatStatement.statements);
 			RETURN repeatStatement;
 			RETURN repeatStatement;
-		 END ResolveRepeatStatement;
-
+		END ResolveRepeatStatement;
 
 
 		PROCEDURE GetGuard(symbol: SyntaxTree.Symbol; VAR type: SyntaxTree.Type): BOOLEAN;
 		PROCEDURE GetGuard(symbol: SyntaxTree.Symbol; VAR type: SyntaxTree.Type): BOOLEAN;
 		VAR withEntry: WithEntry;
 		VAR withEntry: WithEntry;
@@ -7248,7 +7204,6 @@ TYPE
 				expression := Global.NewIntegerValue(system,Basic.invalidPosition,1);
 				expression := Global.NewIntegerValue(system,Basic.invalidPosition,1);
 			END;
 			END;
 
 
-
 			IF expression = SyntaxTree.invalidExpression THEN
 			IF expression = SyntaxTree.invalidExpression THEN
 			ELSIF  ~CompatibleTo(system,expression.type.resolved,designator.type.resolved) THEN
 			ELSIF  ~CompatibleTo(system,expression.type.resolved,designator.type.resolved) THEN
 				Error(expression.position,"step value of incompatible type");
 				Error(expression.position,"step value of incompatible type");
@@ -7278,7 +7233,6 @@ TYPE
 			RETURN exitableBlock;
 			RETURN exitableBlock;
 		END ResolveExitableBlock;
 		END ResolveExitableBlock;
 
 
-
 		(** check and resolve exit statement EXIT
 		(** check and resolve exit statement EXIT
 			- check that exit is within LOOP statement block
 			- check that exit is within LOOP statement block
 		**)
 		**)
@@ -7293,7 +7247,7 @@ TYPE
 				Error(exitStatement.position,"exit statement not within loop statement");
 				Error(exitStatement.position,"exit statement not within loop statement");
 			END;
 			END;
 			RETURN exitStatement;
 			RETURN exitStatement;
-		 END ResolveExitStatement;
+		END ResolveExitStatement;
 
 
 		(** check and resolve return statement RETURN [expression]
 		(** check and resolve return statement RETURN [expression]
 			- check expression (if any)
 			- check expression (if any)
@@ -7349,7 +7303,7 @@ TYPE
 				END;
 				END;
 			END;
 			END;
 			RETURN returnStatement;
 			RETURN returnStatement;
-		 END ResolveReturnStatement;
+		END ResolveReturnStatement;
 
 
 		(** check and resolve await statement AWAIT(condition: Expression)
 		(** check and resolve await statement AWAIT(condition: Expression)
 			- check await condition
 			- check await condition
@@ -7413,7 +7367,6 @@ TYPE
 			END;
 			END;
 		END ResolveCode;
 		END ResolveCode;
 
 
-
 		(** check and set flags of a statement block
 		(** check and set flags of a statement block
 			- check for multiply occurence of a flag
 			- check for multiply occurence of a flag
 			- check and set priority only in bodies
 			- check and set priority only in bodies
@@ -7435,7 +7388,6 @@ TYPE
 				END;
 				END;
 			END SetProtectedRecord;
 			END SetProtectedRecord;
 
 
-
 		BEGIN
 		BEGIN
 			flags := {};
 			flags := {};
 			IF (block IS SyntaxTree.Body) & (currentIsBodyProcedure) & ((currentScope.outerScope = NIL) OR ~(currentScope.outerScope IS SyntaxTree.ModuleScope)) THEN
 			IF (block IS SyntaxTree.Body) & (currentIsBodyProcedure) & ((currentScope.outerScope = NIL) OR ~(currentScope.outerScope IS SyntaxTree.ModuleScope)) THEN
@@ -7546,7 +7498,7 @@ TYPE
 		(** check and resolve body
 		(** check and resolve body
 			- check flags (active, priority, safe)
 			- check flags (active, priority, safe)
 			- check body and finally part
 			- check body and finally part
-		 **)
+		**)
 		PROCEDURE Body(body: SyntaxTree.Body);
 		PROCEDURE Body(body: SyntaxTree.Body);
 		BEGIN
 		BEGIN
 			ResolveStatementBlock(body);
 			ResolveStatementBlock(body);
@@ -7588,13 +7540,11 @@ TYPE
 			END;
 			END;
 		END Register;
 		END Register;
 
 
-
-
 		(**
 		(**
 			implementation: check and resolve an implementation part
 			implementation: check and resolve an implementation part
 		**)
 		**)
 		(*!	can in principle be done in parallel on different checkers: implementations do only depend on declarations)
 		(*!	can in principle be done in parallel on different checkers: implementations do only depend on declarations)
-		 move implementation checker to a separate object ? *)
+			move implementation checker to a separate object ? *)
 		PROCEDURE Implementation(scope: SyntaxTree.Scope);
 		PROCEDURE Implementation(scope: SyntaxTree.Scope);
 		VAR prevScope: SyntaxTree.Scope; procedure: SyntaxTree.Procedure; prevIsRealtime, prevIsBodyProcedure, prevIsCellNet: BOOLEAN;
 		VAR prevScope: SyntaxTree.Scope; procedure: SyntaxTree.Procedure; prevIsRealtime, prevIsBodyProcedure, prevIsCellNet: BOOLEAN;
 			procedureType: SyntaxTree.ProcedureType;
 			procedureType: SyntaxTree.ProcedureType;
@@ -7741,7 +7691,6 @@ TYPE
 				END;
 				END;
 			END DeclareCell;
 			END DeclareCell;
 
 
-
 		BEGIN
 		BEGIN
 			prevError := error;
 			prevError := error;
 			prevPhase := phase;
 			prevPhase := phase;
@@ -7864,8 +7813,6 @@ TYPE
 				symbol := symbol.nextSymbol;
 				symbol := symbol.nextSymbol;
 			END;
 			END;
 
 
-
-
 			IF (scope IS SyntaxTree.ProcedureScope) & scope(SyntaxTree.ProcedureScope).ownerProcedure.type.isRealtime THEN
 			IF (scope IS SyntaxTree.ProcedureScope) & scope(SyntaxTree.ProcedureScope).ownerProcedure.type.isRealtime THEN
 				symbol := scope.firstSymbol;
 				symbol := scope.firstSymbol;
 				WHILE symbol # NIL DO
 				WHILE symbol # NIL DO
@@ -7971,9 +7918,9 @@ TYPE
 							thisOperator := thisOperator.nextOperator
 							thisOperator := thisOperator.nextOperator
 						END
 						END
 					END
 					END
-			 	END;
-			 	thatOperator := thatOperator.nextOperator
-			 END
+				END;
+				thatOperator := thatOperator.nextOperator
+			END
 		END CheckInterOperatorConformity;
 		END CheckInterOperatorConformity;
 
 
 		(** check module:
 		(** check module:
@@ -8030,7 +7977,6 @@ TYPE
 			currentScope := prevScope;
 			currentScope := prevScope;
 		END Module;
 		END Module;
 
 
-
 	END Checker;
 	END Checker;
 
 
 	Warnings*=OBJECT
 	Warnings*=OBJECT
@@ -8141,8 +8087,8 @@ TYPE
 			(scope IS SyntaxTree.ModuleScope)
 			(scope IS SyntaxTree.ModuleScope)
 			& (scope(SyntaxTree.ModuleScope).ownerModule.isCellNet)
 			& (scope(SyntaxTree.ModuleScope).ownerModule.isCellNet)
 			OR
 			OR
-			 (scope # NIL) & (scope IS SyntaxTree.CellScope)
-			 & (scope(SyntaxTree.CellScope).ownerCell.isCellNet)
+			(scope # NIL) & (scope IS SyntaxTree.CellScope)
+			& (scope(SyntaxTree.CellScope).ownerCell.isCellNet)
 	END IsCellNetScope;
 	END IsCellNetScope;
 
 
 	PROCEDURE IsCellScope(scope: SyntaxTree.Scope): BOOLEAN;
 	PROCEDURE IsCellScope(scope: SyntaxTree.Scope): BOOLEAN;
@@ -8150,14 +8096,12 @@ TYPE
 		RETURN (scope # NIL) & (scope IS SyntaxTree.CellScope) & ~(scope(SyntaxTree.CellScope).ownerCell.isCellNet)
 		RETURN (scope # NIL) & (scope IS SyntaxTree.CellScope) & ~(scope(SyntaxTree.CellScope).ownerCell.isCellNet)
 	END IsCellScope;
 	END IsCellScope;
 
 
-
 	PROCEDURE InCellNetScope(scope: SyntaxTree.Scope): BOOLEAN;
 	PROCEDURE InCellNetScope(scope: SyntaxTree.Scope): BOOLEAN;
 	BEGIN
 	BEGIN
 		WHILE (scope # NIL) & ~IsCellScope(scope) & ~IsCellNetScope(scope) DO scope := scope.outerScope END;
 		WHILE (scope # NIL) & ~IsCellScope(scope) & ~IsCellNetScope(scope) DO scope := scope.outerScope END;
 		RETURN (scope # NIL) & IsCellNetScope(scope)
 		RETURN (scope # NIL) & IsCellNetScope(scope)
 	END InCellNetScope;
 	END InCellNetScope;
 
 
-
 	PROCEDURE ToMemoryUnits(system: Global.System; size: LONGINT): LONGINT;
 	PROCEDURE ToMemoryUnits(system: Global.System; size: LONGINT): LONGINT;
 	BEGIN
 	BEGIN
 		ASSERT(size MOD system.dataUnit = 0);
 		ASSERT(size MOD system.dataUnit = 0);
@@ -8338,7 +8282,6 @@ TYPE
 		END;
 		END;
 	END StaticArrayCompatible;
 	END StaticArrayCompatible;
 
 
-
 	PROCEDURE OpenArrayCompatible(formalType: SyntaxTree.ArrayType; actualType: SyntaxTree.Type): BOOLEAN;
 	PROCEDURE OpenArrayCompatible(formalType: SyntaxTree.ArrayType; actualType: SyntaxTree.Type): BOOLEAN;
 	VAR arrayBase: SyntaxTree.Type; result: BOOLEAN;
 	VAR arrayBase: SyntaxTree.Type; result: BOOLEAN;
 
 
@@ -8419,8 +8362,6 @@ TYPE
 		RETURN result
 		RETURN result
 	END MathArrayCompatible;
 	END MathArrayCompatible;
 
 
-
-
 	(**
 	(**
 		Math Array Type distance for assignments / parameter passings of the form
 		Math Array Type distance for assignments / parameter passings of the form
 		from -> to
 		from -> to
@@ -8547,8 +8488,6 @@ TYPE
 			WHILE (formalParameter # NIL) & (result # Infinity) DO
 			WHILE (formalParameter # NIL) & (result # Infinity) DO
 				actualParameter := actualParameters.GetExpression(i);
 				actualParameter := actualParameters.GetExpression(i);
 
 
-
-
 				ASSERT(formalParameter.type # NIL);
 				ASSERT(formalParameter.type # NIL);
 				IF (actualParameter.type = NIL) THEN distance := Infinity
 				IF (actualParameter.type = NIL) THEN distance := Infinity
 				ELSE
 				ELSE
@@ -8721,7 +8660,6 @@ TYPE
 		RETURN (type # NIL) & ((type.resolved IS SyntaxTree.IntegerType) & (type.resolved(SyntaxTree.IntegerType).sizeInBits <= addressWidth) OR (type.resolved IS SyntaxTree.SizeType))
 		RETURN (type # NIL) & ((type.resolved IS SyntaxTree.IntegerType) & (type.resolved(SyntaxTree.IntegerType).sizeInBits <= addressWidth) OR (type.resolved IS SyntaxTree.SizeType))
 	END IsSizeType;
 	END IsSizeType;
 
 
-
 	PROCEDURE IsSignedIntegerType*(type: SyntaxTree.Type): BOOLEAN;
 	PROCEDURE IsSignedIntegerType*(type: SyntaxTree.Type): BOOLEAN;
 	BEGIN
 	BEGIN
 		RETURN (type # NIL) & (type IS SyntaxTree.IntegerType) & type(SyntaxTree.IntegerType).signed
 		RETURN (type # NIL) & (type IS SyntaxTree.IntegerType) & type(SyntaxTree.IntegerType).signed
@@ -8756,7 +8694,6 @@ TYPE
 		RETURN result
 		RETURN result
 	END IsEnumerationValue;
 	END IsEnumerationValue;
 
 
-
 	PROCEDURE IsRealValue(x: SyntaxTree.Expression; VAR value: LONGREAL): BOOLEAN;
 	PROCEDURE IsRealValue(x: SyntaxTree.Expression; VAR value: LONGREAL): BOOLEAN;
 	VAR result: BOOLEAN;
 	VAR result: BOOLEAN;
 	BEGIN
 	BEGIN
@@ -8868,7 +8805,6 @@ TYPE
 		RETURN FALSE;
 		RETURN FALSE;
 	END IsOpenArray;
 	END IsOpenArray;
 
 
-
 	PROCEDURE IsStaticArray*(type: SyntaxTree.Type; VAR base: SyntaxTree.Type; VAR dim :LONGINT): BOOLEAN;
 	PROCEDURE IsStaticArray*(type: SyntaxTree.Type; VAR base: SyntaxTree.Type; VAR dim :LONGINT): BOOLEAN;
 	BEGIN
 	BEGIN
 		type := type.resolved;
 		type := type.resolved;
@@ -8949,7 +8885,6 @@ TYPE
 		RETURN result
 		RETURN result
 	END IsUnsafePointer;
 	END IsUnsafePointer;
 
 
-
 	PROCEDURE IsDisposable*(type: SyntaxTree.Type): BOOLEAN;
 	PROCEDURE IsDisposable*(type: SyntaxTree.Type): BOOLEAN;
 	BEGIN
 	BEGIN
 		RETURN (type # NIL) & (type.resolved IS SyntaxTree.PointerType) & (type.resolved(SyntaxTree.PointerType).isDisposable)
 		RETURN (type # NIL) & (type.resolved IS SyntaxTree.PointerType) & (type.resolved(SyntaxTree.PointerType).isDisposable)
@@ -9013,7 +8948,6 @@ TYPE
 		RETURN (type IS SyntaxTree.EnumerationType)
 		RETURN (type IS SyntaxTree.EnumerationType)
 	END IsEnumerationType;
 	END IsEnumerationType;
 
 
-
 	(** cf. section "Type extension (base type)" in the language report **)
 	(** cf. section "Type extension (base type)" in the language report **)
 	PROCEDURE IsTypeExtension(base,extension: SyntaxTree.Type): BOOLEAN;
 	PROCEDURE IsTypeExtension(base,extension: SyntaxTree.Type): BOOLEAN;
 	VAR result: BOOLEAN;
 	VAR result: BOOLEAN;
@@ -9075,7 +9009,6 @@ TYPE
 		END
 		END
 	END IsCallable;
 	END IsCallable;
 
 
-
 	(** compute and return the distance of two record types
 	(** compute and return the distance of two record types
 		returns the number of extension levels of from to to, returns infinite if to is not an extension of from
 		returns the number of extension levels of from to to, returns infinite if to is not an extension of from
 	**)
 	**)
@@ -9163,7 +9096,6 @@ TYPE
 		END;
 		END;
 	END IsIndexOperator;
 	END IsIndexOperator;
 
 
-
 	PROCEDURE IsUnextensibleRecord(d: SyntaxTree.Expression): BOOLEAN;
 	PROCEDURE IsUnextensibleRecord(d: SyntaxTree.Expression): BOOLEAN;
 	BEGIN
 	BEGIN
 		RETURN (d.type.resolved IS SyntaxTree.RecordType) &
 		RETURN (d.type.resolved IS SyntaxTree.RecordType) &
@@ -9318,7 +9250,6 @@ TYPE
 	BEGIN RETURN (type # NIL) & (type.resolved IS SyntaxTree.ComplexType);
 	BEGIN RETURN (type # NIL) & (type.resolved IS SyntaxTree.ComplexType);
 	END IsComplexType;
 	END IsComplexType;
 
 
-
 	PROCEDURE IsStaticRange(x: SyntaxTree.Expression; VAR firstValue, lastValue, stepValue: Basic.Integer): BOOLEAN;
 	PROCEDURE IsStaticRange(x: SyntaxTree.Expression; VAR firstValue, lastValue, stepValue: Basic.Integer): BOOLEAN;
 	VAR
 	VAR
 		result: BOOLEAN;
 		result: BOOLEAN;
@@ -9341,7 +9272,6 @@ TYPE
 	BEGIN RETURN (type.resolved IS SyntaxTree.MathArrayType) & (type.resolved(SyntaxTree.MathArrayType).form = SyntaxTree.Tensor)
 	BEGIN RETURN (type.resolved IS SyntaxTree.MathArrayType) & (type.resolved(SyntaxTree.MathArrayType).form = SyntaxTree.Tensor)
 	END IsTensor;
 	END IsTensor;
 
 
-
 	PROCEDURE IsStaticMathArray*(type: SyntaxTree.Type; VAR length: LONGINT; VAR baseType: SyntaxTree.Type): BOOLEAN;
 	PROCEDURE IsStaticMathArray*(type: SyntaxTree.Type; VAR length: LONGINT; VAR baseType: SyntaxTree.Type): BOOLEAN;
 	BEGIN
 	BEGIN
 		IF (type IS SyntaxTree.MathArrayType) & (type(SyntaxTree.MathArrayType).form = SyntaxTree.Static) THEN
 		IF (type IS SyntaxTree.MathArrayType) & (type(SyntaxTree.MathArrayType).form = SyntaxTree.Static) THEN
@@ -9353,13 +9283,11 @@ TYPE
 		END;
 		END;
 	END IsStaticMathArray;
 	END IsStaticMathArray;
 
 
-
 	PROCEDURE SymbolHasAddress*(symbol: SyntaxTree.Symbol): BOOLEAN;
 	PROCEDURE SymbolHasAddress*(symbol: SyntaxTree.Symbol): BOOLEAN;
 	BEGIN
 	BEGIN
 		RETURN (symbol IS SyntaxTree.Variable) OR (symbol IS SyntaxTree.Parameter) OR (symbol IS SyntaxTree.Procedure)
 		RETURN (symbol IS SyntaxTree.Variable) OR (symbol IS SyntaxTree.Parameter) OR (symbol IS SyntaxTree.Procedure)
 	END SymbolHasAddress;
 	END SymbolHasAddress;
 
 
-
 	PROCEDURE HasAddress*(expression: SyntaxTree.Expression): BOOLEAN;
 	PROCEDURE HasAddress*(expression: SyntaxTree.Expression): BOOLEAN;
 	BEGIN
 	BEGIN
 		RETURN
 		RETURN
@@ -9419,7 +9347,6 @@ TYPE
 		RETURN (procedureType # NIL) & (procedureType.callingConvention=SyntaxTree.OberonCallingConvention) & ReturnedAsParameter(procedureType.returnType);
 		RETURN (procedureType # NIL) & (procedureType.callingConvention=SyntaxTree.OberonCallingConvention) & ReturnedAsParameter(procedureType.returnType);
 	END StructuredReturnType;
 	END StructuredReturnType;
 
 
-
 END FoxSemanticChecker.
 END FoxSemanticChecker.
 
 
 System.FreeDownTo FoxSemanticChecker ~
 System.FreeDownTo FoxSemanticChecker ~

+ 28 - 66
source/FoxSyntaxTree.Mod

@@ -40,7 +40,7 @@ CONST
 
 
 	(** parameter forms *)
 	(** parameter forms *)
 	ValueParameter* = 0;  VarParameter* = 1;  ConstParameter* = 2;
 	ValueParameter* = 0;  VarParameter* = 1;  ConstParameter* = 2;
-	InPort*=3; 	OutPort*=4;
+	InPort*=3; OutPort*=4;
 
 
 	(** array forms *)
 	(** array forms *)
 	Static*=1; (* ARRAY x OF .. / ARRAY [x] OF ... *)
 	Static*=1; (* ARRAY x OF .. / ARRAY [x] OF ... *)
@@ -237,7 +237,6 @@ TYPE
 		PROCEDURE VisitInlineCallDesignator*(x: InlineCallDesignator);
 		PROCEDURE VisitInlineCallDesignator*(x: InlineCallDesignator);
 		BEGIN HALT(100) (* abstract *) END VisitInlineCallDesignator;
 		BEGIN HALT(100) (* abstract *) END VisitInlineCallDesignator;
 
 
-
 		PROCEDURE VisitStatementDesignator*(x: StatementDesignator);
 		PROCEDURE VisitStatementDesignator*(x: StatementDesignator);
 		BEGIN HALT(100) (* abstract *) END VisitStatementDesignator;
 		BEGIN HALT(100) (* abstract *) END VisitStatementDesignator;
 
 
@@ -296,7 +295,7 @@ TYPE
 		PROCEDURE VExpression*(x: Expression);
 		PROCEDURE VExpression*(x: Expression);
 		BEGIN
 		BEGIN
 			WITH x:
 			WITH x:
-			  ResultDesignator DO VisitResultDesignator(x)
+			| ResultDesignator DO VisitResultDesignator(x)
 			| SelfDesignator DO VisitSelfDesignator(x)
 			| SelfDesignator DO VisitSelfDesignator(x)
 			| SupercallDesignator DO VisitSupercallDesignator(x)
 			| SupercallDesignator DO VisitSupercallDesignator(x)
 			| DereferenceDesignator DO VisitDereferenceDesignator(x)
 			| DereferenceDesignator DO VisitDereferenceDesignator(x)
@@ -375,8 +374,8 @@ TYPE
 
 
 		PROCEDURE VSymbol*(x: Symbol);
 		PROCEDURE VSymbol*(x: Symbol);
 		BEGIN
 		BEGIN
-			WITH
-			  x: Module DO VisitModule(x)
+			WITH x:
+			| Module DO VisitModule(x)
 			| TypeDeclaration DO VisitTypeDeclaration(x)
 			| TypeDeclaration DO VisitTypeDeclaration(x)
 			| Constant DO VisitConstant(x)
 			| Constant DO VisitConstant(x)
 			| Parameter DO VisitParameter(x)
 			| Parameter DO VisitParameter(x)
@@ -503,7 +502,6 @@ TYPE
 			Basic.SuffixSegmentedName(name, suffix)
 			Basic.SuffixSegmentedName(name, suffix)
 		END GetName;
 		END GetName;
 
 
-
 	END QualifiedIdentifier;
 	END QualifiedIdentifier;
 
 
 	(**** types ****)
 	(**** types ****)
@@ -803,7 +801,6 @@ TYPE
 
 
 	END SizeType;
 	END SizeType;
 
 
-
 	(** <<BOOLEAN>>
 	(** <<BOOLEAN>>
 		boolean type
 		boolean type
 	**)
 	**)
@@ -825,7 +822,6 @@ TYPE
 
 
 	END BooleanType;
 	END BooleanType;
 
 
-
 	(** <<SET>>
 	(** <<SET>>
 		set type
 		set type
 	**)
 	**)
@@ -1025,7 +1021,6 @@ TYPE
 			RETURN (resolved # NIL) & (resolved.IsRecordType());
 			RETURN (resolved # NIL) & (resolved.IsRecordType());
 		END IsRecordType;
 		END IsRecordType;
 
 
-
 	END QualifiedType;
 	END QualifiedType;
 
 
 	(** string literal type **)
 	(** string literal type **)
@@ -1131,7 +1126,6 @@ TYPE
 			form := f;
 			form := f;
 		END SetForm;
 		END SetForm;
 
 
-
 		PROCEDURE SetLength*(length: Expression);
 		PROCEDURE SetLength*(length: Expression);
 		BEGIN
 		BEGIN
 			SELF.length := length;
 			SELF.length := length;
@@ -1728,7 +1722,6 @@ TYPE
 
 
 	END CellType;
 	END CellType;
 
 
-
 	(** <<procedureType = PROCEDURE [{DELEGATE}] (firstParameter .. lastParameter): returnType>>
 	(** <<procedureType = PROCEDURE [{DELEGATE}] (firstParameter .. lastParameter): returnType>>
 		also used as type for procedures
 		also used as type for procedures
 	**)
 	**)
@@ -1887,7 +1880,6 @@ TYPE
 
 
 		END SameSignature;
 		END SameSignature;
 
 
-
 		PROCEDURE SameType*(this: Type): BOOLEAN;
 		PROCEDURE SameType*(this: Type): BOOLEAN;
 		BEGIN
 		BEGIN
 			RETURN SameSignature(this)
 			RETURN SameSignature(this)
@@ -1923,7 +1915,6 @@ TYPE
 			resolved-: Value;
 			resolved-: Value;
 			isHidden-: BOOLEAN;
 			isHidden-: BOOLEAN;
 
 
-
 		PROCEDURE End*( position: Position);
 		PROCEDURE End*( position: Position);
 		BEGIN SELF.end := position;
 		BEGIN SELF.end := position;
 		END End;
 		END End;
@@ -1940,7 +1931,6 @@ TYPE
 		BEGIN isHidden := hidden
 		BEGIN isHidden := hidden
 		END SetHidden;
 		END SetHidden;
 
 
-
 		PROCEDURE SetType*(type: Type);
 		PROCEDURE SetType*(type: Type);
 		BEGIN
 		BEGIN
 			SELF.type := type;
 			SELF.type := type;
@@ -2107,7 +2097,7 @@ TYPE
 	END BinaryExpression;
 	END BinaryExpression;
 
 
 	(** expression that denotes a range
 	(** expression that denotes a range
-	    <<[first] '..' [last] ['by' step] | '*' >>
+		<<[first] '..' [last] ['by' step] | '*' >>
 	**)
 	**)
 	RangeExpression* = OBJECT (Expression)
 	RangeExpression* = OBJECT (Expression)
 	VAR
 	VAR
@@ -2222,7 +2212,6 @@ TYPE
 			relatedRhs := expression;
 			relatedRhs := expression;
 		END SetRelatedRhs;
 		END SetRelatedRhs;
 
 
-
 		PROCEDURE Clone(): Expression;
 		PROCEDURE Clone(): Expression;
 		VAR clone: Designator;
 		VAR clone: Designator;
 		BEGIN
 		BEGIN
@@ -2230,10 +2219,8 @@ TYPE
 			NEW(clone, position); RETURN clone
 			NEW(clone, position); RETURN clone
 		END Clone;
 		END Clone;
 
 
-
 	END Designator;
 	END Designator;
 
 
-
 	(*** first phase (parse time) designators ***)
 	(*** first phase (parse time) designators ***)
 
 
 	(** <<identifier>>
 	(** <<identifier>>
@@ -2272,7 +2259,6 @@ TYPE
 
 
 	END SelectorDesignator;
 	END SelectorDesignator;
 
 
-
 	(** <<left(arg1, arg2, ...)>>
 	(** <<left(arg1, arg2, ...)>>
 		may designate a function call or a type guard
 		may designate a function call or a type guard
 	**)
 	**)
@@ -2292,7 +2278,6 @@ TYPE
 
 
 	END ParameterDesignator;
 	END ParameterDesignator;
 
 
-
 	(** <<left^>>
 	(** <<left^>>
 		may designate a pointer dereference or a method supercall
 		may designate a pointer dereference or a method supercall
 	**)
 	**)
@@ -2571,7 +2556,6 @@ TYPE
 		BEGIN RETURN type.NeedsTrace();
 		BEGIN RETURN type.NeedsTrace();
 		END NeedsTrace;
 		END NeedsTrace;
 
 
-
 	END SelfDesignator;
 	END SelfDesignator;
 
 
 	(** <<RESULT>> **)
 	(** <<RESULT>> **)
@@ -2906,7 +2890,6 @@ TYPE
 
 
 		comment-: Comment;
 		comment-: Comment;
 
 
-
 		PROCEDURE & InitSymbol(position: Position; name:Identifier);
 		PROCEDURE & InitSymbol(position: Position; name:Identifier);
 		BEGIN
 		BEGIN
 			SELF.position := position; state := Undefined;
 			SELF.position := position; state := Undefined;
@@ -2997,7 +2980,6 @@ TYPE
 			RETURN access * Public # {};
 			RETURN access * Public # {};
 		END NeedsSection;
 		END NeedsSection;
 
 
-
 	END Symbol;
 	END Symbol;
 
 
 	(**
 	(**
@@ -3040,7 +3022,6 @@ TYPE
 
 
 	END TypeDeclaration;
 	END TypeDeclaration;
 
 
-
 	(** <<CONST name = value >>
 	(** <<CONST name = value >>
 		Constant declaration symbol. Represents a constant being defined in the form CONST name  =  value
 		Constant declaration symbol. Represents a constant being defined in the form CONST name  =  value
 		The type of the constant is stored in the type field and is resolved by the semantic checker.
 		The type of the constant is stored in the type field and is resolved by the semantic checker.
@@ -3198,7 +3179,6 @@ TYPE
 		nextProperty-, prevProperty-: Property;
 		nextProperty-, prevProperty-: Property;
 		value-: Expression;
 		value-: Expression;
 
 
-
 		PROCEDURE & InitProperty(position: Position;  name: Identifier);
 		PROCEDURE & InitProperty(position: Position;  name: Identifier);
 		BEGIN
 		BEGIN
 			InitSymbol( position, name );
 			InitSymbol( position, name );
@@ -3227,7 +3207,6 @@ TYPE
 
 
 	END Alias;
 	END Alias;
 
 
-
 	(** Procedure declaration symbol. Represents a procedure being defined in the form PROCEDURE name(parameters): returnType;
 	(** Procedure declaration symbol. Represents a procedure being defined in the form PROCEDURE name(parameters): returnType;
 		Note that the type of a procedure is a ProcedureType (and not the return type of the procedure).
 		Note that the type of a procedure is a ProcedureType (and not the return type of the procedure).
 		Parameters, local variables, constants and type declarations are stored in the procedureScope field.
 		Parameters, local variables, constants and type declarations are stored in the procedureScope field.
@@ -3322,7 +3301,6 @@ TYPE
 
 
 	END Procedure;
 	END Procedure;
 
 
-
 	(** Builtin symbol stands for a builtin procedure. Is resolved by the semantic checker. **)
 	(** Builtin symbol stands for a builtin procedure. Is resolved by the semantic checker. **)
 	Builtin* = OBJECT (Symbol)
 	Builtin* = OBJECT (Symbol)
 	VAR
 	VAR
@@ -3511,7 +3489,6 @@ TYPE
 			end := pos;
 			end := pos;
 		END End;
 		END End;
 
 
-
 	END Statement;
 	END Statement;
 
 
 	(** << call(...) >> **)
 	(** << call(...) >> **)
@@ -3607,42 +3584,41 @@ TYPE
 
 
 	END Part;
 	END Part;
 
 
-
 	(** << ... condition THEN statements ... >> **)
 	(** << ... condition THEN statements ... >> **)
 	IfPart*= OBJECT (Part)
 	IfPart*= OBJECT (Part)
 	VAR
 	VAR
 		condition-: Expression;
 		condition-: Expression;
-	 	statements-: StatementSequence;
+		statements-: StatementSequence;
 
 
-	 	comment-: Comment;
+		comment-: Comment;
 
 
-	 	PROCEDURE & InitIfPart;
-	 	BEGIN
-	 		InitPart;
-	 		statements := NIL; condition := NIL; comment := NIL;
-	 	END InitIfPart;
+		PROCEDURE & InitIfPart;
+		BEGIN
+			InitPart;
+			statements := NIL; condition := NIL; comment := NIL;
+		END InitIfPart;
 
 
-	 	PROCEDURE SetCondition*(condition: Expression);
-	 	BEGIN SELF.condition := condition
-	 	END SetCondition;
+		PROCEDURE SetCondition*(condition: Expression);
+		BEGIN SELF.condition := condition
+		END SetCondition;
 
 
-	 	PROCEDURE SetStatements*(statements: StatementSequence);
-	 	BEGIN SELF.statements := statements
-	 	END SetStatements;
+		PROCEDURE SetStatements*(statements: StatementSequence);
+		BEGIN SELF.statements := statements
+		END SetStatements;
 
 
-	 	PROCEDURE SetComment*(comment: Comment);
-	 	BEGIN SELF.comment := comment
-	 	END SetComment;
+		PROCEDURE SetComment*(comment: Comment);
+		BEGIN SELF.comment := comment
+		END SetComment;
 
 
-	 	PROCEDURE Clone(): IfPart;
-	 	VAR copy: IfPart;
-	 	BEGIN
-	 		NEW(copy); copy.condition := CloneExpression(condition);
-	 		copy.statements := CloneStatementSequence(statements);
+		PROCEDURE Clone(): IfPart;
+		VAR copy: IfPart;
+		BEGIN
+			NEW(copy); copy.condition := CloneExpression(condition);
+			copy.statements := CloneStatementSequence(statements);
 			RETURN copy
 			RETURN copy
-	 	END Clone;
+		END Clone;
 
 
-	 END IfPart;
+	END IfPart;
 
 
 	(** << IF ifPart {ELSIF elsifParts} ELSE elseParts >> **)
 	(** << IF ifPart {ELSIF elsifParts} ELSE elseParts >> **)
 	IfStatement* = OBJECT (Statement)
 	IfStatement* = OBJECT (Statement)
@@ -3823,7 +3799,6 @@ TYPE
 			RETURN copy
 			RETURN copy
 		END Clone;
 		END Clone;
 
 
-
 	END CasePart;
 	END CasePart;
 
 
 	(** << CASE varaible OF caseParts ELSE elsePart >> **)
 	(** << CASE varaible OF caseParts ELSE elsePart >> **)
@@ -4103,7 +4078,6 @@ TYPE
 			RETURN copy
 			RETURN copy
 		END Clone;
 		END Clone;
 
 
-
 	END AwaitStatement;
 	END AwaitStatement;
 
 
 	(* << Identifier ( Expression) >> *)
 	(* << Identifier ( Expression) >> *)
@@ -4289,7 +4263,6 @@ TYPE
 
 
 	END Comment;
 	END Comment;
 
 
-
 	(**** building blocks ****)
 	(**** building blocks ****)
 
 
 	Scope*=OBJECT
 	Scope*=OBJECT
@@ -4308,7 +4281,6 @@ TYPE
 
 
 		ownerModule-: Module;
 		ownerModule-: Module;
 
 
-
 		PROCEDURE & InitScope(outer: Scope);
 		PROCEDURE & InitScope(outer: Scope);
 		BEGIN
 		BEGIN
 			firstSymbol := NIL; numberSymbols := 0;
 			firstSymbol := NIL; numberSymbols := 0;
@@ -4743,7 +4715,6 @@ TYPE
 			bodyProcedure := NIL;
 			bodyProcedure := NIL;
 		END Clear;
 		END Clear;
 
 
-
 		PROCEDURE SetOwnerCell*(owner: CellType);
 		PROCEDURE SetOwnerCell*(owner: CellType);
 		BEGIN
 		BEGIN
 			ownerCell := owner
 			ownerCell := owner
@@ -4817,7 +4788,6 @@ TYPE
 
 
 	END CellScope;
 	END CellScope;
 
 
-
 	(**
 	(**
 		<<
 		<<
 		IMPORT firstImport .. lastImport;
 		IMPORT firstImport .. lastImport;
@@ -4955,10 +4925,8 @@ TYPE
 			END;
 			END;
 		END RemoveImporters;
 		END RemoveImporters;
 
 
-
 	END ModuleScope;
 	END ModuleScope;
 
 
-
 	(* << MODULE name ['in' context] moduleScope name '.' >>  *)
 	(* << MODULE name ['in' context] moduleScope name '.' >>  *)
 	Module* = OBJECT (Symbol)
 	Module* = OBJECT (Symbol)
 		VAR
 		VAR
@@ -4992,7 +4960,6 @@ TYPE
 			SELF.case := case
 			SELF.case := case
 		END SetCase;
 		END SetCase;
 
 
-
 		PROCEDURE SetCellNet*(isCellNet: BOOLEAN);
 		PROCEDURE SetCellNet*(isCellNet: BOOLEAN);
 		BEGIN SELF.isCellNet := isCellNet
 		BEGIN SELF.isCellNet := isCellNet
 		END SetCellNet;
 		END SetCellNet;
@@ -5013,7 +4980,6 @@ TYPE
 		BEGIN SELF.modifiers := modifiers
 		BEGIN SELF.modifiers := modifiers
 		END SetModifiers;
 		END SetModifiers;
 
 
-
 		PROCEDURE AddScope*(c: Scope);
 		PROCEDURE AddScope*(c: Scope);
 		BEGIN
 		BEGIN
 			IF lastScope= NIL THEN firstScope := c ELSE lastScope.nextScope := c END;
 			IF lastScope= NIL THEN firstScope := c ELSE lastScope.nextScope := c END;
@@ -5374,7 +5340,6 @@ VAR
 		NEW( property, position, name);  RETURN property;
 		NEW( property, position, name);  RETURN property;
 	END NewProperty;
 	END NewProperty;
 
 
-
 	PROCEDURE NewExpressionList*(): ExpressionList;
 	PROCEDURE NewExpressionList*(): ExpressionList;
 	VAR expressionList: ExpressionList;
 	VAR expressionList: ExpressionList;
 	BEGIN
 	BEGIN
@@ -5661,7 +5626,6 @@ VAR
 		NEW( statementDesignator, position, s); RETURN statementDesignator
 		NEW( statementDesignator, position, s); RETURN statementDesignator
 	END NewStatementDesignator;
 	END NewStatementDesignator;
 
 
-
 	PROCEDURE NewBody*( position: Position ; scope: ProcedureScope): Body;
 	PROCEDURE NewBody*( position: Position ; scope: ProcedureScope): Body;
 	VAR body: Body;
 	VAR body: Body;
 	BEGIN
 	BEGIN
@@ -5832,8 +5796,6 @@ VAR
 
 
 	END Init;
 	END Init;
 
 
-
 BEGIN
 BEGIN
 	Init;
 	Init;
 END FoxSyntaxTree.
 END FoxSyntaxTree.
-

+ 1 - 9
source/FoxTRMAssembler.Mod

@@ -11,7 +11,7 @@ TYPE
 TYPE
 TYPE
 	Assembler*= OBJECT (FoxAssembler.Assembler)
 	Assembler*= OBJECT (FoxAssembler.Assembler)
 	VAR capabilities-: SET;
 	VAR capabilities-: SET;
-		  instructionSet: InstructionSet.InstructionSet;
+		instructionSet: InstructionSet.InstructionSet;
 
 
 		PROCEDURE &Init2*(diagnostics: Diagnostics.Diagnostics; capabilities: SET; instructionSet: InstructionSet.InstructionSet);
 		PROCEDURE &Init2*(diagnostics: Diagnostics.Diagnostics; capabilities: SET; instructionSet: InstructionSet.InstructionSet);
 		BEGIN
 		BEGIN
@@ -111,14 +111,6 @@ TYPE
 		END GetRegister;
 		END GetRegister;
 	END Assembler;
 	END Assembler;
 
 
-
-
-
 END FoxTRMAssembler.
 END FoxTRMAssembler.
 
 
 System.Free FoxTRMAssembler FoxTRMInstructionSet ~
 System.Free FoxTRMAssembler FoxTRMInstructionSet ~
-
-
-
-
-

+ 53 - 75
source/FoxTRMBackend.Mod

@@ -313,8 +313,6 @@ TYPE
 
 
 		BEGIN
 		BEGIN
 
 
-
-
 			physicalRegisters(PhysicalRegisters).SupportFP(FPSupported);
 			physicalRegisters(PhysicalRegisters).SupportFP(FPSupported);
 			supportFP := FPSupported;
 			supportFP := FPSupported;
 			tickets.Init;
 			tickets.Init;
@@ -432,7 +430,7 @@ TYPE
 					| IntermediateCode.mul:
 					| IntermediateCode.mul:
 						IF (Global.NoMulCapability IN backend.capabilities) THEN  (*mul forbidden*)
 						IF (Global.NoMulCapability IN backend.capabilities) THEN  (*mul forbidden*)
 							IF IntermediateCode.IsConstantInteger(instr.op3,value) & IntermediateBackend.PowerOf2(value,exp) THEN RETURN TRUE
 							IF IntermediateCode.IsConstantInteger(instr.op3,value) & IntermediateBackend.PowerOf2(value,exp) THEN RETURN TRUE
-							ELSE procedureName:="MulL"; RETURN FALSE	 END;
+							ELSE procedureName:="MulL"; RETURN FALSE END;
 						ELSE
 						ELSE
 							RETURN TRUE;
 							RETURN TRUE;
 						END
 						END
@@ -722,7 +720,6 @@ TYPE
 			END;
 			END;
 		END PostGenerate;
 		END PostGenerate;
 
 
-
 		PROCEDURE TicketToOperand(ticket:Ticket; VAR op: InstructionSet.Operand);
 		PROCEDURE TicketToOperand(ticket:Ticket; VAR op: InstructionSet.Operand);
 		BEGIN
 		BEGIN
 			ASSERT(ticket # NIL);
 			ASSERT(ticket # NIL);
@@ -767,9 +764,9 @@ TYPE
 				stack layout:
 				stack layout:
 				p1
 				p1
 				...
 				...
-				pm	 													(parameters pushed by caller)
-				LR   													(explicitly pushed by frontend because hasLinkRegister = TRUE)
-				prev FP <-- FP = logicalFP 	(explicitly pushed by frontend)
+				pm														(parameters pushed by caller)
+				LR													(explicitly pushed by frontend because hasLinkRegister = TRUE)
+				prev FP <-- FP = logicalFP	(explicitly pushed by frontend)
 				v1
 				v1
 				...
 				...
 				vn
 				vn
@@ -898,7 +895,6 @@ TYPE
 			END;
 			END;
 		END Resolve;
 		END Resolve;
 
 
-
 		PROCEDURE EmitCall(VAR instruction: IntermediateCode.Instruction);
 		PROCEDURE EmitCall(VAR instruction: IntermediateCode.Instruction);
 		VAR op: InstructionSet.Operand; section: IntermediateCode.Section; code: BinaryCode.Section; symbol: ObjectFile.Identifier;
 		VAR op: InstructionSet.Operand; section: IntermediateCode.Section; code: BinaryCode.Section; symbol: ObjectFile.Identifier;
 			fixup, newFixup: BinaryCode.Fixup; pc: LONGINT; regOp: Operand; offset,reloffset: LONGINT;
 			fixup, newFixup: BinaryCode.Fixup; pc: LONGINT; regOp: Operand; offset,reloffset: LONGINT;
@@ -1178,9 +1174,8 @@ TYPE
 			RETURN FALSE
 			RETURN FALSE
 		END UnsignedImmediate;
 		END UnsignedImmediate;
 
 
-
 		PROCEDURE HardwareIntegerRegister(index: LONGINT; sizeInBits: LONGINT): LONGINT;
 		PROCEDURE HardwareIntegerRegister(index: LONGINT; sizeInBits: LONGINT): LONGINT;
-		BEGIN 	RETURN index
+		BEGIN RETURN index
 		END HardwareIntegerRegister;
 		END HardwareIntegerRegister;
 
 
 		PROCEDURE HardwareFloatRegister(index: LONGINT; sizeInBits: LONGINT): LONGINT;
 		PROCEDURE HardwareFloatRegister(index: LONGINT; sizeInBits: LONGINT): LONGINT;
@@ -1255,7 +1250,6 @@ TYPE
 				MovIfDifferent(tmp, physical);
 				MovIfDifferent(tmp, physical);
 				physical := tmp;
 				physical := tmp;
 
 
-
 				IF (offset >= 0) & (offset < ASH(1,instructionSet.ImmediateFixupBits)) THEN
 				IF (offset >= 0) & (offset < ASH(1,instructionSet.ImmediateFixupBits)) THEN
 					instructionSet.InitImmediate(imm, 0, offset);
 					instructionSet.InitImmediate(imm, 0, offset);
 					Emit2(opADD,physical,imm);
 					Emit2(opADD,physical,imm);
@@ -1282,7 +1276,6 @@ TYPE
 			IF ~IsSameRegister(a,b) THEN Emit2(opMOV, a, b) END;
 			IF ~IsSameRegister(a,b) THEN Emit2(opMOV, a, b) END;
 		END MovIfDifferent;
 		END MovIfDifferent;
 
 
-
 		PROCEDURE AcquireDestinationRegister(CONST vop: IntermediateCode.Operand; part: LONGINT; VAR op: Operand);
 		PROCEDURE AcquireDestinationRegister(CONST vop: IntermediateCode.Operand; part: LONGINT; VAR op: Operand);
 		VAR  type: IntermediateCode.Type;
 		VAR  type: IntermediateCode.Type;
 		BEGIN
 		BEGIN
@@ -1327,7 +1320,6 @@ TYPE
 			END;
 			END;
 		END PrepareOp3;
 		END PrepareOp3;
 
 
-
 		PROCEDURE PrepareFOp3(CONST instruction: IntermediateCode.Instruction; VAR dest, left, right: Assembler.Operand);
 		PROCEDURE PrepareFOp3(CONST instruction: IntermediateCode.Instruction; VAR dest, left, right: Assembler.Operand);
 		VAR vop1,vop2, vop3: IntermediateCode.Operand; op2: InstructionSet.Operand;
 		VAR vop1,vop2, vop3: IntermediateCode.Operand; op2: InstructionSet.Operand;
 			opx: Operand;
 			opx: Operand;
@@ -1414,7 +1406,6 @@ TYPE
 			FinishOp(instruction.op1,Low,destLow, leftLow);
 			FinishOp(instruction.op1,Low,destLow, leftLow);
 		END EmitFAdd;
 		END EmitFAdd;
 
 
-
 		PROCEDURE EmitSub(VAR instruction: IntermediateCode.Instruction);
 		PROCEDURE EmitSub(VAR instruction: IntermediateCode.Instruction);
 		VAR destLow, destHigh, leftLow, rightLow, leftHigh, rightHigh: Operand; negateLow, negateHigh: BOOLEAN; fixup: BinaryCode.Fixup;
 		VAR destLow, destHigh, leftLow, rightLow, leftHigh, rightHigh: Operand; negateLow, negateHigh: BOOLEAN; fixup: BinaryCode.Fixup;
 		BEGIN
 		BEGIN
@@ -1450,7 +1441,6 @@ TYPE
 			FinishOp(instruction.op1,Low,destLow, leftLow);
 			FinishOp(instruction.op1,Low,destLow, leftLow);
 		END EmitFSub;
 		END EmitFSub;
 
 
-
 		PROCEDURE EmitMul(VAR instruction: IntermediateCode.Instruction);
 		PROCEDURE EmitMul(VAR instruction: IntermediateCode.Instruction);
 		VAR negate: BOOLEAN;
 		VAR negate: BOOLEAN;
 			op1Low, op2Low, op3Low, op1High, op2High, op3High, destLow, destHigh: Operand;
 			op1Low, op2Low, op3Low, op1High, op2High, op3High, destLow, destHigh: Operand;
@@ -1542,7 +1532,6 @@ TYPE
 				END;
 				END;
 		END EmitAnd;
 		END EmitAnd;
 
 
-
 		PROCEDURE EmitOr(VAR instruction: IntermediateCode.Instruction; part: LONGINT);
 		PROCEDURE EmitOr(VAR instruction: IntermediateCode.Instruction; part: LONGINT);
 		VAR left, right, dest: Operand; negate: BOOLEAN;
 		VAR left, right, dest: Operand; negate: BOOLEAN;
 		BEGIN
 		BEGIN
@@ -1847,7 +1836,7 @@ TYPE
 								MOV LR, Rx ; restore LR
 								MOV LR, Rx ; restore LR
 								ADD Ry, offset
 								ADD Ry, offset
 								BR R2
 								BR R2
-							 *)
+							*)
 							ticket1 := TemporaryTicket(IntermediateCode.GeneralPurposeRegister,IntermediateCode.int32);
 							ticket1 := TemporaryTicket(IntermediateCode.GeneralPurposeRegister,IntermediateCode.int32);
 							ticket2 := TemporaryTicket(IntermediateCode.GeneralPurposeRegister,IntermediateCode.int32);
 							ticket2 := TemporaryTicket(IntermediateCode.GeneralPurposeRegister,IntermediateCode.int32);
 							TicketToOperand(ticket1,oldLR);
 							TicketToOperand(ticket1,oldLR);
@@ -2031,7 +2020,6 @@ TYPE
 						Emit1(hiFail, target);
 						Emit1(hiFail, target);
 					END;
 					END;
 
 
-
 					(*ReleaseHint(op2.register);
 					(*ReleaseHint(op2.register);
 					ReleaseHint(op3.register);*)
 					ReleaseHint(op3.register);*)
 				END;
 				END;
@@ -2206,8 +2194,6 @@ TYPE
 
 
 	END System;
 	END System;
 
 
-
-
 	BackendTRM = OBJECT (IntermediateBackend.IntermediateBackend)
 	BackendTRM = OBJECT (IntermediateBackend.IntermediateBackend)
 	VAR
 	VAR
 		cg: CodeGeneratorTRM;
 		cg: CodeGeneratorTRM;
@@ -2230,7 +2216,6 @@ TYPE
 		BEGIN
 		BEGIN
 			Initialize^(diagnostics, log, flags, checker, system); (*goes up the inheritance hierarchy all the way to Backend.Mod*)
 			Initialize^(diagnostics, log, flags, checker, system); (*goes up the inheritance hierarchy all the way to Backend.Mod*)
 
 
-
 			NEW(cg, builtinsModuleName, diagnostics, SELF,myInstructionSet);
 			NEW(cg, builtinsModuleName, diagnostics, SELF,myInstructionSet);
 			cg.patchSpartan6 := patchSpartan6;
 			cg.patchSpartan6 := patchSpartan6;
 			recentInstructionWidth := Sections.UnknownSize;
 			recentInstructionWidth := Sections.UnknownSize;
@@ -2289,9 +2274,8 @@ TYPE
 				END;
 				END;
 			END Resolve;
 			END Resolve;
 
 
-
-		 	(* recompute fixup positions and assign binary sections *)
-		 	PROCEDURE PatchFixups(section: BinaryCode.Section);
+			(* recompute fixup positions and assign binary sections *)
+			PROCEDURE PatchFixups(section: BinaryCode.Section);
 			VAR resolved: BinaryCode.Section; fixup: BinaryCode.Fixup; symbolOffset: LONGINT; in: IntermediateCode.Section;
 			VAR resolved: BinaryCode.Section; fixup: BinaryCode.Fixup; symbolOffset: LONGINT; in: IntermediateCode.Section;
 			BEGIN
 			BEGIN
 				fixup := section.fixupList.firstFixup;
 				fixup := section.fixupList.firstFixup;
@@ -2311,59 +2295,57 @@ TYPE
 			END PatchFixups;
 			END PatchFixups;
 
 
 		BEGIN
 		BEGIN
-		 	cg.SetModule(module);
-		 	cg.dump := dump;
-
-		 	FOR i := 0 TO module.allSections.Length() - 1 DO
-			 	in := module.allSections.GetSection(i);
-			 	in(IntermediateCode.Section).EnableComments(trace);
-		 		IF in.type = Sections.InlineCodeSection THEN
-		 			Basic.SegmentedNameToString(in.name, name);
-			 		out := ResolvedSection(in(IntermediateCode.Section));
-			 		cg.dump := out.comments;
-		 			SetInstructionWidth(out.os.unit);
-			 		cg.Section(in(IntermediateCode.Section), out);  (*compilation*)
-			 		IF in.symbol # NIL THEN
-				 		procedure := in.symbol(SyntaxTree.Procedure);
-				 		procedure.procedureScope.body.code.SetBinaryCode(out.os.bits);
-				 	END;
-			 	END
-		 	END;
+			cg.SetModule(module);
+			cg.dump := dump;
+
+			FOR i := 0 TO module.allSections.Length() - 1 DO
+				in := module.allSections.GetSection(i);
+				in(IntermediateCode.Section).EnableComments(trace);
+				IF in.type = Sections.InlineCodeSection THEN
+					Basic.SegmentedNameToString(in.name, name);
+					out := ResolvedSection(in(IntermediateCode.Section));
+					cg.dump := out.comments;
+					SetInstructionWidth(out.os.unit);
+					cg.Section(in(IntermediateCode.Section), out);  (*compilation*)
+					IF in.symbol # NIL THEN
+						procedure := in.symbol(SyntaxTree.Procedure);
+						procedure.procedureScope.body.code.SetBinaryCode(out.os.bits);
+					END;
+				END
+			END;
 
 
 			initialSectionCount := 0;
 			initialSectionCount := 0;
-		 	REPEAT
-		 		j := initialSectionCount;
-		 	 	initialSectionCount := module.allSections.Length() ;
-
-			 	FOR i := j TO initialSectionCount - 1 DO
-			 		in := module.allSections.GetSection(i);
-			 		IF (in.type # Sections.InlineCodeSection) (*& (in(IntermediateCode.Section).resolved = NIL) *) THEN
-				 		out := ResolvedSection(in(IntermediateCode.Section));
-			 			SetInstructionWidth(out.os.unit);
-				 		cg.Section(in(IntermediateCode.Section),out);
-			 		END
-			 	END
+			REPEAT
+				j := initialSectionCount;
+				initialSectionCount := module.allSections.Length() ;
+
+				FOR i := j TO initialSectionCount - 1 DO
+					in := module.allSections.GetSection(i);
+					IF (in.type # Sections.InlineCodeSection) (*& (in(IntermediateCode.Section).resolved = NIL) *) THEN
+						out := ResolvedSection(in(IntermediateCode.Section));
+						SetInstructionWidth(out.os.unit);
+						cg.Section(in(IntermediateCode.Section),out);
+					END
+				END
 			UNTIL initialSectionCount = module.allSections.Length(); (* process remaining sections that have been added during traversal of sections *)
 			UNTIL initialSectionCount = module.allSections.Length(); (* process remaining sections that have been added during traversal of sections *)
 
 
 			(*
 			(*
-		 	FOR i := 0 TO module.allSections.Length() - 1 DO
-			 	in := module.allSections.GetSection(i);
-			 	IF ~in.IsExternal() THEN
-			 		IF in.type # Sections.InlineCodeSection THEN
-				 		Basic.SegmentedNameToString(in.name, name);
-				 		out := ResolvedSection(in(IntermediateCode.Section));
-				 		cg.Section(in(IntermediateCode.Section), out);
-			 		END
-			 	END;
-		 	END;
+			FOR i := 0 TO module.allSections.Length() - 1 DO
+				in := module.allSections.GetSection(i);
+				IF ~in.IsExternal() THEN
+					IF in.type # Sections.InlineCodeSection THEN
+						Basic.SegmentedNameToString(in.name, name);
+						out := ResolvedSection(in(IntermediateCode.Section));
+						cg.Section(in(IntermediateCode.Section), out);
+					END
+				END;
+			END;
 			*)
 			*)
 
 
-
-
-		 	FOR i := 0 TO module.allSections.Length() - 1 DO
-			 	in := module.allSections.GetSection(i);
-		 		PatchFixups(in(IntermediateCode.Section).resolved)
-		 	END;
+			FOR i := 0 TO module.allSections.Length() - 1 DO
+				in := module.allSections.GetSection(i);
+				PatchFixups(in(IntermediateCode.Section).resolved)
+			END;
 
 
 			IF cg.error THEN Error("", Basic.invalidPosition, Streams.Invalid,  "") END;
 			IF cg.error THEN Error("", Basic.invalidPosition, Streams.Invalid,  "") END;
 		END GenerateBinary;
 		END GenerateBinary;
@@ -2480,7 +2462,7 @@ TYPE
 		BEGIN
 		BEGIN
 
 
 			(*VAR and CONST sections go to the data memory, only code sections go to code memory
 			(*VAR and CONST sections go to the data memory, only code sections go to code memory
-			    Note that data memory has 32 bit words while code has standard 18.
+				Note that data memory has 32 bit words while code has standard 18.
 			*)
 			*)
 			IF in.bitsPerUnit # Sections.UnknownSize THEN
 			IF in.bitsPerUnit # Sections.UnknownSize THEN
 				unit :=  in.bitsPerUnit;
 				unit :=  in.bitsPerUnit;
@@ -2525,9 +2507,6 @@ TYPE
 		HALT(100);
 		HALT(100);
 	END Halt;
 	END Halt;
 
 
-
-
-
 	PROCEDURE Init;
 	PROCEDURE Init;
 	BEGIN
 	BEGIN
 		NEW(defaultInstructionSet,18); (*TODO: maybe it's better to have all these init functions outside of instruction set object?*)
 		NEW(defaultInstructionSet,18); (*TODO: maybe it's better to have all these init functions outside of instruction set object?*)
@@ -2544,5 +2523,4 @@ BEGIN
 	Init;
 	Init;
 END FoxTRMBackend.
 END FoxTRMBackend.
 
 
-
 System.FreeDownTo FoxTRMBackend  ~
 System.FreeDownTo FoxTRMBackend  ~

+ 23 - 52
source/FoxTRMInstructionSet.Mod

@@ -8,7 +8,7 @@ CONST
 	maxMnemonicNameLength=8;
 	maxMnemonicNameLength=8;
 	maxNumberInstructions=100;
 	maxNumberInstructions=100;
 
 
-	(* 	mnemonics , unsorted
+	(*	mnemonics , unsorted
 		FoxProgTools.Enum -e -l=8
 		FoxProgTools.Enum -e -l=8
 		opMOV opNOT
 		opMOV opNOT
 		opADD opFADD
 		opADD opFADD
@@ -22,7 +22,6 @@ CONST
 		~
 		~
 	*)
 	*)
 
 
-
 	(*Variable instruction width related. All other bitcaounts derived.*)
 	(*Variable instruction width related. All other bitcaounts derived.*)
 	(*instructionW=24;*) (*Number of bits an instruction word holds. default 18*)
 	(*instructionW=24;*) (*Number of bits an instruction word holds. default 18*)
 	regselW=3; (*number of bits to select a register. default 3*)
 	regselW=3; (*number of bits to select a register. default 3*)
@@ -36,7 +35,7 @@ CONST
 	opBLT*= 32; opBGT*= 33; opBLE*= 34; opBT*= 35; opBF*= 36; opBZS*= 37; opBZC*= 38; opBCS*= 39;
 	opBLT*= 32; opBGT*= 33; opBLE*= 34; opBT*= 35; opBF*= 36; opBZS*= 37; opBZC*= 38; opBCS*= 39;
 	opBCC*= 40; opBNS*= 41; opBNC*= 42; opBVS*= 43; opBVC*= 44; opHADD*= 45; opFHADD*= 46; numberMnemonics*= 47;
 	opBCC*= 40; opBNS*= 41; opBNC*= 42; opBVS*= 43; opBVC*= 44; opHADD*= 45; opFHADD*= 46; numberMnemonics*= 47;
 
 
-	(* 	operand format types *)
+	(*	operand format types *)
 	None*=-1; (* no operand *)
 	None*=-1; (* no operand *)
 	Rd=0; (* destination register,  encoded at bits 11..13  *)
 	Rd=0; (* destination register,  encoded at bits 11..13  *)
 	Rs=1; (* source register,  encoded at bits 0..2 *)
 	Rs=1; (* source register,  encoded at bits 0..2 *)
@@ -48,11 +47,6 @@ CONST
 	MemRegImm7=7; (* memory operand of the form  [reg +imm] with 7 bit immediate, encoded at reg = 0..2, imm= 3..9  *)
 	MemRegImm7=7; (* memory operand of the form  [reg +imm] with 7 bit immediate, encoded at reg = 0..2, imm= 3..9  *)
 	VRd0=8; (* vector register, being restricted to register number 0 *)
 	VRd0=8; (* vector register, being restricted to register number 0 *)
 
 
-
-
-
-
-
 	ZeroRegister* = 7;
 	ZeroRegister* = 7;
 
 
 	(* operand types *)
 	(* operand types *)
@@ -107,7 +101,6 @@ TYPE
 		op1-, op2-: Operand;
 		op1-, op2-: Operand;
 	END;
 	END;
 
 
-
 	InstructionSet *=OBJECT
 	InstructionSet *=OBJECT
 		VAR mnemonics-: ARRAY numberMnemonics OF Mnemonic;
 		VAR mnemonics-: ARRAY numberMnemonics OF Mnemonic;
 		mnemonicsSorted-: ARRAY numberMnemonics OF NumberedName;
 		mnemonicsSorted-: ARRAY numberMnemonics OF NumberedName;
@@ -121,7 +114,6 @@ TYPE
 		ImmediateFixupBits-: LONGINT;
 		ImmediateFixupBits-: LONGINT;
 		MemoryOffsetFixupBits-: LONGINT;
 		MemoryOffsetFixupBits-: LONGINT;
 
 
-
 		PROCEDURE & InitInstructionSet * (instructionWidth: LONGINT);
 		PROCEDURE & InitInstructionSet * (instructionWidth: LONGINT);
 		BEGIN
 		BEGIN
 			ASSERT(instructionWidth>0);
 			ASSERT(instructionWidth>0);
@@ -530,7 +522,6 @@ TYPE
 			mnemonics[alias].firstInstructionFormat := mnemonics[number].firstInstructionFormat;
 			mnemonics[alias].firstInstructionFormat := mnemonics[number].firstInstructionFormat;
 		END AddAlias;
 		END AddAlias;
 
 
-
 		PROCEDURE EndMnemonic;
 		PROCEDURE EndMnemonic;
 		BEGIN
 		BEGIN
 			mnemonics[curMnemonic].lastInstructionFormat := numberInstructionFormats-1;
 			mnemonics[curMnemonic].lastInstructionFormat := numberInstructionFormats-1;
@@ -593,7 +584,6 @@ TYPE
 			oooo ddd 1 xxxxxxxsss
 			oooo ddd 1 xxxxxxxsss
 		*)
 		*)
 
 
-
 		isimmP:=instructionW-1-opcodeW-regselW; (*18bit inW=> bit 10. If this bit is NOT set, there is an immediate.*)
 		isimmP:=instructionW-1-opcodeW-regselW; (*18bit inW=> bit 10. If this bit is NOT set, there is an immediate.*)
 		isfloatP:=isimmP-2; (*18 bit insW => bit 8*)
 		isfloatP:=isimmP-2; (*18 bit insW => bit 8*)
 		isvecP:=isimmP-1; (*18 bit insW=> bit 9*)
 		isvecP:=isimmP-1; (*18 bit insW=> bit 9*)
@@ -625,8 +615,8 @@ TYPE
 		currOpCode:=makeOpcode(1);
 		currOpCode:=makeOpcode(1);
 		AddMnemonic(opNOT, "NOT");
 		AddMnemonic(opNOT, "NOT");
 		AddInstruction(currOpCode,						{isimmP}+opcodeP, Rd, Imm10,{});
 		AddInstruction(currOpCode,						{isimmP}+opcodeP, Rd, Imm10,{});
-		AddInstruction({isimmP}+currOpCode, 			capabilityP+opcodeP, Rd, Rs,{});
-		AddInstruction({isimmP,isfloatP}+currOpCode, 	capabilityP+opcodeP, VRd, VRs,{Global.VectorCapability});
+		AddInstruction({isimmP}+currOpCode,			capabilityP+opcodeP, Rd, Rs,{});
+		AddInstruction({isimmP,isfloatP}+currOpCode,	capabilityP+opcodeP, VRd, VRs,{Global.VectorCapability});
 		EndMnemonic;
 		EndMnemonic;
 
 
 		(* ADD: oooo = 0010 *)
 		(* ADD: oooo = 0010 *)
@@ -733,7 +723,7 @@ TYPE
 		EndMnemonic;
 		EndMnemonic;
 
 
 		(* BLR: oooo = 1011 *)
 		(* BLR: oooo = 1011 *)
-		(* BLR Rd, Rs 	<--> 	Rd := PC+1; PC := Rs *)
+		(* BLR Rd, Rs <--> Rd := PC+1; PC := Rs *)
 		AddMnemonic(opBLR, "BLR");
 		AddMnemonic(opBLR, "BLR");
 		AddInstruction(currOpCode+{isSpecialBR,isSpecialBR-1}, brModesP+opcodeP, Rd, Rs,{});
 		AddInstruction(currOpCode+{isSpecialBR,isSpecialBR-1}, brModesP+opcodeP, Rd, Rs,{});
 		EndMnemonic;
 		EndMnemonic;
@@ -779,29 +769,29 @@ TYPE
 			1111	FALSE	Never	BF
 			1111	FALSE	Never	BF
 		*)
 		*)
 		currOpCode:=makeOpcode(14);
 		currOpCode:=makeOpcode(14);
-		AddMnemonic(opBEQ, "BEQ"); 	AddInstruction(currOpCode+makeCondition(0), opcodeP+brCondP, SignedImm10, None,{}); EndMnemonic;
-		AddMnemonic(opBNE, "BNE"); 	AddInstruction(currOpCode+makeCondition(1), opcodeP+brCondP, SignedImm10, None,{}); EndMnemonic;
+		AddMnemonic(opBEQ, "BEQ");	AddInstruction(currOpCode+makeCondition(0), opcodeP+brCondP, SignedImm10, None,{}); EndMnemonic;
+		AddMnemonic(opBNE, "BNE");	AddInstruction(currOpCode+makeCondition(1), opcodeP+brCondP, SignedImm10, None,{}); EndMnemonic;
 
 
-		AddMnemonic(opBAE, "BAE");  	AddInstruction(currOpCode+makeCondition(2), opcodeP+brCondP, SignedImm10, None,{}); EndMnemonic;
-		AddMnemonic(opBB, "BB");      	AddInstruction(currOpCode+makeCondition(3), opcodeP+brCondP, SignedImm10, None,{}); EndMnemonic;
+		AddMnemonic(opBAE, "BAE");	AddInstruction(currOpCode+makeCondition(2), opcodeP+brCondP, SignedImm10, None,{}); EndMnemonic;
+		AddMnemonic(opBB, "BB");	AddInstruction(currOpCode+makeCondition(3), opcodeP+brCondP, SignedImm10, None,{}); EndMnemonic;
 
 
-		AddMnemonic(opBN, "BN");     	AddInstruction(currOpCode+makeCondition(4), opcodeP+brCondP, SignedImm10, None,{}); EndMnemonic;
-		AddMnemonic(opBNN, "BNN"); 	AddInstruction(currOpCode+makeCondition(5), opcodeP+brCondP, SignedImm10, None,{}); EndMnemonic;
+		AddMnemonic(opBN, "BN");	AddInstruction(currOpCode+makeCondition(4), opcodeP+brCondP, SignedImm10, None,{}); EndMnemonic;
+		AddMnemonic(opBNN, "BNN");	AddInstruction(currOpCode+makeCondition(5), opcodeP+brCondP, SignedImm10, None,{}); EndMnemonic;
 
 
-		AddMnemonic(opBO, "BO");     	AddInstruction(currOpCode+makeCondition(6), opcodeP+brCondP, SignedImm10, None,{}); EndMnemonic;
-		AddMnemonic(opBNO, "BNO"); 	AddInstruction(currOpCode+makeCondition(7), opcodeP+brCondP, SignedImm10, None,{}); EndMnemonic;
+		AddMnemonic(opBO, "BO");	AddInstruction(currOpCode+makeCondition(6), opcodeP+brCondP, SignedImm10, None,{}); EndMnemonic;
+		AddMnemonic(opBNO, "BNO");	AddInstruction(currOpCode+makeCondition(7), opcodeP+brCondP, SignedImm10, None,{}); EndMnemonic;
 
 
-		AddMnemonic(opBA, "BA"); 		AddInstruction(currOpCode+makeCondition(8), opcodeP+brCondP, SignedImm10, None,{}); EndMnemonic;
-		AddMnemonic(opBBE, "BBE"); 	AddInstruction(currOpCode+makeCondition(9), opcodeP+brCondP, SignedImm10, None,{}); EndMnemonic;
+		AddMnemonic(opBA, "BA");		AddInstruction(currOpCode+makeCondition(8), opcodeP+brCondP, SignedImm10, None,{}); EndMnemonic;
+		AddMnemonic(opBBE, "BBE");	AddInstruction(currOpCode+makeCondition(9), opcodeP+brCondP, SignedImm10, None,{}); EndMnemonic;
 
 
-		AddMnemonic(opBGE, "BGE"); 	AddInstruction(currOpCode+makeCondition(10), opcodeP+brCondP, SignedImm10, None,{}); EndMnemonic;
-		AddMnemonic(opBLT, "BLT"); 	AddInstruction(currOpCode+makeCondition(11), opcodeP+brCondP, SignedImm10, None,{}); EndMnemonic;
+		AddMnemonic(opBGE, "BGE");	AddInstruction(currOpCode+makeCondition(10), opcodeP+brCondP, SignedImm10, None,{}); EndMnemonic;
+		AddMnemonic(opBLT, "BLT");	AddInstruction(currOpCode+makeCondition(11), opcodeP+brCondP, SignedImm10, None,{}); EndMnemonic;
 
 
-		AddMnemonic(opBGT, "BGT"); 	AddInstruction(currOpCode+makeCondition(12), opcodeP+brCondP, SignedImm10, None,{}); EndMnemonic;
-		AddMnemonic(opBLE, "BLE"); 	AddInstruction(currOpCode+makeCondition(13), opcodeP+brCondP, SignedImm10, None,{}); EndMnemonic;
+		AddMnemonic(opBGT, "BGT");	AddInstruction(currOpCode+makeCondition(12), opcodeP+brCondP, SignedImm10, None,{}); EndMnemonic;
+		AddMnemonic(opBLE, "BLE");	AddInstruction(currOpCode+makeCondition(13), opcodeP+brCondP, SignedImm10, None,{}); EndMnemonic;
 
 
-		AddMnemonic(opBT, "BT"); 		AddInstruction(currOpCode+makeCondition(14), opcodeP+brCondP, SignedImm10, None,{}); EndMnemonic;
-		AddMnemonic(opBF, "BF"); 		AddInstruction(currOpCode+makeCondition(15), opcodeP+brCondP, SignedImm10, None,{}); EndMnemonic;
+		AddMnemonic(opBT, "BT");		AddInstruction(currOpCode+makeCondition(14), opcodeP+brCondP, SignedImm10, None,{}); EndMnemonic;
+		AddMnemonic(opBF, "BF");		AddInstruction(currOpCode+makeCondition(15), opcodeP+brCondP, SignedImm10, None,{}); EndMnemonic;
 
 
 		Inverse(opBEQ, opBNE);
 		Inverse(opBEQ, opBNE);
 		Inverse(opBAE, opBB);
 		Inverse(opBAE, opBB);
@@ -821,19 +811,14 @@ TYPE
 		AddAlias(opBVS,opBO,"BVS");
 		AddAlias(opBVS,opBO,"BVS");
 		AddAlias(opBVC,opBNO,"BVC");
 		AddAlias(opBVC,opBNO,"BVC");
 
 
-
-
 		(* BL: 1111 nnnnnnnnnnnnnn *)
 		(* BL: 1111 nnnnnnnnnnnnnn *)
 		currOpCode:=makeOpcode(15);
 		currOpCode:=makeOpcode(15);
 		AddMnemonic(opBL, "BL");
 		AddMnemonic(opBL, "BL");
 		AddInstruction(currOpCode, opcodeP, Imm14, None,{});
 		AddInstruction(currOpCode, opcodeP, Imm14, None,{});
 		EndMnemonic;
 		EndMnemonic;
 
 
-
-
 		SortMnemonics(0, numberMnemonics-1);
 		SortMnemonics(0, numberMnemonics-1);
 
 
-
 		IF checkMnemonic THEN CheckMnemonics END;
 		IF checkMnemonic THEN CheckMnemonics END;
 	END InitInstructions;
 	END InitInstructions;
 
 
@@ -933,7 +918,6 @@ TYPE
 			DumpOperand(w, op);
 			DumpOperand(w, op);
 		END DumpOp;
 		END DumpOp;
 
 
-
 	BEGIN
 	BEGIN
 		IF instruction.format = None THEN
 		IF instruction.format = None THEN
 			w.String(" no format")
 			w.String(" no format")
@@ -964,8 +948,8 @@ TYPE
 			CASE type OF
 			CASE type OF
 				|Rd: context.out.String("Rd")
 				|Rd: context.out.String("Rd")
 				|Rs: context.out.String("Rs")
 				|Rs: context.out.String("Rs")
-			     |Imm10: context.out.String("imm10");
-			     |SignedImm10: context.out.String("SignedImm10");
+				|Imm10: context.out.String("imm10");
+				|SignedImm10: context.out.String("SignedImm10");
 				|Imm14: context.out.String("imm14");
 				|Imm14: context.out.String("imm14");
 				|MemRegImm7: context.out.String("MemRegImm7");
 				|MemRegImm7: context.out.String("MemRegImm7");
 			ELSE
 			ELSE
@@ -1003,11 +987,8 @@ TYPE
 		END;
 		END;
 	END DumpInstructionFormats;
 	END DumpInstructionFormats;
 
 
-
-
 	END InstructionSet;
 	END InstructionSet;
 
 
-
 	PROCEDURE Hex(ch: CHAR): LONGINT;
 	PROCEDURE Hex(ch: CHAR): LONGINT;
 	BEGIN
 	BEGIN
 		IF (ch <= 'F') & (ch >= 'A') THEN RETURN ORD(ch)-ORD('A')+10
 		IF (ch <= 'F') & (ch >= 'A') THEN RETURN ORD(ch)-ORD('A')+10
@@ -1026,8 +1007,6 @@ TYPE
 		NEW(r, file, 0);
 		NEW(r, file, 0);
 		NEW(bitSet,0);
 		NEW(bitSet,0);
 
 
-
-
 		WHILE r.Available()>0 DO
 		WHILE r.Available()>0 DO
 			r.Ln(line);
 			r.Ln(line);
 			val:=0;
 			val:=0;
@@ -1126,7 +1105,6 @@ TYPE
 		END;
 		END;
 	END Disassemble;
 	END Disassemble;
 
 
-
 VAR
 VAR
 	decodeInstance: InstructionSet;
 	decodeInstance: InstructionSet;
 BEGIN
 BEGIN
@@ -1137,13 +1115,6 @@ System.FreeDownTo FoxTRMInstructionSet ~
 FoxTRMInstructionSet.DumpInstructionFormats -s ~
 FoxTRMInstructionSet.DumpInstructionFormats -s ~
 FoxTRMInstructionSet.Test ~
 FoxTRMInstructionSet.Test ~
 
 
-
-
-
-
-
-
 FoxTRMInstructionSet.Disassemble disastest.mem ~
 FoxTRMInstructionSet.Disassemble disastest.mem ~
 
 
 FoxTRMInstructionSet.Disassemble ins.mem ~
 FoxTRMInstructionSet.Disassemble ins.mem ~
-

+ 0 - 26
source/FoxTRMTools.Mod

@@ -170,7 +170,6 @@ IMPORT Files,Commands,Options,Strings,Basic := FoxBasic, Diagnostics, BitSets,Ob
 		RETURN TRUE
 		RETURN TRUE
 	END SplitColumns;
 	END SplitColumns;
 
 
-
 	PROCEDURE DoSplitFiles*(CONST source, dest, extension: ARRAY OF CHAR; blocks, blockSize: LONGINT; verbose,strided,patchSpartan6: BOOLEAN; diagnostics: Diagnostics.Diagnostics): BOOLEAN;
 	PROCEDURE DoSplitFiles*(CONST source, dest, extension: ARRAY OF CHAR; blocks, blockSize: LONGINT; verbose,strided,patchSpartan6: BOOLEAN; diagnostics: Diagnostics.Diagnostics): BOOLEAN;
 	VAR line: LONGINT; fileName: Files.FileName; oldFile: Files.File;
 	VAR line: LONGINT; fileName: Files.FileName; oldFile: Files.File;
 		newFiles: POINTER TO ARRAY OF Files.File;
 		newFiles: POINTER TO ARRAY OF Files.File;
@@ -187,8 +186,6 @@ IMPORT Files,Commands,Options,Strings,Basic := FoxBasic, Diagnostics, BitSets,Ob
 			Files.JoinExtension(fileName,extension,fileName);
 			Files.JoinExtension(fileName,extension,fileName);
 		END GetFileName;
 		END GetFileName;
 
 
-
-
 	BEGIN
 	BEGIN
 
 
 		TRACE(source);
 		TRACE(source);
@@ -245,7 +242,6 @@ IMPORT Files,Commands,Options,Strings,Basic := FoxBasic, Diagnostics, BitSets,Ob
 		RETURN TRUE
 		RETURN TRUE
 	END DoSplitFiles;
 	END DoSplitFiles;
 
 
-
 	PROCEDURE SplitFiles* (context: Commands.Context);
 	PROCEDURE SplitFiles* (context: Commands.Context);
 	VAR options: Options.Options;
 	VAR options: Options.Options;
 		sourceName, name, extension: Files.FileName;
 		sourceName, name, extension: Files.FileName;
@@ -305,7 +301,6 @@ IMPORT Files,Commands,Options,Strings,Basic := FoxBasic, Diagnostics, BitSets,Ob
 		END;
 		END;
 	END SplitColumnsCmd;
 	END SplitColumnsCmd;
 
 
-
 	PROCEDURE CompareFiles*(context: Commands.Context);
 	PROCEDURE CompareFiles*(context: Commands.Context);
 	VAR f1,f2,f3: Files.File; name1, name2, matrixname: Files.FileName; r1, r2: Files.Reader;  x,y: ARRAY 32 OF CHAR; i: LONGINT; line1: LONGINT;
 	VAR f1,f2,f3: Files.File; name1, name2, matrixname: Files.FileName; r1, r2: Files.Reader;  x,y: ARRAY 32 OF CHAR; i: LONGINT; line1: LONGINT;
 		matrix: ARRAY 16 OF ARRAY 16 OF LONGINT; j: LONGINT; p1, p2: LONGINT; writer: Files.Writer;
 		matrix: ARRAY 16 OF ARRAY 16 OF LONGINT; j: LONGINT; p1, p2: LONGINT; writer: Files.Writer;
@@ -340,7 +335,6 @@ IMPORT Files,Commands,Options,Strings,Basic := FoxBasic, Diagnostics, BitSets,Ob
 				END;
 				END;
 				INC(line1);
 				INC(line1);
 
 
-
 				(*
 				(*
 				IF (line1 MOD 512 = 480)  THEN
 				IF (line1 MOD 512 = 480)  THEN
 					context.out.Int(line1,1); context.out.String(":");
 					context.out.Int(line1,1); context.out.String(":");
@@ -385,7 +379,6 @@ IMPORT Files,Commands,Options,Strings,Basic := FoxBasic, Diagnostics, BitSets,Ob
 				*)
 				*)
 			END;
 			END;
 
 
-
 			FOR i := 0 TO 15 DO
 			FOR i := 0 TO 15 DO
 			FOR j := 0 TO 15 DO
 			FOR j := 0 TO 15 DO
 				writer.Int(matrix[i,j],1); writer.String(" ");
 				writer.Int(matrix[i,j],1); writer.String(" ");
@@ -456,7 +449,6 @@ IMPORT Files,Commands,Options,Strings,Basic := FoxBasic, Diagnostics, BitSets,Ob
 	END DeleteFiles;
 	END DeleteFiles;
 	*)
 	*)
 
 
-
 END FoxTRMTools.
 END FoxTRMTools.
 
 
 FoxTRMTools.Test ~
 FoxTRMTools.Test ~
@@ -475,7 +467,6 @@ oc/TRM.Runtime.Mod
 oc/TRM.TestNet.Mdf
 oc/TRM.TestNet.Mdf
 ~
 ~
 
 
-
 FoxAVSP6LX75T.ReadSpecification TestNet ~
 FoxAVSP6LX75T.ReadSpecification TestNet ~
 
 
 FoxTRMTools.BuildHardware -p="AVSP6LX75T" -f="TestNet" ~
 FoxTRMTools.BuildHardware -p="AVSP6LX75T" -f="TestNet" ~
@@ -490,7 +481,6 @@ PET.Open data.mem ~
 PET.Open data0.mem ~
 PET.Open data0.mem ~
 PET.Open data1.mem ~
 PET.Open data1.mem ~
 
 
-
 FoxTRMTools.GenerateTestFile test.code ~
 FoxTRMTools.GenerateTestFile test.code ~
 FoxTRMTools.GenerateTestFile --value=010H test.code ~
 FoxTRMTools.GenerateTestFile --value=010H test.code ~
 FoxTRMTools.GenerateTestFile --random test.code ~
 FoxTRMTools.GenerateTestFile --random test.code ~
@@ -502,8 +492,6 @@ PET.Open -e test.code test2.code ~
 
 
 FoxTRMTools.CompareFiles test.code test2.code matrix.txt ~
 FoxTRMTools.CompareFiles test.code test2.code matrix.txt ~
 
 
-
-
 UARTPC.Open 6 ~
 UARTPC.Open 6 ~
 
 
 System.DoCommands
 System.DoCommands
@@ -516,7 +504,6 @@ FoxTRMTools.GenerateTestFile --sourceFile=bram.dat test.code ~
 PET.Open -e TestBRAM0con0code.mem test.code ~
 PET.Open -e TestBRAM0con0code.mem test.code ~
 FoxTRMTools.CompareFiles TestBRAM0con0code.mem test.code bram.mtx~
 FoxTRMTools.CompareFiles TestBRAM0con0code.mem test.code bram.mtx~
 
 
-
 FoxTRMTools.GenerateTestFile --random --size=4096 TestBRAM0con0code.mem ~
 FoxTRMTools.GenerateTestFile --random --size=4096 TestBRAM0con0code.mem ~
 FoxTRMTools.SplitFiles  --blockSize=512 --blocks=8 --patchSpartan6 TestBRAM0con0code.mem ~
 FoxTRMTools.SplitFiles  --blockSize=512 --blocks=8 --patchSpartan6 TestBRAM0con0code.mem ~
 WinApplications.Run "testbram.bat" ~
 WinApplications.Run "testbram.bat" ~
@@ -525,7 +512,6 @@ FoxTRMTools.GenerateTestFile --sourceFile=bram.dat test.code ~
 PET.Open -e TestBRAM0con0code.mem test.code ~
 PET.Open -e TestBRAM0con0code.mem test.code ~
 FoxTRMTools.CompareFiles TestBRAM0con0code.mem test.code bram.mtx~
 FoxTRMTools.CompareFiles TestBRAM0con0code.mem test.code bram.mtx~
 
 
-
 FoxTRMTools.GenerateTestFile --random --size=4096 TestBRAM0con0code.mem ~
 FoxTRMTools.GenerateTestFile --random --size=4096 TestBRAM0con0code.mem ~
 FoxTRMTools.SplitFiles  --blockSize=512 --blocks=8 --patchSpartan6 TestBRAM0con0code.mem ~
 FoxTRMTools.SplitFiles  --blockSize=512 --blocks=8 --patchSpartan6 TestBRAM0con0code.mem ~
 WinApplications.Run "testbram.bat" ~
 WinApplications.Run "testbram.bat" ~
@@ -534,7 +520,6 @@ FoxTRMTools.GenerateTestFile --sourceFile=bram.dat test.code ~
 PET.Open -e TestBRAM0con0code.mem test.code ~
 PET.Open -e TestBRAM0con0code.mem test.code ~
 FoxTRMTools.CompareFiles TestBRAM0con0code.mem test.code bram.mtx~
 FoxTRMTools.CompareFiles TestBRAM0con0code.mem test.code bram.mtx~
 
 
-
 FoxTRMTools.GenerateTestFile --random --size=4096 TestBRAM0con0code.mem ~
 FoxTRMTools.GenerateTestFile --random --size=4096 TestBRAM0con0code.mem ~
 FoxTRMTools.SplitFiles  --blockSize=512 --blocks=8 --patchSpartan6 TestBRAM0con0code.mem ~
 FoxTRMTools.SplitFiles  --blockSize=512 --blocks=8 --patchSpartan6 TestBRAM0con0code.mem ~
 WinApplications.Run "testbram.bat" ~
 WinApplications.Run "testbram.bat" ~
@@ -543,7 +528,6 @@ FoxTRMTools.GenerateTestFile --sourceFile=bram.dat test.code ~
 PET.Open -e TestBRAM0con0code.mem test.code ~
 PET.Open -e TestBRAM0con0code.mem test.code ~
 FoxTRMTools.CompareFiles TestBRAM0con0code.mem test.code bram.mtx~
 FoxTRMTools.CompareFiles TestBRAM0con0code.mem test.code bram.mtx~
 
 
-
 FoxTRMTools.GenerateTestFile --random --size=4096 TestBRAM0con0code.mem ~
 FoxTRMTools.GenerateTestFile --random --size=4096 TestBRAM0con0code.mem ~
 FoxTRMTools.SplitFiles  --blockSize=512 --blocks=8 --patchSpartan6 TestBRAM0con0code.mem ~
 FoxTRMTools.SplitFiles  --blockSize=512 --blocks=8 --patchSpartan6 TestBRAM0con0code.mem ~
 WinApplications.Run "testbram.bat" ~
 WinApplications.Run "testbram.bat" ~
@@ -552,7 +536,6 @@ FoxTRMTools.GenerateTestFile --sourceFile=bram.dat test.code ~
 PET.Open -e TestBRAM0con0code.mem test.code ~
 PET.Open -e TestBRAM0con0code.mem test.code ~
 FoxTRMTools.CompareFiles TestBRAM0con0code.mem test.code bram.mtx~
 FoxTRMTools.CompareFiles TestBRAM0con0code.mem test.code bram.mtx~
 
 
-
 FoxTRMTools.GenerateTestFile --random --size=4096 TestBRAM0con0code.mem ~
 FoxTRMTools.GenerateTestFile --random --size=4096 TestBRAM0con0code.mem ~
 FoxTRMTools.SplitFiles  --blockSize=512 --blocks=8 --patchSpartan6 TestBRAM0con0code.mem ~
 FoxTRMTools.SplitFiles  --blockSize=512 --blocks=8 --patchSpartan6 TestBRAM0con0code.mem ~
 WinApplications.Run "testbram.bat" ~
 WinApplications.Run "testbram.bat" ~
@@ -561,7 +544,6 @@ FoxTRMTools.GenerateTestFile --sourceFile=bram.dat test.code ~
 PET.Open -e TestBRAM0con0code.mem test.code ~
 PET.Open -e TestBRAM0con0code.mem test.code ~
 FoxTRMTools.CompareFiles TestBRAM0con0code.mem test.code bram.mtx~
 FoxTRMTools.CompareFiles TestBRAM0con0code.mem test.code bram.mtx~
 
 
-
 FoxTRMTools.GenerateTestFile --random --size=4096 TestBRAM0con0code.mem ~
 FoxTRMTools.GenerateTestFile --random --size=4096 TestBRAM0con0code.mem ~
 FoxTRMTools.SplitFiles  --blockSize=512 --blocks=8 --patchSpartan6 TestBRAM0con0code.mem ~
 FoxTRMTools.SplitFiles  --blockSize=512 --blocks=8 --patchSpartan6 TestBRAM0con0code.mem ~
 WinApplications.Run "testbram.bat" ~
 WinApplications.Run "testbram.bat" ~
@@ -570,7 +552,6 @@ FoxTRMTools.GenerateTestFile --sourceFile=bram.dat test.code ~
 PET.Open -e TestBRAM0con0code.mem test.code ~
 PET.Open -e TestBRAM0con0code.mem test.code ~
 FoxTRMTools.CompareFiles TestBRAM0con0code.mem test.code bram.mtx~
 FoxTRMTools.CompareFiles TestBRAM0con0code.mem test.code bram.mtx~
 
 
-
 FoxTRMTools.GenerateTestFile --random --size=4096 TestBRAM0con0code.mem ~
 FoxTRMTools.GenerateTestFile --random --size=4096 TestBRAM0con0code.mem ~
 FoxTRMTools.SplitFiles  --blockSize=512 --blocks=8 --patchSpartan6 TestBRAM0con0code.mem ~
 FoxTRMTools.SplitFiles  --blockSize=512 --blocks=8 --patchSpartan6 TestBRAM0con0code.mem ~
 WinApplications.Run "testbram.bat" ~
 WinApplications.Run "testbram.bat" ~
@@ -579,7 +560,6 @@ FoxTRMTools.GenerateTestFile --sourceFile=bram.dat test.code ~
 PET.Open -e TestBRAM0con0code.mem test.code ~
 PET.Open -e TestBRAM0con0code.mem test.code ~
 FoxTRMTools.CompareFiles TestBRAM0con0code.mem test.code bram.mtx~
 FoxTRMTools.CompareFiles TestBRAM0con0code.mem test.code bram.mtx~
 
 
-
 FoxTRMTools.GenerateTestFile --random --size=4096 TestBRAM0con0code.mem ~
 FoxTRMTools.GenerateTestFile --random --size=4096 TestBRAM0con0code.mem ~
 FoxTRMTools.SplitFiles  --blockSize=512 --blocks=8 --patchSpartan6 TestBRAM0con0code.mem ~
 FoxTRMTools.SplitFiles  --blockSize=512 --blocks=8 --patchSpartan6 TestBRAM0con0code.mem ~
 WinApplications.Run "testbram.bat" ~
 WinApplications.Run "testbram.bat" ~
@@ -588,7 +568,6 @@ FoxTRMTools.GenerateTestFile --sourceFile=bram.dat test.code ~
 PET.Open -e TestBRAM0con0code.mem test.code ~
 PET.Open -e TestBRAM0con0code.mem test.code ~
 FoxTRMTools.CompareFiles TestBRAM0con0code.mem test.code bram.mtx~
 FoxTRMTools.CompareFiles TestBRAM0con0code.mem test.code bram.mtx~
 
 
-
 FoxTRMTools.GenerateTestFile --random --size=4096 TestBRAM0con0code.mem ~
 FoxTRMTools.GenerateTestFile --random --size=4096 TestBRAM0con0code.mem ~
 FoxTRMTools.SplitFiles  --blockSize=512 --blocks=8 --patchSpartan6 TestBRAM0con0code.mem ~
 FoxTRMTools.SplitFiles  --blockSize=512 --blocks=8 --patchSpartan6 TestBRAM0con0code.mem ~
 WinApplications.Run "testbram.bat" ~
 WinApplications.Run "testbram.bat" ~
@@ -597,13 +576,9 @@ FoxTRMTools.GenerateTestFile --sourceFile=bram.dat test.code ~
 PET.Open -e TestBRAM0con0code.mem test.code ~
 PET.Open -e TestBRAM0con0code.mem test.code ~
 FoxTRMTools.CompareFiles TestBRAM0con0code.mem test.code bram.mtx~
 FoxTRMTools.CompareFiles TestBRAM0con0code.mem test.code bram.mtx~
 
 
-
 System.Show "DONE!" ~
 System.Show "DONE!" ~
 ~
 ~
 
 
-
-
-
 System.DoCommands
 System.DoCommands
 
 
 FoxTRMTools.GenerateTestFile --random --size=512 TestBRAM0con0code.mem ~
 FoxTRMTools.GenerateTestFile --random --size=512 TestBRAM0con0code.mem ~
@@ -616,7 +591,6 @@ FoxTRMTools.CompareFiles TestBRAM0con0code.mem test.code bram.mtx~
 
 
 ~
 ~
 
 
-
 M = {};
 M = {};
 
 
 file =fopen('bram.mtx')
 file =fopen('bram.mtx')

+ 2 - 3
source/FoxTest.Mod

@@ -213,7 +213,6 @@ TYPE
 		RETURN reader
 		RETURN reader
 	END GetTextReader;
 	END GetTextReader;
 
 
-
 PROCEDURE RunTests(
 PROCEDURE RunTests(
 	text : Texts.Text;
 	text : Texts.Text;
 	CONST source: ARRAY OF CHAR;
 	CONST source: ARRAY OF CHAR;
@@ -249,11 +248,11 @@ END FoxTest.
 
 
 System.Free FoxTest TestSuite Versioning ~
 System.Free FoxTest TestSuite Versioning ~
 
 
-	FoxTest.Compile 	Oberon.Execution.Test Oberon.Execution.AMD64TestDiff ~
+	FoxTest.Compile	Oberon.Execution.Test Oberon.Execution.AMD64TestDiff ~
 
 
 	FoxTest.Compile	Oberon.Compilation.Test Oberon.Compilation.AMD64TestDiff ~
 	FoxTest.Compile	Oberon.Compilation.Test Oberon.Compilation.AMD64TestDiff ~
 
 
-	FoxTest.Compile 	MathVectors.Test MathVectors.Test.Diff ~
+	FoxTest.Compile	MathVectors.Test MathVectors.Test.Diff ~
 
 
 	FoxTest.Compile
 	FoxTest.Compile
 		--verbose
 		--verbose

+ 0 - 4
source/FoxTextualSymbolFile.Mod

@@ -97,8 +97,4 @@ TYPE
 		NEW(symbolFile); RETURN symbolFile
 		NEW(symbolFile); RETURN symbolFile
 	END Get;
 	END Get;
 
 
-
-
 END FoxTextualSymbolFile.
 END FoxTextualSymbolFile.
-
-

+ 8 - 10
source/FoxTranspilerBackend.Mod

@@ -477,7 +477,7 @@ TYPE
 
 
 			PrintIndent;
 			PrintIndent;
 			IF ~pragma THEN writer.String("/*") END;
 			IF ~pragma THEN writer.String("/*") END;
- 			i := 0; len := LEN (comment);
+			i := 0; len := LEN (comment);
 			LOOP
 			LOOP
 				ch := comment[i]; INC (i);
 				ch := comment[i]; INC (i);
 				IF (i = len) OR (ch = 0X) THEN EXIT END;
 				IF (i = len) OR (ch = 0X) THEN EXIT END;
@@ -629,21 +629,21 @@ TYPE
 				IF first THEN first := FALSE ELSE writer.Char (Comma); writer.Char (Space); END;
 				IF first THEN first := FALSE ELSE writer.Char (Comma); writer.Char (Space); END;
 				PrintArgument (arguments.GetExpression (index), parameter, FALSE);
 				PrintArgument (arguments.GetExpression (index), parameter, FALSE);
 				INC (index); DEC (count); parameter := parameter.nextParameter;
 				INC (index); DEC (count); parameter := parameter.nextParameter;
- 			END;
+			END;
 			WHILE (outerScope # NIL) & (outerScope IS SyntaxTree.ProcedureScope) DO
 			WHILE (outerScope # NIL) & (outerScope IS SyntaxTree.ProcedureScope) DO
- 				parameter := outerScope(SyntaxTree.ProcedureScope).ownerProcedure.type(SyntaxTree.ProcedureType).firstParameter;
- 				WHILE parameter # NIL DO
+				parameter := outerScope(SyntaxTree.ProcedureScope).ownerProcedure.type(SyntaxTree.ProcedureType).firstParameter;
+				WHILE parameter # NIL DO
 					IF first THEN first := FALSE ELSE writer.Char (Comma); writer.Char (Space); END;
 					IF first THEN first := FALSE ELSE writer.Char (Comma); writer.Char (Space); END;
 					PrintArgument (NIL, parameter, outerScope = currentProcedureScope);
 					PrintArgument (NIL, parameter, outerScope = currentProcedureScope);
 					parameter := parameter.nextParameter;
 					parameter := parameter.nextParameter;
 				END;
 				END;
-  				variable := outerScope.firstVariable;
- 				WHILE variable # NIL DO
+				variable := outerScope.firstVariable;
+				WHILE variable # NIL DO
 					IF first THEN first := FALSE ELSE writer.Char (Comma); writer.Char (Space); END;
 					IF first THEN first := FALSE ELSE writer.Char (Comma); writer.Char (Space); END;
 					PrintArgument (NIL, variable, outerScope = currentProcedureScope);
 					PrintArgument (NIL, variable, outerScope = currentProcedureScope);
 					variable := variable.nextVariable;
 					variable := variable.nextVariable;
 				END;
 				END;
- 				outerScope := outerScope.outerScope;
+				outerScope := outerScope.outerScope;
 			END;
 			END;
 			RETURN first;
 			RETURN first;
 		END PrintArguments;
 		END PrintArguments;
@@ -1278,7 +1278,7 @@ TYPE
 			| Scanner.Minus: IF expression.type.resolved IS SyntaxTree.SetType THEN writer.Char ('~') ELSE writer.Char ('-') END;
 			| Scanner.Minus: IF expression.type.resolved IS SyntaxTree.SetType THEN writer.Char ('~') ELSE writer.Char ('-') END;
 			| Scanner.Not: writer.Char ('!');
 			| Scanner.Not: writer.Char ('!');
 			END;
 			END;
-			 PrintExpression (expression.left);
+			PrintExpression (expression.left);
 		END VisitUnaryExpression;
 		END VisitUnaryExpression;
 
 
 		PROCEDURE VisitTypeGuardDesignator* (expression: SyntaxTree.TypeGuardDesignator);
 		PROCEDURE VisitTypeGuardDesignator* (expression: SyntaxTree.TypeGuardDesignator);
@@ -1662,5 +1662,3 @@ TextCompiler.CompileSelection -b=Transpiler --defineMain  ~
 
 
 FoxTest.Compile --options="-PC -G=Transpiler" --command="WinApplications.Run --hide cl /c Test.c" Oberon.Temp.Test Oberon.Temp.TranspilerTestDiff ~
 FoxTest.Compile --options="-PC -G=Transpiler" --command="WinApplications.Run --hide cl /c Test.c" Oberon.Temp.Test Oberon.Temp.TranspilerTestDiff ~
 FoxTest.Compile --options="--defineMain -PC -G=Transpiler" --command="WinApplications.Run --hide cl Test.c;WinApplications.Run --hide Test.exe" Oberon.Temp.Test Oberon.Temp.TranspilerTestDiff ~
 FoxTest.Compile --options="--defineMain -PC -G=Transpiler" --command="WinApplications.Run --hide cl Test.c;WinApplications.Run --hide Test.exe" Oberon.Temp.Test Oberon.Temp.TranspilerTestDiff ~
-
-

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно