|
@@ -9,7 +9,7 @@ MODULE FoxSyntaxTree; (** AUTHOR "fof & fn"; PURPOSE "Oberon Compiler: Abstra
|
|
|
**)
|
|
|
|
|
|
IMPORT
|
|
|
- Basic := FoxBasic, Scanner := FoxScanner, BitSets, Commands, StringPool, Strings(* , D := Debugging (* only for debuggging / counting *) *) ;
|
|
|
+ Basic := FoxBasic, Scanner := FoxScanner, BitSets, StringPool, Strings(* , D := Debugging (* only for debuggging / counting *) *) ;
|
|
|
|
|
|
CONST
|
|
|
(** general flags: used in statements, procedure types and symbols
|
|
@@ -48,7 +48,7 @@ CONST
|
|
|
SemiDynamic*=4;
|
|
|
|
|
|
(** node states, important for checker to avoid cycles *)
|
|
|
- Undefined*={}; BeingResolved*=1; Resolved*=2; FingerPrinted*=3; Warned*=4; RecursionFlag=31;
|
|
|
+ Undefined*={}; BeingResolved*=1; Resolved*=2; FingerPrinted*=3; Warned*=4;
|
|
|
|
|
|
(* context in which a range expression is used *)
|
|
|
ArrayIndex* = 0;
|
|
@@ -373,7 +373,6 @@ TYPE
|
|
|
END InitQualifiedIdentifier;
|
|
|
|
|
|
PROCEDURE GetName*(VAR name: Basic.SegmentedName);
|
|
|
- VAR s: ARRAY 64 OF CHAR;
|
|
|
BEGIN
|
|
|
Basic.InitSegmentedName(name);
|
|
|
IF prefix # invalidIdentifier THEN Basic.SuffixSegmentedName(name, prefix) END;
|
|
@@ -1385,6 +1384,7 @@ TYPE
|
|
|
direction-: LONGINT;
|
|
|
sizeExpression-: Expression; (* generated by parser *)
|
|
|
sizeInBits-: LONGINT; (* computed by checker *)
|
|
|
+ cellsAreObjects-: BOOLEAN;
|
|
|
|
|
|
PROCEDURE & InitPortType(position: LONGINT; direction: LONGINT; sizeExpression: Expression; scope: Scope);
|
|
|
BEGIN
|
|
@@ -1392,6 +1392,7 @@ TYPE
|
|
|
SELF.sizeExpression := sizeExpression;
|
|
|
SELF.direction := direction;
|
|
|
SELF.scope := scope;
|
|
|
+ cellsAreObjects := FALSE;
|
|
|
END InitPortType;
|
|
|
|
|
|
PROCEDURE SetSize*(size: LONGINT);
|
|
@@ -1401,7 +1402,12 @@ TYPE
|
|
|
PROCEDURE SetSizeExpression*(sizeExpression: Expression);
|
|
|
BEGIN SELF.sizeExpression := sizeExpression
|
|
|
END SetSizeExpression;
|
|
|
-
|
|
|
+
|
|
|
+ PROCEDURE SetCellsAreObjects*(b: BOOLEAN);
|
|
|
+ BEGIN
|
|
|
+ cellsAreObjects := b;
|
|
|
+ hasPointers := b;
|
|
|
+ END SetCellsAreObjects;
|
|
|
|
|
|
PROCEDURE SameType*(this: Type): BOOLEAN;
|
|
|
BEGIN RETURN (this IS PortType) & (this(PortType).direction = direction) & (this(PortType).sizeInBits = sizeInBits)
|
|
@@ -1410,6 +1416,10 @@ TYPE
|
|
|
PROCEDURE CompatibleTo*(to: Type): BOOLEAN;
|
|
|
BEGIN RETURN SameType(to)
|
|
|
END CompatibleTo;
|
|
|
+
|
|
|
+ PROCEDURE IsPointer(): BOOLEAN;
|
|
|
+ BEGIN RETURN cellsAreObjects;
|
|
|
+ END IsPointer;
|
|
|
|
|
|
PROCEDURE Accept*(v: Visitor);
|
|
|
VAR position: LONGINT;
|
|
@@ -4494,7 +4504,7 @@ TYPE
|
|
|
|
|
|
(** Enter a symbol in the scope, aplhabetically sorted, duplicate = TRUE if multiply identifier *)
|
|
|
PROCEDURE EnterSymbol*(symbol: Symbol; VAR duplicate: BOOLEAN);
|
|
|
- VAR p,q: Symbol; name,nextname: Scanner.StringType;
|
|
|
+ VAR p,q: Symbol;
|
|
|
BEGIN
|
|
|
ASSERT(symbol.nextSymbol = NIL,101); (* symbol may only be present in one scope at a time ! *)
|
|
|
ASSERT(symbol.scope = NIL,102);
|