2
0

FoxSyntaxTree.SymU 60 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681
  1. MODULE FoxSyntaxTree;
  2. IMPORT Basic := FoxBasic, Scanner := FoxScanner, BitSets, StringPool, Strings;
  3. CONST
  4. OberonCallingConvention* = 0;
  5. CCallingConvention* = 1;
  6. WinAPICallingConvention* = 2;
  7. InterruptCallingConvention* = 3;
  8. PlatformCallingConvention* = 4;
  9. UndefinedCallingConvention* = 5;
  10. InternalRead* = 0;
  11. InternalWrite* = 1;
  12. ProtectedRead* = 2;
  13. ProtectedWrite* = 3;
  14. PublicRead* = 4;
  15. PublicWrite* = 5;
  16. Hidden* = {};
  17. Internal* = {InternalRead, InternalWrite};
  18. Protected* = {ProtectedRead, ProtectedWrite};
  19. Public* = {PublicRead, PublicWrite};
  20. ReadOnly* = {InternalRead, ProtectedRead, PublicRead};
  21. ValueParameter* = 0;
  22. VarParameter* = 1;
  23. ConstParameter* = 2;
  24. InPort* = 3;
  25. OutPort* = 4;
  26. Static* = 1;
  27. Open* = 2;
  28. Tensor* = 3;
  29. SemiDynamic* = 4;
  30. Undefined* = {};
  31. BeingResolved* = 1;
  32. Resolved* = 2;
  33. FingerPrinted* = 3;
  34. Warned* = 4;
  35. ArrayIndex* = 0;
  36. SetElement* = 1;
  37. CaseGuard* = 2;
  38. FlagProcedureDelegate* = 0;
  39. FlagProcedureConstructor* = 1;
  40. FlagParameterVar* = 1;
  41. FlagParameterConst* = 2;
  42. TYPE
  43. Position* = Scanner.Position;
  44. SourceCode* = Scanner.StringType;
  45. BinaryCode* = BitSets.BitSet;
  46. String* = Scanner.StringType;
  47. IdentifierString* = Scanner.IdentifierString;
  48. CallingConvention* = LONGINT;
  49. Visitor* = OBJECT
  50. PROCEDURE ^ VisitType*(x: Type);
  51. PROCEDURE ^ VisitBasicType*(x: BasicType);
  52. PROCEDURE ^ VisitByteType*(x: ByteType);
  53. PROCEDURE ^ VisitAnyType*(x: AnyType);
  54. PROCEDURE ^ VisitObjectType*(x: ObjectType);
  55. PROCEDURE ^ VisitNilType*(x: NilType);
  56. PROCEDURE ^ VisitAddressType*(x: AddressType);
  57. PROCEDURE ^ VisitSizeType*(x: SizeType);
  58. PROCEDURE ^ VisitBooleanType*(x: BooleanType);
  59. PROCEDURE ^ VisitSetType*(x: SetType);
  60. PROCEDURE ^ VisitCharacterType*(x: CharacterType);
  61. PROCEDURE ^ VisitIntegerType*(x: IntegerType);
  62. PROCEDURE ^ VisitFloatType*(x: FloatType);
  63. PROCEDURE ^ VisitComplexType*(x: ComplexType);
  64. PROCEDURE ^ VisitQualifiedType*(x: QualifiedType);
  65. PROCEDURE ^ VisitStringType*(x: StringType);
  66. PROCEDURE ^ VisitEnumerationType*(x: EnumerationType);
  67. PROCEDURE ^ VisitRangeType*(x: RangeType);
  68. PROCEDURE ^ VisitArrayType*(x: ArrayType);
  69. PROCEDURE ^ VisitMathArrayType*(x: MathArrayType);
  70. PROCEDURE ^ VisitPointerType*(x: PointerType);
  71. PROCEDURE ^ VisitPortType*(x: PortType);
  72. PROCEDURE ^ VisitRecordType*(x: RecordType);
  73. PROCEDURE ^ VisitCellType*(x: CellType);
  74. PROCEDURE ^ VisitProcedureType*(x: ProcedureType);
  75. PROCEDURE ^ VType*(x: Type);
  76. PROCEDURE ^ VisitExpression*(x: Expression);
  77. PROCEDURE ^ VisitSet*(x: Set);
  78. PROCEDURE ^ VisitMathArrayExpression*(x: MathArrayExpression);
  79. PROCEDURE ^ VisitUnaryExpression*(x: UnaryExpression);
  80. PROCEDURE ^ VisitBinaryExpression*(x: BinaryExpression);
  81. PROCEDURE ^ VisitRangeExpression*(x: RangeExpression);
  82. PROCEDURE ^ VisitTensorRangeExpression*(x: TensorRangeExpression);
  83. PROCEDURE ^ VisitConversion*(x: Conversion);
  84. PROCEDURE ^ VisitDesignator*(x: Designator);
  85. PROCEDURE ^ VisitIdentifierDesignator*(x: IdentifierDesignator);
  86. PROCEDURE ^ VisitSelectorDesignator*(x: SelectorDesignator);
  87. PROCEDURE ^ VisitParameterDesignator*(x: ParameterDesignator);
  88. PROCEDURE ^ VisitArrowDesignator*(x: ArrowDesignator);
  89. PROCEDURE ^ VisitBracketDesignator*(x: BracketDesignator);
  90. PROCEDURE ^ VisitSymbolDesignator*(x: SymbolDesignator);
  91. PROCEDURE ^ VisitIndexDesignator*(x: IndexDesignator);
  92. PROCEDURE ^ VisitProcedureCallDesignator*(x: ProcedureCallDesignator);
  93. PROCEDURE ^ VisitStatementDesignator*(x: StatementDesignator);
  94. PROCEDURE ^ VisitBuiltinCallDesignator*(x: BuiltinCallDesignator);
  95. PROCEDURE ^ VisitTypeGuardDesignator*(x: TypeGuardDesignator);
  96. PROCEDURE ^ VisitDereferenceDesignator*(x: DereferenceDesignator);
  97. PROCEDURE ^ VisitSupercallDesignator*(x: SupercallDesignator);
  98. PROCEDURE ^ VisitSelfDesignator*(x: SelfDesignator);
  99. PROCEDURE ^ VisitResultDesignator*(x: ResultDesignator);
  100. PROCEDURE ^ VisitValue*(x: Value);
  101. PROCEDURE ^ VisitBooleanValue*(x: BooleanValue);
  102. PROCEDURE ^ VisitIntegerValue*(x: IntegerValue);
  103. PROCEDURE ^ VisitCharacterValue*(x: CharacterValue);
  104. PROCEDURE ^ VisitSetValue*(x: SetValue);
  105. PROCEDURE ^ VisitMathArrayValue*(x: MathArrayValue);
  106. PROCEDURE ^ VisitRealValue*(x: RealValue);
  107. PROCEDURE ^ VisitComplexValue*(x: ComplexValue);
  108. PROCEDURE ^ VisitStringValue*(x: StringValue);
  109. PROCEDURE ^ VisitNilValue*(x: NilValue);
  110. PROCEDURE ^ VisitEnumerationValue*(x: EnumerationValue);
  111. PROCEDURE ^ VExpression*(x: Expression);
  112. PROCEDURE ^ VisitSymbol*(x: Symbol);
  113. PROCEDURE ^ VisitModule*(x: Module);
  114. PROCEDURE ^ VisitTypeDeclaration*(x: TypeDeclaration);
  115. PROCEDURE ^ VisitConstant*(x: Constant);
  116. PROCEDURE ^ VisitVariable*(x: Variable);
  117. PROCEDURE ^ VisitParameter*(x: Parameter);
  118. PROCEDURE ^ VisitProperty*(x: Property);
  119. PROCEDURE ^ VisitProcedure*(x: Procedure);
  120. PROCEDURE ^ VisitBuiltin*(x: Builtin);
  121. PROCEDURE ^ VisitOperator*(x: Operator);
  122. PROCEDURE ^ VisitImport*(x: Import);
  123. PROCEDURE ^ VSymbol*(x: Symbol);
  124. PROCEDURE ^ VisitStatement*(x: Statement);
  125. PROCEDURE ^ VisitProcedureCallStatement*(x: ProcedureCallStatement);
  126. PROCEDURE ^ VisitAssignment*(x: Assignment);
  127. PROCEDURE ^ VisitCommunicationStatement*(x: CommunicationStatement);
  128. PROCEDURE ^ VisitIfStatement*(x: IfStatement);
  129. PROCEDURE ^ VisitWithStatement*(x: WithStatement);
  130. PROCEDURE ^ VisitCaseStatement*(x: CaseStatement);
  131. PROCEDURE ^ VisitWhileStatement*(x: WhileStatement);
  132. PROCEDURE ^ VisitRepeatStatement*(x: RepeatStatement);
  133. PROCEDURE ^ VisitForStatement*(x: ForStatement);
  134. PROCEDURE ^ VisitLoopStatement*(x: LoopStatement);
  135. PROCEDURE ^ VisitExitableBlock*(x: ExitableBlock);
  136. PROCEDURE ^ VisitExitStatement*(x: ExitStatement);
  137. PROCEDURE ^ VisitReturnStatement*(x: ReturnStatement);
  138. PROCEDURE ^ VisitAwaitStatement*(x: AwaitStatement);
  139. PROCEDURE ^ VisitStatementBlock*(x: StatementBlock);
  140. PROCEDURE ^ VisitCode*(x: Code);
  141. PROCEDURE ^ VStatement*(x: Statement);
  142. END Visitor;
  143. ArrayAccessOperators* = RECORD
  144. len*: Operator;
  145. generalRead*, generalWrite*: Operator;
  146. read*, write*: POINTER TO ARRAY OF Operator;
  147. END;
  148. FingerPrint* = RECORD
  149. shallow*, public*, private*: LONGINT;
  150. shallowAvailable*, deepAvailable*: BOOLEAN;
  151. END;
  152. Identifier* = Basic.String;
  153. QualifiedIdentifier* = OBJECT
  154. VAR
  155. prefix-, suffix-: Identifier;
  156. position-: Position;
  157. PROCEDURE ^ & InitQualifiedIdentifier(position: Position; prefix, suffix: Identifier);
  158. PROCEDURE ^ GetName*(VAR name: Basic.SegmentedName);
  159. END QualifiedIdentifier;
  160. Type* = OBJECT
  161. VAR
  162. typeDeclaration-: TypeDeclaration;
  163. scope-: Scope;
  164. resolved-: Type;
  165. position-, end-: Position;
  166. state-: SET;
  167. hasPointers-: BOOLEAN;
  168. fingerprint-: FingerPrint;
  169. isRealtime-: BOOLEAN;
  170. recursion: BOOLEAN;
  171. sizeInBits-: LONGINT;
  172. alignmentInBits-: LONGINT;
  173. PROCEDURE ^ & InitType*(position: Position);
  174. PROCEDURE ^ SetSize*(sizeInBits: LONGINT);
  175. PROCEDURE ^ SetAlignmentInBits*(alignmentInBits: LONGINT);
  176. PROCEDURE ^ End*(position: LONGINT);
  177. PROCEDURE ^ SetFingerPrint*(CONST fp: FingerPrint);
  178. PROCEDURE ^ SetState*(state: LONGINT);
  179. PROCEDURE ^ SetHasPointers*(has: BOOLEAN);
  180. PROCEDURE ^ RemoveState*(state: LONGINT);
  181. PROCEDURE ^ SetTypeDeclaration*(typeDeclaration: TypeDeclaration);
  182. PROCEDURE ^ SetScope*(scope: Scope);
  183. PROCEDURE ^ SetRealtime*(isRealtime: BOOLEAN);
  184. PROCEDURE ^ SameType*(this: Type): BOOLEAN;
  185. PROCEDURE ^ CompatibleTo*(to: Type): BOOLEAN;
  186. PROCEDURE ^ IsPointer*(): BOOLEAN;
  187. PROCEDURE ^ IsComposite*(): BOOLEAN;
  188. PROCEDURE ^ NeedsTrace*(): BOOLEAN;
  189. PROCEDURE ^ IsRecordType*(): BOOLEAN;
  190. END Type;
  191. BasicType* = OBJECT (Type)
  192. VAR
  193. name-: Identifier;
  194. PROCEDURE ^ & InitBasicType(CONST id: ARRAY OF CHAR; sizeInBits: LONGINT);
  195. PROCEDURE ^ SetName*(CONST id: ARRAY OF CHAR);
  196. PROCEDURE ^ SetTypeDeclaration*(typeDeclaration: TypeDeclaration);
  197. END BasicType;
  198. ObjectType* = OBJECT (BasicType)
  199. PROCEDURE ^ & InitObjectType(sizeInBits: LONGINT);
  200. PROCEDURE ^ SameType*(this: Type): BOOLEAN;
  201. PROCEDURE ^ CompatibleTo*(to: Type): BOOLEAN;
  202. PROCEDURE ^ IsPointer*(): BOOLEAN;
  203. END ObjectType;
  204. NilType* = OBJECT (BasicType)
  205. PROCEDURE ^ & InitNilType(sizeInBits: LONGINT);
  206. PROCEDURE ^ SameType*(this: Type): BOOLEAN;
  207. PROCEDURE ^ CompatibleTo*(to: Type): BOOLEAN;
  208. PROCEDURE ^ IsPointer*(): BOOLEAN;
  209. END NilType;
  210. AnyType* = OBJECT (BasicType)
  211. PROCEDURE ^ & InitAnyType(sizeInBits: LONGINT);
  212. PROCEDURE ^ SameType*(this: Type): BOOLEAN;
  213. PROCEDURE ^ CompatibleTo*(to: Type): BOOLEAN;
  214. PROCEDURE ^ IsPointer*(): BOOLEAN;
  215. END AnyType;
  216. ByteType* = OBJECT (BasicType)
  217. PROCEDURE ^ & InitByteType(sizeInBits: LONGINT);
  218. PROCEDURE ^ SameType*(this: Type): BOOLEAN;
  219. PROCEDURE ^ CompatibleTo*(to: Type): BOOLEAN;
  220. END ByteType;
  221. AddressType* = OBJECT (BasicType)
  222. PROCEDURE ^ & InitAddressType(sizeInBits: LONGINT);
  223. PROCEDURE ^ SameType*(this: Type): BOOLEAN;
  224. PROCEDURE ^ CompatibleTo*(to: Type): BOOLEAN;
  225. END AddressType;
  226. SizeType* = OBJECT (BasicType)
  227. PROCEDURE ^ & InitSizeType(sizeInBits: LONGINT);
  228. PROCEDURE ^ SameType*(this: Type): BOOLEAN;
  229. PROCEDURE ^ CompatibleTo*(to: Type): BOOLEAN;
  230. END SizeType;
  231. BooleanType* = OBJECT (BasicType)
  232. PROCEDURE ^ & InitBooleanType(sizeInBits: LONGINT);
  233. PROCEDURE ^ SameType*(this: Type): BOOLEAN;
  234. PROCEDURE ^ CompatibleTo*(to: Type): BOOLEAN;
  235. END BooleanType;
  236. SetType* = OBJECT (BasicType)
  237. PROCEDURE ^ & InitSetType(sizeInBits: LONGINT);
  238. PROCEDURE ^ SameType*(this: Type): BOOLEAN;
  239. PROCEDURE ^ CompatibleTo*(to: Type): BOOLEAN;
  240. END SetType;
  241. CharacterType* = OBJECT (BasicType)
  242. PROCEDURE ^ & InitCharacterType(sizeInBits: LONGINT);
  243. PROCEDURE ^ SameType*(this: Type): BOOLEAN;
  244. PROCEDURE ^ CompatibleTo*(to: Type): BOOLEAN;
  245. END CharacterType;
  246. RangeType* = OBJECT (BasicType)
  247. PROCEDURE ^ & InitRangeType(sizeInBits: LONGINT);
  248. PROCEDURE ^ SameType*(this: Type): BOOLEAN;
  249. PROCEDURE ^ CompatibleTo*(to: Type): BOOLEAN;
  250. PROCEDURE ^ IsComposite*(): BOOLEAN;
  251. END RangeType;
  252. NumberType* = OBJECT (BasicType)
  253. PROCEDURE ^ & InitNumberType(CONST name: ARRAY OF CHAR; sizeInBits: LONGINT);
  254. END NumberType;
  255. IntegerType* = OBJECT (NumberType)
  256. VAR
  257. signed-: BOOLEAN;
  258. PROCEDURE ^ & InitIntegerType(sizeInBits: LONGINT; signed: BOOLEAN);
  259. PROCEDURE ^ SameType*(this: Type): BOOLEAN;
  260. PROCEDURE ^ CompatibleTo*(to: Type): BOOLEAN;
  261. END IntegerType;
  262. FloatType* = OBJECT (NumberType)
  263. PROCEDURE ^ & InitFloatType(sizeInBits: LONGINT);
  264. PROCEDURE ^ SameType*(this: Type): BOOLEAN;
  265. PROCEDURE ^ CompatibleTo*(to: Type): BOOLEAN;
  266. END FloatType;
  267. ComplexType* = OBJECT (NumberType)
  268. VAR
  269. componentType-: Type;
  270. PROCEDURE ^ & InitComplexType(componentType: Type);
  271. PROCEDURE ^ SameType*(this: Type): BOOLEAN;
  272. PROCEDURE ^ CompatibleTo*(to: Type): BOOLEAN;
  273. PROCEDURE ^ IsComposite*(): BOOLEAN;
  274. END ComplexType;
  275. QualifiedType* = OBJECT (Type)
  276. VAR
  277. qualifiedIdentifier-: QualifiedIdentifier;
  278. PROCEDURE ^ & InitQualifiedType(position: Position; scope: Scope; qualifiedIdentifier: QualifiedIdentifier);
  279. PROCEDURE ^ SetResolved*(resolved: Type);
  280. PROCEDURE ^ SameType*(this: Type): BOOLEAN;
  281. PROCEDURE ^ CompatibleTo*(to: Type): BOOLEAN;
  282. PROCEDURE ^ IsPointer*(): BOOLEAN;
  283. PROCEDURE ^ IsComposite*(): BOOLEAN;
  284. PROCEDURE ^ NeedsTrace*(): BOOLEAN;
  285. PROCEDURE ^ IsRecordType*(): BOOLEAN;
  286. END QualifiedType;
  287. StringType* = OBJECT (Type)
  288. VAR
  289. length-: LONGINT;
  290. baseType-: Type;
  291. PROCEDURE ^ & InitStringType(position: Position; baseType: Type; length: LONGINT);
  292. PROCEDURE ^ SetLength*(length: LONGINT);
  293. PROCEDURE ^ SameType*(this: Type): BOOLEAN;
  294. PROCEDURE ^ CompatibleTo*(to: Type): BOOLEAN;
  295. PROCEDURE ^ IsComposite*(): BOOLEAN;
  296. END StringType;
  297. EnumerationType* = OBJECT (Type)
  298. VAR
  299. enumerationScope-: EnumerationScope;
  300. enumerationBase-: Type;
  301. rangeLowest-, rangeHighest-: Basic.Integer;
  302. PROCEDURE ^ & InitEnumerationType(position: Position; scope: Scope; enumerationScope: EnumerationScope);
  303. PROCEDURE ^ SetEnumerationBase*(base: Type);
  304. PROCEDURE ^ SetRange*(lowest, highest: Basic.Integer);
  305. PROCEDURE ^ Extends*(this: EnumerationType): BOOLEAN;
  306. PROCEDURE ^ SameType*(this: Type): BOOLEAN;
  307. PROCEDURE ^ CompatibleTo*(to: Type): BOOLEAN;
  308. END EnumerationType;
  309. ArrayType* = OBJECT (Type)
  310. VAR
  311. arrayBase-: Type;
  312. length-: Expression;
  313. staticLength-: LONGINT;
  314. form-: LONGINT;
  315. PROCEDURE ^ & InitArrayType(position: Position; scope: Scope; form: LONGINT);
  316. PROCEDURE ^ SetArrayBase*(type: Type);
  317. PROCEDURE ^ SetForm*(f: LONGINT);
  318. PROCEDURE ^ SetLength*(length: Expression);
  319. PROCEDURE ^ Child*(nr: LONGINT): Type;
  320. PROCEDURE ^ SameType*(this: Type): BOOLEAN;
  321. PROCEDURE ^ CompatibleTo*(to: Type): BOOLEAN;
  322. PROCEDURE ^ IsComposite*(): BOOLEAN;
  323. PROCEDURE ^ NeedsTrace*(): BOOLEAN;
  324. END ArrayType;
  325. MathArrayType* = OBJECT (Type)
  326. VAR
  327. modifiers-: Modifier;
  328. arrayBase-: Type;
  329. length-: Expression;
  330. staticLength-: LONGINT;
  331. staticIncrementInBits-: LONGINT;
  332. form-: LONGINT;
  333. isUnsafe-: BOOLEAN;
  334. PROCEDURE ^ & InitMathArrayType(position: Position; scope: Scope; form: LONGINT);
  335. PROCEDURE ^ SetModifiers*(m: Modifier);
  336. PROCEDURE ^ SetUnsafe*(unsafe: BOOLEAN);
  337. PROCEDURE ^ SetForm*(form: LONGINT);
  338. PROCEDURE ^ SetArrayBase*(type: Type);
  339. PROCEDURE ^ SetLength*(length: Expression);
  340. PROCEDURE ^ SetIncrement*(increment: LONGINT);
  341. PROCEDURE ^ SameType*(this: Type): BOOLEAN;
  342. PROCEDURE ^ CompatibleTo*(to: Type): BOOLEAN;
  343. PROCEDURE ^ ElementType*(): Type;
  344. PROCEDURE ^ Dimensionality*(): LONGINT;
  345. PROCEDURE ^ IsFullyDynamic*(): BOOLEAN;
  346. PROCEDURE ^ NeedsTrace*(): BOOLEAN;
  347. PROCEDURE ^ IsComposite*(): BOOLEAN;
  348. END MathArrayType;
  349. PointerType* = OBJECT (Type)
  350. VAR
  351. modifiers-: Modifier;
  352. pointerBase-: Type;
  353. isPlain-: BOOLEAN;
  354. isUnsafe-: BOOLEAN;
  355. isUntraced-: BOOLEAN;
  356. isDisposable-: BOOLEAN;
  357. isHidden-: BOOLEAN;
  358. PROCEDURE ^ & InitPointerType(position: Position; scope: Scope);
  359. PROCEDURE ^ SetHidden*(hidden: BOOLEAN);
  360. PROCEDURE ^ SetModifiers*(flags: Modifier);
  361. PROCEDURE ^ SetPointerBase*(type: Type);
  362. PROCEDURE ^ SetPlain*(plain: BOOLEAN);
  363. PROCEDURE ^ SetUnsafe*(unsafe: BOOLEAN);
  364. PROCEDURE ^ SetUntraced*(untraced: BOOLEAN);
  365. PROCEDURE ^ SetDisposable*(disposable: BOOLEAN);
  366. PROCEDURE ^ Extends*(this: Type): BOOLEAN;
  367. PROCEDURE ^ SameType*(this: Type): BOOLEAN;
  368. PROCEDURE ^ CompatibleTo*(to: Type): BOOLEAN;
  369. PROCEDURE ^ IsPointer*(): BOOLEAN;
  370. PROCEDURE ^ NeedsTrace*(): BOOLEAN;
  371. END PointerType;
  372. PortType* = OBJECT (Type)
  373. VAR
  374. direction-: LONGINT;
  375. sizeExpression-: Expression;
  376. sizeInBits-: LONGINT;
  377. cellsAreObjects-: BOOLEAN;
  378. PROCEDURE ^ & InitPortType(position: Position; direction: LONGINT; sizeExpression: Expression; scope: Scope);
  379. PROCEDURE ^ SetSize*(size: LONGINT);
  380. PROCEDURE ^ SetSizeExpression*(sizeExpression: Expression);
  381. PROCEDURE ^ SetCellsAreObjects*(b: BOOLEAN);
  382. PROCEDURE ^ SameType*(this: Type): BOOLEAN;
  383. PROCEDURE ^ CompatibleTo*(to: Type): BOOLEAN;
  384. PROCEDURE ^ IsPointer*(): BOOLEAN;
  385. END PortType;
  386. RecordType* = OBJECT (Type)
  387. VAR
  388. recordScope-: RecordScope;
  389. baseType-: Type;
  390. pointerType-: PointerType;
  391. modifiers-: Modifier;
  392. isObject-, isProtected: BOOLEAN;
  393. isAbstract-: BOOLEAN;
  394. PROCEDURE ^ & InitRecordType(position: Position; scope: Scope; recordScope: RecordScope);
  395. PROCEDURE ^ SetAbstract*(abstract: BOOLEAN);
  396. PROCEDURE ^ SetModifiers*(flag: Modifier);
  397. PROCEDURE ^ SetBaseType*(type: Type);
  398. PROCEDURE ^ SetPointerType*(pointerType: PointerType);
  399. PROCEDURE ^ IsObject*(isObject: BOOLEAN);
  400. PROCEDURE ^ IsActive*(): BOOLEAN;
  401. PROCEDURE ^ IsProtected*(): BOOLEAN;
  402. PROCEDURE ^ SetProtected*(protected: BOOLEAN);
  403. PROCEDURE ^ Level*(): LONGINT;
  404. PROCEDURE ^ GetBaseRecord*(): RecordType;
  405. PROCEDURE ^ Extends*(this: Type): BOOLEAN;
  406. PROCEDURE ^ SameType*(this: Type): BOOLEAN;
  407. PROCEDURE ^ CompatibleTo*(to: Type): BOOLEAN;
  408. PROCEDURE ^ IsComposite*(): BOOLEAN;
  409. PROCEDURE ^ NeedsTrace*(): BOOLEAN;
  410. PROCEDURE ^ IsRecordType*(): BOOLEAN;
  411. END RecordType;
  412. CellType* = OBJECT (Type)
  413. VAR
  414. firstParameter-, lastParameter-: Parameter;
  415. numberParameters-: LONGINT;
  416. firstProperty-, lastProperty-: Property;
  417. numberProperties: LONGINT;
  418. cellScope-: CellScope;
  419. isCellNet-: BOOLEAN;
  420. modifiers-: Modifier;
  421. baseType-: Type;
  422. PROCEDURE ^ & InitCellType(position: Position; scope: Scope; cellScope: CellScope);
  423. PROCEDURE ^ SetBaseType*(base: Type);
  424. PROCEDURE ^ GetBaseValueType*(): Type;
  425. PROCEDURE ^ GetBaseRecord*(): RecordType;
  426. PROCEDURE ^ AddParameter*(p: Parameter);
  427. PROCEDURE ^ AddProperty*(p: Property);
  428. PROCEDURE ^ FindParameter*(identifier: Identifier): Parameter;
  429. PROCEDURE ^ FindProperty*(identifier: Identifier): Property;
  430. PROCEDURE ^ SetModifiers*(flag: Modifier);
  431. PROCEDURE ^ IsCellNet*(t: BOOLEAN);
  432. PROCEDURE ^ SameType*(this: Type): BOOLEAN;
  433. PROCEDURE ^ CompatibleTo*(to: Type): BOOLEAN;
  434. PROCEDURE ^ IsComposite*(): BOOLEAN;
  435. END CellType;
  436. ProcedureType* = OBJECT (Type)
  437. VAR
  438. modifiers-: Modifier;
  439. returnType-: Type;
  440. returnTypeModifiers-: Modifier;
  441. hasUntracedReturn-: BOOLEAN;
  442. firstParameter-, lastParameter-: Parameter;
  443. numberParameters-: LONGINT;
  444. returnParameter-: Parameter;
  445. selfParameter-: Parameter;
  446. isDelegate-, isInterrupt-, noPAF-, noReturn-: BOOLEAN;
  447. pcOffset-: LONGINT;
  448. callingConvention-: CallingConvention;
  449. stackAlignment-: LONGINT;
  450. parametersOffset-: LONGINT;
  451. PROCEDURE ^ & InitProcedureType(position: Position; scope: Scope);
  452. PROCEDURE ^ SetNoPAF*(noPAF: BOOLEAN);
  453. PROCEDURE ^ SetNoReturn*(noReturn: BOOLEAN);
  454. PROCEDURE ^ SetPcOffset*(pcOffset: LONGINT);
  455. PROCEDURE ^ SetInterrupt*(isInterrupt: BOOLEAN);
  456. PROCEDURE ^ SetModifiers*(flags: Modifier);
  457. PROCEDURE ^ SetReturnTypeModifiers*(flags: Modifier);
  458. PROCEDURE ^ SetDelegate*(delegate: BOOLEAN);
  459. PROCEDURE ^ SetUntracedReturn*(untraced: BOOLEAN);
  460. PROCEDURE ^ SetStackAlignment*(alignment: LONGINT);
  461. PROCEDURE ^ SetParametersOffset*(ofs: LONGINT);
  462. PROCEDURE ^ SetReturnParameter*(parameter: Parameter);
  463. PROCEDURE ^ SetSelfParameter*(parameter: Parameter);
  464. PROCEDURE ^ SetCallingConvention*(cc: CallingConvention);
  465. PROCEDURE ^ AddParameter*(p: Parameter);
  466. PROCEDURE ^ RevertParameters*;
  467. PROCEDURE ^ SetReturnType*(type: Type);
  468. PROCEDURE ^ SameSignature*(this: Type): BOOLEAN;
  469. PROCEDURE ^ SameType*(this: Type): BOOLEAN;
  470. PROCEDURE ^ CompatibleTo*(to: Type): BOOLEAN;
  471. PROCEDURE ^ IsComposite*(): BOOLEAN;
  472. PROCEDURE ^ NeedsTrace*(): BOOLEAN;
  473. END ProcedureType;
  474. Expression* = OBJECT
  475. VAR
  476. type-: Type;
  477. assignable-: BOOLEAN;
  478. position-, end-: Position;
  479. state-: SET;
  480. resolved-: Value;
  481. isHidden-: BOOLEAN;
  482. PROCEDURE ^ End*(position: Position);
  483. PROCEDURE ^ SetState*(state: LONGINT);
  484. PROCEDURE ^ & InitExpression(position: Position);
  485. PROCEDURE ^ SetHidden*(hidden: BOOLEAN);
  486. PROCEDURE ^ SetType*(type: Type);
  487. PROCEDURE ^ SetResolved*(value: Value);
  488. PROCEDURE ^ SetAssignable*(assignable: BOOLEAN);
  489. PROCEDURE ^ Clone(): Expression;
  490. PROCEDURE ^ NeedsTrace*(): BOOLEAN;
  491. END Expression;
  492. ExpressionList* = OBJECT
  493. VAR
  494. list: Basic.List;
  495. PROCEDURE ^ & InitList;
  496. PROCEDURE ^ Length*(): LONGINT;
  497. PROCEDURE ^ AddExpression*(d: Expression);
  498. PROCEDURE ^ GetExpression*(index: LONGINT): Expression;
  499. PROCEDURE ^ SetExpression*(index: LONGINT; expression: Expression);
  500. PROCEDURE ^ RemoveExpression*(i: LONGINT);
  501. PROCEDURE ^ Revert*;
  502. PROCEDURE ^ Clone*(VAR list: ExpressionList);
  503. END ExpressionList;
  504. Set* = OBJECT (Expression)
  505. VAR
  506. elements-: ExpressionList;
  507. PROCEDURE ^ & InitSet(position: Position);
  508. PROCEDURE ^ Clone(): Expression;
  509. END Set;
  510. MathArrayExpression* = OBJECT (Expression)
  511. VAR
  512. elements-: ExpressionList;
  513. PROCEDURE ^ & InitMathArrayExpression(position: Position);
  514. PROCEDURE ^ Clone(): Expression;
  515. END MathArrayExpression;
  516. UnaryExpression* = OBJECT (Expression)
  517. VAR
  518. left-: Expression;
  519. operator-: LONGINT;
  520. PROCEDURE ^ & InitUnaryExpression(position: Position; operand: Expression; operator: LONGINT);
  521. PROCEDURE ^ SetLeft*(left: Expression);
  522. PROCEDURE ^ Clone(): Expression;
  523. END UnaryExpression;
  524. BinaryExpression* = OBJECT (Expression)
  525. VAR
  526. left-, right-: Expression;
  527. operator-: LONGINT;
  528. PROCEDURE ^ & InitBinaryExpression(position: Position; left, right: Expression; operator: LONGINT);
  529. PROCEDURE ^ SetLeft*(left: Expression);
  530. PROCEDURE ^ SetRight*(right: Expression);
  531. PROCEDURE ^ Clone(): Expression;
  532. END BinaryExpression;
  533. RangeExpression* = OBJECT (Expression)
  534. VAR
  535. first-, last-, step-: Expression;
  536. missingFirst-, missingLast-, missingStep-: BOOLEAN;
  537. context-: SHORTINT;
  538. PROCEDURE ^ & InitRangeExpression(position: Position; first, last, step: Expression);
  539. PROCEDURE ^ SetFirst*(first: Expression);
  540. PROCEDURE ^ SetLast*(last: Expression);
  541. PROCEDURE ^ SetStep*(step: Expression);
  542. PROCEDURE ^ SetContext*(context: SHORTINT);
  543. PROCEDURE ^ Clone(): Expression;
  544. END RangeExpression;
  545. TensorRangeExpression* = OBJECT (Expression)
  546. PROCEDURE ^ & InitTensorRangeExpression(position: Position);
  547. PROCEDURE ^ Clone(): Expression;
  548. END TensorRangeExpression;
  549. Conversion* = OBJECT (Expression)
  550. VAR
  551. expression-: Expression;
  552. typeExpression-: Expression;
  553. PROCEDURE ^ & InitConversion(position: Position; expression: Expression; type: Type; typeExpression: Expression);
  554. PROCEDURE ^ SetExpression*(expression: Expression);
  555. PROCEDURE ^ Clone(): Expression;
  556. END Conversion;
  557. Designator* = OBJECT (Expression)
  558. VAR
  559. left-: Expression;
  560. modifiers-: Modifier;
  561. relatedRhs-: Expression;
  562. PROCEDURE ^ & InitDesignator*(position: Position);
  563. PROCEDURE ^ SetLeft*(expression: Expression);
  564. PROCEDURE ^ SetModifiers*(flags: Modifier);
  565. PROCEDURE ^ SetRelatedRhs*(expression: Expression);
  566. PROCEDURE ^ Clone(): Expression;
  567. END Designator;
  568. IdentifierDesignator* = OBJECT (Designator)
  569. VAR
  570. identifier-: Identifier;
  571. PROCEDURE ^ & InitIdentifierDesignator(position: Position; id: Identifier);
  572. PROCEDURE ^ Clone(): Expression;
  573. END IdentifierDesignator;
  574. SelectorDesignator* = OBJECT (Designator)
  575. VAR
  576. identifier-: Identifier;
  577. PROCEDURE ^ & InitSelector(position: Position; left: Designator; identifier: Identifier);
  578. PROCEDURE ^ Clone(): Expression;
  579. END SelectorDesignator;
  580. ParameterDesignator* = OBJECT (Designator)
  581. VAR
  582. parameters-: ExpressionList;
  583. PROCEDURE ^ & InitParameterDesignator(position: Position; left: Designator; parameters: ExpressionList);
  584. PROCEDURE ^ Clone(): Expression;
  585. END ParameterDesignator;
  586. ArrowDesignator* = OBJECT (Designator)
  587. PROCEDURE ^ & InitArrowDesignator(position: Position; left: Designator);
  588. PROCEDURE ^ Clone(): Expression;
  589. END ArrowDesignator;
  590. BracketDesignator* = OBJECT (Designator)
  591. VAR
  592. parameters-: ExpressionList;
  593. PROCEDURE ^ & InitBracketDesignator(position: Position; left: Designator; parameters: ExpressionList);
  594. PROCEDURE ^ Clone(): Expression;
  595. END BracketDesignator;
  596. SymbolDesignator* = OBJECT (Designator)
  597. VAR
  598. symbol-: Symbol;
  599. PROCEDURE ^ & InitSymbolDesignator(position: Position; left: Designator; symbol: Symbol);
  600. PROCEDURE ^ Clone(): Expression;
  601. PROCEDURE ^ SetSymbol*(s: Symbol);
  602. PROCEDURE ^ NeedsTrace*(): BOOLEAN;
  603. END SymbolDesignator;
  604. IndexDesignator* = OBJECT (Designator)
  605. VAR
  606. parameters-: ExpressionList;
  607. hasRange-: BOOLEAN;
  608. hasTensorRange-: BOOLEAN;
  609. PROCEDURE ^ & InitIndexDesignator(position: Position; left: Designator);
  610. PROCEDURE ^ HasRange*;
  611. PROCEDURE ^ HasTensorRange*;
  612. PROCEDURE ^ Clone(): Expression;
  613. PROCEDURE ^ NeedsTrace*(): BOOLEAN;
  614. END IndexDesignator;
  615. StatementDesignator* = OBJECT (Designator)
  616. VAR
  617. statement-: Statement;
  618. result-: Expression;
  619. PROCEDURE ^ & InitStatementDesignator(position: Position; s: Statement);
  620. PROCEDURE ^ Clone(): Expression;
  621. PROCEDURE ^ SetResult*(r: Expression);
  622. END StatementDesignator;
  623. ProcedureCallDesignator* = OBJECT (Designator)
  624. VAR
  625. parameters-: ExpressionList;
  626. PROCEDURE ^ & InitProcedureCallDesignator(position: Position; left: Designator; parameters: ExpressionList);
  627. PROCEDURE ^ Clone(): Expression;
  628. END ProcedureCallDesignator;
  629. BuiltinCallDesignator* = OBJECT (Designator)
  630. VAR
  631. id-: LONGINT;
  632. parameters-: ExpressionList;
  633. builtin-: Builtin;
  634. returnType-: Type;
  635. PROCEDURE ^ & InitBuiltinCallDesignator(position: Position; id: LONGINT; left: Designator; parameters: ExpressionList);
  636. PROCEDURE ^ SetReturnType*(type: Type);
  637. PROCEDURE ^ Clone(): Expression;
  638. END BuiltinCallDesignator;
  639. TypeGuardDesignator* = OBJECT (Designator)
  640. VAR
  641. typeExpression-: Expression;
  642. PROCEDURE ^ & InitTypeGuardDesignator(position: Position; left: Designator; type: Type);
  643. PROCEDURE ^ SetTypeExpression*(typeExpression: Expression);
  644. PROCEDURE ^ Clone(): Expression;
  645. PROCEDURE ^ NeedsTrace*(): BOOLEAN;
  646. END TypeGuardDesignator;
  647. DereferenceDesignator* = OBJECT (Designator)
  648. PROCEDURE ^ & InitDereferenceDesignator(position: Position; left: Designator);
  649. PROCEDURE ^ Clone(): Expression;
  650. PROCEDURE ^ NeedsTrace*(): BOOLEAN;
  651. END DereferenceDesignator;
  652. SupercallDesignator* = OBJECT (Designator)
  653. PROCEDURE ^ & InitSupercallDesignator(position: Position; left: Designator);
  654. PROCEDURE ^ Clone(): Expression;
  655. END SupercallDesignator;
  656. SelfDesignator* = OBJECT (Designator)
  657. PROCEDURE ^ & InitSelfDesignator(position: Position);
  658. PROCEDURE ^ Clone(): Expression;
  659. PROCEDURE ^ NeedsTrace*(): BOOLEAN;
  660. END SelfDesignator;
  661. ResultDesignator* = OBJECT (Designator)
  662. PROCEDURE ^ & InitResultDesignator(position: Position);
  663. PROCEDURE ^ Clone(): Expression;
  664. END ResultDesignator;
  665. Value* = OBJECT (Expression)
  666. VAR
  667. fingerprint-: FingerPrint;
  668. PROCEDURE ^ & InitValue(position: Position);
  669. PROCEDURE ^ SetFingerPrint*(CONST fp: FingerPrint);
  670. PROCEDURE ^ Equals*(v: Value): BOOLEAN;
  671. END Value;
  672. BooleanValue* = OBJECT (Value)
  673. VAR
  674. value-: BOOLEAN;
  675. PROCEDURE ^ & InitBooleanValue(position: Position; value: BOOLEAN);
  676. PROCEDURE ^ SetValue*(value: BOOLEAN);
  677. PROCEDURE ^ Clone(): Expression;
  678. PROCEDURE ^ Equals*(v: Value): BOOLEAN;
  679. END BooleanValue;
  680. IntegerValue* = OBJECT (Value)
  681. VAR
  682. value-: Basic.Integer;
  683. PROCEDURE ^ & InitIntegerValue(position: Position; value: Basic.Integer);
  684. PROCEDURE ^ SetValue*(value: Basic.Integer);
  685. PROCEDURE ^ Clone(): Expression;
  686. PROCEDURE ^ Equals*(v: Value): BOOLEAN;
  687. END IntegerValue;
  688. CharacterValue* = OBJECT (Value)
  689. VAR
  690. value-: CHAR;
  691. PROCEDURE ^ & InitCharacterValue(position: Position; value: CHAR);
  692. PROCEDURE ^ SetValue*(value: CHAR);
  693. PROCEDURE ^ Clone(): Expression;
  694. PROCEDURE ^ Equals*(v: Value): BOOLEAN;
  695. END CharacterValue;
  696. SetValueType = SetValue;
  697. SetValue* = OBJECT (Value)
  698. VAR
  699. value-: Basic.Set;
  700. PROCEDURE ^ & InitSetValue(position: Position; value: Basic.Set);
  701. PROCEDURE ^ SetValue*(value: Basic.Set);
  702. PROCEDURE ^ Clone(): Expression;
  703. END SetValue;
  704. MathArrayValue* = OBJECT (Value)
  705. VAR
  706. array-: MathArrayExpression;
  707. PROCEDURE ^ & InitMathArrayValue(position: Position);
  708. PROCEDURE ^ SetArray*(array: MathArrayExpression);
  709. PROCEDURE ^ Clone(): Expression;
  710. END MathArrayValue;
  711. RealValue* = OBJECT (Value)
  712. VAR
  713. value-: LONGREAL;
  714. subtype-: LONGINT;
  715. PROCEDURE ^ & InitRealValue(position: Position; value: LONGREAL);
  716. PROCEDURE ^ SetValue*(value: LONGREAL);
  717. PROCEDURE ^ SetSubtype*(subtype: LONGINT);
  718. PROCEDURE ^ Clone(): Expression;
  719. PROCEDURE ^ Equals*(v: Value): BOOLEAN;
  720. END RealValue;
  721. ComplexValue* = OBJECT (Value)
  722. VAR
  723. realValue-, imagValue-: LONGREAL;
  724. subtype-: LONGINT;
  725. PROCEDURE ^ & InitComplexValue(position: Position; realValue, imagValue: LONGREAL);
  726. PROCEDURE ^ SetValue*(realValue, imagValue: LONGREAL);
  727. PROCEDURE ^ UpdateSubtype*;
  728. PROCEDURE ^ SetSubtype*(subtype: LONGINT);
  729. PROCEDURE ^ Clone(): Expression;
  730. PROCEDURE ^ Equals*(v: Value): BOOLEAN;
  731. END ComplexValue;
  732. StringValue* = OBJECT (Value)
  733. VAR
  734. value-: String;
  735. length-: LONGINT;
  736. PROCEDURE ^ & InitStringValue(position: Position; value: String);
  737. PROCEDURE ^ SetValue*(CONST value: String);
  738. PROCEDURE ^ Append*(CONST value: String);
  739. PROCEDURE ^ AppendChar*(CONST ch: CHAR);
  740. PROCEDURE ^ Clone(): Expression;
  741. PROCEDURE ^ Equals*(v: Value): BOOLEAN;
  742. END StringValue;
  743. NilValue* = OBJECT (Value)
  744. PROCEDURE ^ Clone(): Expression;
  745. PROCEDURE ^ Equals*(v: Value): BOOLEAN;
  746. END NilValue;
  747. EnumerationValue* = OBJECT (Value)
  748. VAR
  749. value-: Basic.Integer;
  750. PROCEDURE ^ & InitEnumerationValue(position: Position; value: Basic.Integer);
  751. PROCEDURE ^ SetValue*(value: Basic.Integer);
  752. PROCEDURE ^ Clone(): Expression;
  753. PROCEDURE ^ Equals*(v: Value): BOOLEAN;
  754. END EnumerationValue;
  755. Symbol* = OBJECT
  756. VAR
  757. nextSymbol-: Symbol;
  758. name-: Identifier;
  759. externalName-: Scanner.StringType;
  760. access-: SET;
  761. type-: Type;
  762. scope-: Scope;
  763. offsetInBits-: LONGINT;
  764. used-, written-: BOOLEAN;
  765. fixed-: BOOLEAN;
  766. alignment-: LONGINT;
  767. position-, end-: Position;
  768. state-: SET;
  769. fingerprint-: FingerPrint;
  770. comment-: Comment;
  771. PROCEDURE ^ & InitSymbol(position: Position; name: Identifier);
  772. PROCEDURE ^ SetAlignment*(fix: BOOLEAN; align: LONGINT);
  773. PROCEDURE ^ SetFingerPrint*(CONST fp: FingerPrint);
  774. PROCEDURE ^ SetState*(state: LONGINT);
  775. PROCEDURE ^ SetScope*(scope: Scope);
  776. PROCEDURE ^ SetType*(type: Type);
  777. PROCEDURE ^ SetNext*(symbol: Symbol);
  778. PROCEDURE ^ SetAccess*(access: SET);
  779. PROCEDURE ^ SetOffset*(ofs: LONGINT);
  780. PROCEDURE ^ MarkUsed*;
  781. PROCEDURE ^ MarkWritten*;
  782. PROCEDURE ^ GetName*(VAR str: ARRAY OF CHAR);
  783. PROCEDURE ^ SetComment*(comment: Comment);
  784. PROCEDURE ^ SetExternalName*(name: Scanner.StringType);
  785. PROCEDURE ^ NeedsTrace*(): BOOLEAN;
  786. PROCEDURE ^ NeedsSection*(): BOOLEAN;
  787. END Symbol;
  788. TypeDeclaration* = OBJECT (Symbol)
  789. VAR
  790. nextTypeDeclaration-: TypeDeclaration;
  791. declaredType-: Type;
  792. PROCEDURE ^ & InitTypeDeclaration(position: Position; name: Identifier);
  793. PROCEDURE ^ SetDeclaredType*(type: Type);
  794. PROCEDURE ^ SetType*(type: Type);
  795. PROCEDURE ^ NeedsSection*(): BOOLEAN;
  796. END TypeDeclaration;
  797. Constant* = OBJECT (Symbol)
  798. VAR
  799. value-: Expression;
  800. nextConstant-: Constant;
  801. PROCEDURE ^ & InitConstant(position: Position; name: Identifier);
  802. PROCEDURE ^ SetValue*(value: Expression);
  803. END Constant;
  804. Variable* = OBJECT (Symbol)
  805. VAR
  806. nextVariable-: Variable;
  807. untraced-: BOOLEAN;
  808. fictive-: BOOLEAN;
  809. fictiveOffset-: LONGINT;
  810. useRegister-: BOOLEAN;
  811. registerNumber-: LONGINT;
  812. modifiers-: Modifier;
  813. initializer-: Expression;
  814. usedAsReference-: BOOLEAN;
  815. PROCEDURE ^ & InitVariable*(position: Position; name: Identifier);
  816. PROCEDURE ^ UsedAsReference*;
  817. PROCEDURE ^ SetUntraced*(u: BOOLEAN);
  818. PROCEDURE ^ SetUseRegister*(u: BOOLEAN);
  819. PROCEDURE ^ SetRegisterNumber*(reg: LONGINT);
  820. PROCEDURE ^ SetFictive*(offset: LONGINT);
  821. PROCEDURE ^ SetModifiers*(flag: Modifier);
  822. PROCEDURE ^ SetInitializer*(initializer: Expression);
  823. PROCEDURE ^ NeedsTrace*(): BOOLEAN;
  824. END Variable;
  825. Parameter* = OBJECT (Symbol)
  826. VAR
  827. nextParameter-, prevParameter-: Parameter;
  828. modifiers-: Modifier;
  829. defaultValue-: Expression;
  830. kind-: LONGINT;
  831. ownerType-: Type;
  832. untraced-: BOOLEAN;
  833. movable-: BOOLEAN;
  834. selfParameter-: BOOLEAN;
  835. PROCEDURE ^ & InitParameter(position: Position; ownerType: Type; name: Identifier; kind: LONGINT);
  836. PROCEDURE ^ SetModifiers*(flag: Modifier);
  837. PROCEDURE ^ SetUntraced*(untraced: BOOLEAN);
  838. PROCEDURE ^ SetMoveable*(movable: BOOLEAN);
  839. PROCEDURE ^ SetSelfParameter*(b: BOOLEAN);
  840. PROCEDURE ^ SetDefaultValue*(e: Expression);
  841. PROCEDURE ^ SetKind*(kind: LONGINT);
  842. PROCEDURE ^ NeedsTrace*(): BOOLEAN;
  843. END Parameter;
  844. Property* = OBJECT (Variable)
  845. VAR
  846. nextProperty-, prevProperty-: Property;
  847. value-: Expression;
  848. PROCEDURE ^ & InitProperty(position: Position; name: Identifier);
  849. PROCEDURE ^ SetValue*(e: Expression);
  850. END Property;
  851. Procedure* = OBJECT (Symbol)
  852. VAR
  853. nextProcedure-: Procedure;
  854. procedureScope-: ProcedureScope;
  855. super-: Procedure;
  856. level-, methodNumber-: LONGINT;
  857. isBodyProcedure-, isConstructor-, isFinalizer-, isInline-, isOberonInline-, isEntry-, isExit-, isFinal-, isAbstract-, isOverwritten-: BOOLEAN;
  858. PROCEDURE ^ & InitProcedure(position: Position; name: Identifier; scope: ProcedureScope);
  859. PROCEDURE ^ SetSuper*(super: Procedure);
  860. PROCEDURE ^ SetBodyProcedure*(isBodyProcedure: BOOLEAN);
  861. PROCEDURE ^ SetConstructor*(isConstructor: BOOLEAN);
  862. PROCEDURE ^ SetFinalizer*(isFinalizer: BOOLEAN);
  863. PROCEDURE ^ SetInline*(isInline: BOOLEAN);
  864. PROCEDURE ^ SetOberonInline*(isInline: BOOLEAN);
  865. PROCEDURE ^ SetEntry*(entry: BOOLEAN);
  866. PROCEDURE ^ SetExit*(exit: BOOLEAN);
  867. PROCEDURE ^ SetFinal*(final: BOOLEAN);
  868. PROCEDURE ^ SetOverwritten*(locallyOverwritten: BOOLEAN);
  869. PROCEDURE ^ SetAbstract*(abstract: BOOLEAN);
  870. PROCEDURE ^ SetLevel*(level: LONGINT);
  871. PROCEDURE ^ SetMethodNumber*(methodNumber: LONGINT);
  872. PROCEDURE ^ NeedsSection*(): BOOLEAN;
  873. END Procedure;
  874. Builtin* = OBJECT (Symbol)
  875. VAR
  876. nextBuiltin-: Builtin;
  877. id-: LONGINT;
  878. PROCEDURE ^ & InitBuiltin(position: Position; name: Identifier; id: LONGINT);
  879. END Builtin;
  880. CustomBuiltin* = OBJECT (Builtin)
  881. VAR
  882. subType-: SHORTINT;
  883. PROCEDURE ^ & InitCustomBuiltin(position: Position; name: Identifier; id: LONGINT; subType: SHORTINT);
  884. PROCEDURE ^ CompatibleTo*(otherType: Type): BOOLEAN;
  885. END CustomBuiltin;
  886. Operator* = OBJECT (Procedure)
  887. VAR
  888. nextOperator-: Operator;
  889. isDynamic-: BOOLEAN;
  890. PROCEDURE ^ & InitOperator(position: Position; name: Identifier; scope: ProcedureScope);
  891. PROCEDURE ^ SetDynamic*(isDynamic: BOOLEAN);
  892. END Operator;
  893. Import* = OBJECT (Symbol)
  894. VAR
  895. nextImport-: Import;
  896. module-: Module;
  897. moduleName-: Identifier;
  898. context-: Identifier;
  899. direct-: BOOLEAN;
  900. PROCEDURE ^ & InitImport(position: Position; name, moduleName: Identifier; direct: BOOLEAN);
  901. PROCEDURE ^ SetType*(type: Type);
  902. PROCEDURE ^ SetModule*(module: Module);
  903. PROCEDURE ^ SetDirect*(d: BOOLEAN);
  904. PROCEDURE ^ SetModuleName*(moduleName: Identifier);
  905. PROCEDURE ^ SetContext*(context: Identifier);
  906. END Import;
  907. StatementSequence* = OBJECT
  908. VAR
  909. list: Basic.List;
  910. PROCEDURE ^ & InitList;
  911. PROCEDURE ^ Length*(): LONGINT;
  912. PROCEDURE ^ AddStatement*(statement: Statement);
  913. PROCEDURE ^ PrependStatement*(statement: Statement);
  914. PROCEDURE ^ HasStatement*(statement: Statement): BOOLEAN;
  915. PROCEDURE ^ GetStatement*(index: LONGINT): Statement;
  916. PROCEDURE ^ SetStatement*(index: LONGINT; statement: Statement);
  917. PROCEDURE ^ RemoveStatement*(statement: Statement);
  918. PROCEDURE ^ InsertBefore*(search, new: Statement);
  919. PROCEDURE ^ Clone(VAR copy: StatementSequence);
  920. END StatementSequence;
  921. Statement* = OBJECT
  922. VAR
  923. outer-: Statement;
  924. position-, end-: Position;
  925. isUnreachable-: BOOLEAN;
  926. comment-: Comment;
  927. PROCEDURE ^ & InitStatement*(position: Position; outer: Statement);
  928. PROCEDURE ^ SetOuter*(o: Statement);
  929. PROCEDURE ^ SetUnreachable*(unreachable: BOOLEAN);
  930. PROCEDURE ^ SetComment*(comment: Comment);
  931. PROCEDURE ^ Clone(): Statement;
  932. PROCEDURE ^ End*(pos: Position);
  933. END Statement;
  934. ProcedureCallStatement* = OBJECT (Statement)
  935. VAR
  936. ignore-: BOOLEAN;
  937. call-: Designator;
  938. PROCEDURE ^ & InitProcedureCallStatement(position: Position; ignore: BOOLEAN; call: Designator; outer: Statement);
  939. PROCEDURE ^ SetIgnore*(ignore: BOOLEAN);
  940. PROCEDURE ^ SetCall*(call: Designator);
  941. PROCEDURE ^ Clone(): Statement;
  942. END ProcedureCallStatement;
  943. Assignment* = OBJECT (Statement)
  944. VAR
  945. left-: Designator;
  946. right-: Expression;
  947. PROCEDURE ^ & InitAssignment*(position: Position; left: Designator; right: Expression; outer: Statement);
  948. PROCEDURE ^ SetLeft*(left: Designator);
  949. PROCEDURE ^ SetRight*(right: Expression);
  950. PROCEDURE ^ Clone(): Statement;
  951. END Assignment;
  952. CommunicationStatement* = OBJECT (Statement)
  953. VAR
  954. left-: Designator;
  955. right-: Expression;
  956. op-: LONGINT;
  957. PROCEDURE ^ & InitAssignment*(position: Position; op: LONGINT; left: Designator; right: Expression; outer: Statement);
  958. PROCEDURE ^ SetLeft*(left: Designator);
  959. PROCEDURE ^ SetRight*(right: Expression);
  960. END CommunicationStatement;
  961. Part* = OBJECT
  962. VAR
  963. position-, end-: Position;
  964. PROCEDURE ^ InitPart;
  965. PROCEDURE ^ SetPosition*(pos: Position);
  966. PROCEDURE ^ SetEnd*(pos: Position);
  967. END Part;
  968. IfPart* = OBJECT (Part)
  969. VAR
  970. condition-: Expression;
  971. statements-: StatementSequence;
  972. comment-: Comment;
  973. PROCEDURE ^ & InitIfPart;
  974. PROCEDURE ^ SetCondition*(condition: Expression);
  975. PROCEDURE ^ SetStatements*(statements: StatementSequence);
  976. PROCEDURE ^ SetComment*(comment: Comment);
  977. PROCEDURE ^ Clone(): IfPart;
  978. END IfPart;
  979. IfStatement* = OBJECT (Statement)
  980. VAR
  981. ifPart-: IfPart;
  982. elsifParts: Basic.List;
  983. elsePart-: StatementSequence;
  984. PROCEDURE ^ & InitIfStatement(position: Position; outer: Statement);
  985. PROCEDURE ^ SetElsePart*(elsePart: StatementSequence);
  986. PROCEDURE ^ AddElsifPart*(elsifPart: IfPart);
  987. PROCEDURE ^ GetElsifPart*(i: LONGINT): IfPart;
  988. PROCEDURE ^ ElsifParts*(): LONGINT;
  989. PROCEDURE ^ Clone(): Statement;
  990. END IfStatement;
  991. WithPart* = OBJECT (Part)
  992. VAR
  993. type-: Type;
  994. statements-: StatementSequence;
  995. comment-: Comment;
  996. PROCEDURE ^ & InitWithPart;
  997. PROCEDURE ^ SetType*(type: Type);
  998. PROCEDURE ^ SetStatements*(statements: StatementSequence);
  999. PROCEDURE ^ SetComment*(comment: Comment);
  1000. PROCEDURE ^ Clone(): WithPart;
  1001. END WithPart;
  1002. WithStatement* = OBJECT (Statement)
  1003. VAR
  1004. variable-: Designator;
  1005. withParts-: Basic.List;
  1006. elsePart-: StatementSequence;
  1007. PROCEDURE ^ & InitWithStatement(position: Position; outer: Statement);
  1008. PROCEDURE ^ SetVariable*(variable: Designator);
  1009. PROCEDURE ^ AddWithPart*(withPart: WithPart);
  1010. PROCEDURE ^ GetWithPart*(i: LONGINT): WithPart;
  1011. PROCEDURE ^ WithParts*(): LONGINT;
  1012. PROCEDURE ^ SetElsePart*(elsePart: StatementSequence);
  1013. PROCEDURE ^ Clone(): Statement;
  1014. END WithStatement;
  1015. CaseConstant* = POINTER TO RECORD
  1016. min*, max*: Basic.Integer;
  1017. next*: CaseConstant;
  1018. END;
  1019. CasePart* = OBJECT (Part)
  1020. VAR
  1021. elements-: ExpressionList;
  1022. firstConstant-: CaseConstant;
  1023. statements-: StatementSequence;
  1024. comment-: Comment;
  1025. PROCEDURE ^ & InitCasePart;
  1026. PROCEDURE ^ SetStatements*(statements: StatementSequence);
  1027. PROCEDURE ^ SetConstants*(firstConstant: CaseConstant);
  1028. PROCEDURE ^ SetComment*(comment: Comment);
  1029. PROCEDURE ^ Clone(): CasePart;
  1030. END CasePart;
  1031. CaseStatement* = OBJECT (Statement)
  1032. VAR
  1033. variable-: Expression;
  1034. elsePart-: StatementSequence;
  1035. caseParts-: Basic.List;
  1036. min-, max-: Basic.Integer;
  1037. PROCEDURE ^ & InitCaseStatement(position: Position; outer: Statement);
  1038. PROCEDURE ^ SetVariable*(expression: Expression);
  1039. PROCEDURE ^ SetElsePart*(elsePart: StatementSequence);
  1040. PROCEDURE ^ AddCasePart*(casePart: CasePart);
  1041. PROCEDURE ^ GetCasePart*(i: LONGINT): CasePart;
  1042. PROCEDURE ^ CaseParts*(): LONGINT;
  1043. PROCEDURE ^ Clone(): Statement;
  1044. PROCEDURE ^ MaxConstant*(): Basic.Integer;
  1045. PROCEDURE ^ SetMinMax*(min, max: Basic.Integer);
  1046. END CaseStatement;
  1047. WhileStatement* = OBJECT (Statement)
  1048. VAR
  1049. condition-: Expression;
  1050. statements-: StatementSequence;
  1051. PROCEDURE ^ & InitWhileStatement(position: Position; outer: Statement);
  1052. PROCEDURE ^ SetCondition*(condition: Expression);
  1053. PROCEDURE ^ SetStatements*(statements: StatementSequence);
  1054. PROCEDURE ^ Clone(): Statement;
  1055. END WhileStatement;
  1056. RepeatStatement* = OBJECT (Statement)
  1057. VAR
  1058. condition-: Expression;
  1059. statements-: StatementSequence;
  1060. PROCEDURE ^ & InitRepeatStatement(position: Position; outer: Statement);
  1061. PROCEDURE ^ SetCondition*(condition: Expression);
  1062. PROCEDURE ^ SetStatements*(statements: StatementSequence);
  1063. PROCEDURE ^ Clone(): Statement;
  1064. END RepeatStatement;
  1065. ForStatement* = OBJECT (Statement)
  1066. VAR
  1067. variable-: Designator;
  1068. from-, to-, by-: Expression;
  1069. statements-: StatementSequence;
  1070. PROCEDURE ^ & InitForStatement(position: Position; outer: Statement);
  1071. PROCEDURE ^ SetVariable*(variable: Designator);
  1072. PROCEDURE ^ SetFrom*(from: Expression);
  1073. PROCEDURE ^ SetTo*(to: Expression);
  1074. PROCEDURE ^ SetBy*(by: Expression);
  1075. PROCEDURE ^ SetStatements*(statements: StatementSequence);
  1076. PROCEDURE ^ Clone(): Statement;
  1077. END ForStatement;
  1078. ExitableBlock* = OBJECT (Statement)
  1079. VAR
  1080. statements-: StatementSequence;
  1081. PROCEDURE ^ & InitExitableBlock(position: Position; outer: Statement);
  1082. PROCEDURE ^ SetStatements*(statements: StatementSequence);
  1083. PROCEDURE ^ Clone(): Statement;
  1084. END ExitableBlock;
  1085. LoopStatement* = OBJECT (ExitableBlock)
  1086. PROCEDURE ^ Clone(): Statement;
  1087. END LoopStatement;
  1088. ExitStatement* = OBJECT (Statement)
  1089. PROCEDURE ^ Clone(): Statement;
  1090. END ExitStatement;
  1091. ReturnStatement* = OBJECT (Statement)
  1092. VAR
  1093. returnValue-: Expression;
  1094. PROCEDURE ^ & InitReturnStatement(position: Position; outer: Statement);
  1095. PROCEDURE ^ SetReturnValue*(returnValue: Expression);
  1096. PROCEDURE ^ Clone(): Statement;
  1097. END ReturnStatement;
  1098. AwaitStatement* = OBJECT (Statement)
  1099. VAR
  1100. condition-: Expression;
  1101. PROCEDURE ^ & InitAwaitStatement(position: Position; outer: Statement);
  1102. PROCEDURE ^ SetCondition*(condition: Expression);
  1103. PROCEDURE ^ Clone(): Statement;
  1104. END AwaitStatement;
  1105. Modifier* = OBJECT
  1106. VAR
  1107. identifier-: Identifier;
  1108. expression-: Expression;
  1109. resolved-: BOOLEAN;
  1110. nextModifier-: Modifier;
  1111. position-: Position;
  1112. PROCEDURE ^ & InitModifier(position: Position; identifier: Identifier; expression: Expression);
  1113. PROCEDURE ^ Resolved*;
  1114. PROCEDURE ^ SetExpression*(e: Expression);
  1115. PROCEDURE ^ SetNext*(modifier: Modifier);
  1116. END Modifier;
  1117. StatementBlock* = OBJECT (Statement)
  1118. VAR
  1119. statements-: StatementSequence;
  1120. blockModifiers-: Modifier;
  1121. isExclusive-: BOOLEAN;
  1122. isRealtime-: BOOLEAN;
  1123. isUnchecked-: BOOLEAN;
  1124. isUncooperative-: BOOLEAN;
  1125. PROCEDURE ^ & InitStatementBlock(position: Position; outer: Statement);
  1126. PROCEDURE ^ SetRealtime*(b: BOOLEAN);
  1127. PROCEDURE ^ SetUnchecked*(unchecked: BOOLEAN);
  1128. PROCEDURE ^ SetUncooperative*(uncooperative: BOOLEAN);
  1129. PROCEDURE ^ SetModifier*(modifier: Modifier);
  1130. PROCEDURE ^ SetExclusive*(excl: BOOLEAN);
  1131. PROCEDURE ^ SetStatementSequence*(statements: StatementSequence);
  1132. END StatementBlock;
  1133. Code* = OBJECT (Statement)
  1134. VAR
  1135. sourceCode-: SourceCode;
  1136. sourceCodeLength-: LONGINT;
  1137. inlineCode-: BinaryCode;
  1138. inRules-, outRules-: StatementSequence;
  1139. PROCEDURE ^ & InitCode(position: Position; outer: Statement);
  1140. PROCEDURE ^ SetSourceCode*(source: SourceCode; length: LONGINT);
  1141. PROCEDURE ^ SetBinaryCode*(code: BinaryCode);
  1142. PROCEDURE ^ Clone(): Statement;
  1143. END Code;
  1144. Body* = OBJECT (StatementBlock)
  1145. VAR
  1146. finally-: StatementSequence;
  1147. priority-: Expression;
  1148. inScope-: ProcedureScope;
  1149. code-: Code;
  1150. isActive-, isSafe-: BOOLEAN;
  1151. PROCEDURE ^ & InitBody(position: Position; scope: ProcedureScope);
  1152. PROCEDURE ^ SetActive*(active: BOOLEAN);
  1153. PROCEDURE ^ SetSafe*(safe: BOOLEAN);
  1154. PROCEDURE ^ SetFinally*(finally: StatementSequence);
  1155. PROCEDURE ^ SetPriority*(expression: Expression);
  1156. PROCEDURE ^ SetCode*(code: Code);
  1157. END Body;
  1158. Comment* = OBJECT
  1159. VAR
  1160. position-: Position;
  1161. source-: String;
  1162. scope-: Scope;
  1163. item-: ANY;
  1164. sameLine-: BOOLEAN;
  1165. nextComment-: Comment;
  1166. PROCEDURE ^ & InitComment(pos: Position; scope: Scope; CONST s: ARRAY OF CHAR; length: LONGINT);
  1167. PROCEDURE ^ SetItem*(p: ANY; sameLine: BOOLEAN);
  1168. END Comment;
  1169. Scope* = OBJECT
  1170. VAR
  1171. firstSymbol-: Symbol;
  1172. numberSymbols-: LONGINT;
  1173. symbolTable: Basic.HashTableInt;
  1174. firstConstant-, lastConstant-: Constant;
  1175. numberConstants-: LONGINT;
  1176. firstTypeDeclaration-, lastTypeDeclaration-: TypeDeclaration;
  1177. numberTypeDeclarations-: LONGINT;
  1178. firstVariable-, lastVariable-: Variable;
  1179. numberVariables-: LONGINT;
  1180. firstProcedure-, lastProcedure-: Procedure;
  1181. numberProcedures-: LONGINT;
  1182. procedures-: ProcedureList;
  1183. outerScope-: Scope;
  1184. nextScope-: Scope;
  1185. ownerModule-: Module;
  1186. PROCEDURE ^ & InitScope(outer: Scope);
  1187. PROCEDURE ^ Clear*;
  1188. PROCEDURE ^ EnterSymbol*(symbol: Symbol; VAR duplicate: BOOLEAN);
  1189. PROCEDURE ^ FindSymbol*(identifier: Identifier): Symbol;
  1190. PROCEDURE ^ AddConstant*(c: Constant);
  1191. PROCEDURE ^ FindConstant*(identifier: Identifier): Constant;
  1192. PROCEDURE ^ AddTypeDeclaration*(t: TypeDeclaration);
  1193. PROCEDURE ^ FindTypeDeclaration*(identifier: Identifier): TypeDeclaration;
  1194. PROCEDURE ^ AddVariable*(v: Variable);
  1195. PROCEDURE ^ PushVariable*(v: Variable);
  1196. PROCEDURE ^ InsertVariable*(v: Variable; after: Variable);
  1197. PROCEDURE ^ FindVariable*(identifier: Identifier): Variable;
  1198. PROCEDURE ^ AddProcedure*(p: Procedure);
  1199. PROCEDURE ^ AddProcedureDeclaration*(p: Procedure);
  1200. PROCEDURE ^ FindProcedure*(identifier: Identifier): Procedure;
  1201. PROCEDURE ^ FindMethod*(number: LONGINT): Procedure;
  1202. PROCEDURE ^ Level*(): LONGINT;
  1203. PROCEDURE ^ NeedsTrace*(): BOOLEAN;
  1204. END Scope;
  1205. ProcedureScope* = OBJECT (Scope)
  1206. VAR
  1207. ownerProcedure-: Procedure;
  1208. body-: Body;
  1209. PROCEDURE ^ & InitProcedureScope(outer: Scope);
  1210. PROCEDURE ^ SetBody*(body: Body);
  1211. PROCEDURE ^ NeedsTrace*(): BOOLEAN;
  1212. END ProcedureScope;
  1213. EnumerationScope* = OBJECT (Scope)
  1214. VAR
  1215. ownerEnumeration-: EnumerationType;
  1216. PROCEDURE ^ FindSymbol*(identifier: Identifier): Symbol;
  1217. PROCEDURE ^ & InitEnumerationScope(outer: Scope);
  1218. END EnumerationScope;
  1219. RecordScope* = OBJECT (Scope)
  1220. VAR
  1221. ownerRecord-: RecordType;
  1222. bodyProcedure-: Procedure;
  1223. constructor-: Procedure;
  1224. finalizer-: Procedure;
  1225. numberMethods-: LONGINT;
  1226. firstParameter-, lastParameter-: Parameter;
  1227. numberParameters-: LONGINT;
  1228. firstOperator-, lastOperator-: Operator;
  1229. numberOperators: LONGINT;
  1230. PROCEDURE ^ & InitRecordScope(outer: Scope);
  1231. PROCEDURE ^ SetBodyProcedure*(body: Procedure);
  1232. PROCEDURE ^ SetConstructor*(body: Procedure);
  1233. PROCEDURE ^ SetFinalizer*(body: Procedure);
  1234. PROCEDURE ^ SetNumberMethods*(numberMethods: LONGINT);
  1235. PROCEDURE ^ AddOperator*(p: Operator);
  1236. PROCEDURE ^ FindSymbol*(identifier: Identifier): Symbol;
  1237. PROCEDURE ^ AbstractProcedure*(inScope: Scope): Procedure;
  1238. PROCEDURE ^ FindConstant*(identifier: Identifier): Constant;
  1239. PROCEDURE ^ FindTypeDeclaration*(identifier: Identifier): TypeDeclaration;
  1240. PROCEDURE ^ FindVariable*(identifier: Identifier): Variable;
  1241. PROCEDURE ^ FindProcedure*(identifier: Identifier): Procedure;
  1242. PROCEDURE ^ FindMethod*(number: LONGINT): Procedure;
  1243. PROCEDURE ^ NeedsTrace*(): BOOLEAN;
  1244. END RecordScope;
  1245. CellScope* = OBJECT (Scope)
  1246. VAR
  1247. ownerCell-: CellType;
  1248. bodyProcedure-: Procedure;
  1249. constructor-: Procedure;
  1250. firstImport-, lastImport-: Import;
  1251. numberImports: LONGINT;
  1252. PROCEDURE ^ & InitCellScope(outer: Scope);
  1253. PROCEDURE ^ Clear*;
  1254. PROCEDURE ^ SetOwnerCell*(owner: CellType);
  1255. PROCEDURE ^ SetBodyProcedure*(bodyProcedure: Procedure);
  1256. PROCEDURE ^ SetConstructor*(p: Procedure);
  1257. PROCEDURE ^ AddImport*(i: Import);
  1258. PROCEDURE ^ FindImport*(identifier: Identifier): Import;
  1259. PROCEDURE ^ GetImport*(index: LONGINT): Import;
  1260. PROCEDURE ^ FindSymbol*(identifier: Identifier): Symbol;
  1261. END CellScope;
  1262. ModuleScope* = OBJECT (Scope)
  1263. VAR
  1264. firstImport-, lastImport-: Import;
  1265. numberImports: LONGINT;
  1266. firstOperator-, lastOperator-: Operator;
  1267. numberOperators: LONGINT;
  1268. firstBuiltin-, lastBuiltin-: Builtin;
  1269. numberBuiltins: LONGINT;
  1270. firstComment-, lastComment-: Comment;
  1271. numberComments-: LONGINT;
  1272. bodyProcedure-: Procedure;
  1273. PROCEDURE ^ & InitModuleScope;
  1274. PROCEDURE ^ SetBodyProcedure*(body: Procedure);
  1275. PROCEDURE ^ SetGlobalScope*(outer: Scope);
  1276. PROCEDURE ^ AddBuiltin*(p: Builtin);
  1277. PROCEDURE ^ AddOperator*(p: Operator);
  1278. PROCEDURE ^ FindOperator*(identifier: Identifier): Operator;
  1279. PROCEDURE ^ AddImport*(i: Import);
  1280. PROCEDURE ^ FindImport*(identifier: Identifier): Import;
  1281. PROCEDURE ^ GetImport*(index: LONGINT): Import;
  1282. PROCEDURE ^ AddComment*(comment: Comment);
  1283. PROCEDURE ^ ImportByModuleName*(moduleName, context: Identifier): Import;
  1284. PROCEDURE ^ RemoveImporters*(moduleName, context: Identifier);
  1285. END ModuleScope;
  1286. Module* = OBJECT (Symbol)
  1287. VAR
  1288. sourceName-: Basic.FileName;
  1289. moduleScope-: ModuleScope;
  1290. context-: Identifier;
  1291. case-: LONGINT;
  1292. isCellNet-: BOOLEAN;
  1293. firstScope-, lastScope-: Scope;
  1294. numberScopes-: LONGINT;
  1295. closingComment-: Comment;
  1296. modifiers-: Modifier;
  1297. PROCEDURE ^ & InitModule(CONST sourceName: ARRAY OF CHAR; position: Position; name: Identifier; scope: ModuleScope; case: LONGINT);
  1298. PROCEDURE ^ SetCase*(case: LONGINT);
  1299. PROCEDURE ^ SetCellNet*(isCellNet: BOOLEAN);
  1300. PROCEDURE ^ SetContext*(context: Identifier);
  1301. PROCEDURE ^ SetName*(name: Identifier);
  1302. PROCEDURE ^ SetClosingComment*(comment: Comment);
  1303. PROCEDURE ^ SetModifiers*(modifiers: Modifier);
  1304. PROCEDURE ^ AddScope*(c: Scope);
  1305. END Module;
  1306. SymbolList* = OBJECT
  1307. VAR
  1308. list: Basic.List;
  1309. PROCEDURE ^ & InitList*;
  1310. PROCEDURE ^ Length*(): LONGINT;
  1311. PROCEDURE ^ AddSymbol*(d: Symbol);
  1312. PROCEDURE ^ GetSymbol*(index: LONGINT): Symbol;
  1313. PROCEDURE ^ SetSymbol*(index: LONGINT; expression: Symbol);
  1314. PROCEDURE ^ RemoveSymbol*(i: LONGINT);
  1315. END SymbolList;
  1316. ProcedureList* = OBJECT
  1317. VAR
  1318. list: Basic.List;
  1319. PROCEDURE ^ & InitList*;
  1320. PROCEDURE ^ Length*(): LONGINT;
  1321. PROCEDURE ^ AddProcedure*(d: Procedure);
  1322. PROCEDURE ^ GetProcedure*(index: LONGINT): Procedure;
  1323. PROCEDURE ^ SetProcedure*(index: LONGINT; expression: Procedure);
  1324. PROCEDURE ^ RemoveProcedure*(i: LONGINT);
  1325. END ProcedureList;
  1326. VAR
  1327. invalidIdentifier-: Identifier;
  1328. invalidQualifiedIdentifier-: QualifiedIdentifier;
  1329. invalidType-: Type;
  1330. invalidExpression-: Expression;
  1331. invalidDesignator-: Designator;
  1332. invalidValue-: Value;
  1333. invalidSymbol-: Symbol;
  1334. invalidPosition-: Position;
  1335. anonymousIdentifier-: Identifier;
  1336. importType-: Type;
  1337. typeDeclarationType-: Type;
  1338. moduleType-: Type;
  1339. indexListSeparator-: Expression;
  1340. PROCEDURE ^ InitFingerPrint*(VAR fingerprint: FingerPrint);
  1341. PROCEDURE ^ NewModule*(CONST sourceName: ARRAY OF CHAR; position: Position; name: Identifier; scope: ModuleScope; case: LONGINT): Module;
  1342. PROCEDURE ^ NewComment*(position: Position; scope: Scope; CONST source: ARRAY OF CHAR; length: LONGINT): Comment;
  1343. PROCEDURE ^ NewImport*(position: Position; alias, name: Identifier; direct: BOOLEAN): Import;
  1344. PROCEDURE ^ NewConstant*(position: Position; name: Identifier): Constant;
  1345. PROCEDURE ^ NewProcedure*(position: Position; name: Identifier; scope: ProcedureScope): Procedure;
  1346. PROCEDURE ^ NewBuiltin*(position: Position; name: Identifier; id: LONGINT): Builtin;
  1347. PROCEDURE ^ NewCustomBuiltin*(position: Position; name: Identifier; id: LONGINT; subType: SHORTINT): CustomBuiltin;
  1348. PROCEDURE ^ NewOperator*(position: Position; name: Identifier; scope: ProcedureScope): Operator;
  1349. PROCEDURE ^ NewType*(): Type;
  1350. PROCEDURE ^ NewByteType*(sizeInBits: LONGINT): ByteType;
  1351. PROCEDURE ^ NewAnyType*(sizeInBits: LONGINT): AnyType;
  1352. PROCEDURE ^ NewObjectType*(sizeInBits: LONGINT): ObjectType;
  1353. PROCEDURE ^ NewNilType*(sizeInBits: LONGINT): NilType;
  1354. PROCEDURE ^ NewAddressType*(sizeInBits: LONGINT): AddressType;
  1355. PROCEDURE ^ NewSizeType*(sizeInBits: LONGINT): SizeType;
  1356. PROCEDURE ^ NewBooleanType*(sizeInBits: LONGINT): BooleanType;
  1357. PROCEDURE ^ NewSetType*(sizeInBits: LONGINT): SetType;
  1358. PROCEDURE ^ NewCharacterType*(sizeInBits: LONGINT): CharacterType;
  1359. PROCEDURE ^ NewRangeType*(sizeInBits: LONGINT): RangeType;
  1360. PROCEDURE ^ NewComplexType*(base: Type): ComplexType;
  1361. PROCEDURE ^ NewIntegerType*(size: LONGINT; signed: BOOLEAN): IntegerType;
  1362. PROCEDURE ^ NewFloatType*(sizeInBits: LONGINT): FloatType;
  1363. PROCEDURE ^ NewTypeDeclaration*(position: Position; name: Identifier): TypeDeclaration;
  1364. PROCEDURE ^ NewStringType*(position: Position; baseType: Type; length: LONGINT): StringType;
  1365. PROCEDURE ^ NewEnumerationType*(position: Position; scope: Scope; enumerationScope: EnumerationScope): EnumerationType;
  1366. PROCEDURE ^ NewArrayType*(position: Position; scope: Scope; form: LONGINT): ArrayType;
  1367. PROCEDURE ^ NewMathArrayType*(position: Position; scope: Scope; form: LONGINT): MathArrayType;
  1368. PROCEDURE ^ NewPointerType*(position: Position; scope: Scope): PointerType;
  1369. PROCEDURE ^ NewPortType*(position: Position; direction: LONGINT; sizeExpression: Expression; scope: Scope): PortType;
  1370. PROCEDURE ^ NewRecordType*(position: Position; scope: Scope; recordScope: RecordScope): RecordType;
  1371. PROCEDURE ^ NewCellType*(position: Position; scope: Scope; cellScope: CellScope): CellType;
  1372. PROCEDURE ^ NewProcedureType*(position: Position; scope: Scope): ProcedureType;
  1373. PROCEDURE ^ NewQualifiedType*(position: Position; scope: Scope; qualifiedIdentifier: QualifiedIdentifier): QualifiedType;
  1374. PROCEDURE ^ NewSymbol*(name: Identifier): Symbol;
  1375. PROCEDURE ^ NewVariable*(position: Position; name: Identifier): Variable;
  1376. PROCEDURE ^ NewQualifiedIdentifier*(position: Position; prefix, suffix: Identifier): QualifiedIdentifier;
  1377. PROCEDURE ^ NewIdentifier*(CONST name: ARRAY OF CHAR): Identifier;
  1378. PROCEDURE ^ NewParameter*(position: Position; ownerType: Type; name: Identifier; passAs: LONGINT): Parameter;
  1379. PROCEDURE ^ NewProperty*(position: Position; name: Identifier): Property;
  1380. PROCEDURE ^ NewExpressionList*(): ExpressionList;
  1381. PROCEDURE ^ CloneExpressionList*(l: ExpressionList): ExpressionList;
  1382. PROCEDURE ^ NewDesignator*(): Designator;
  1383. PROCEDURE ^ NewIdentifierDesignator*(position: Position; identifier: Identifier): IdentifierDesignator;
  1384. PROCEDURE ^ NewSelectorDesignator*(position: Position; left: Designator; name: Identifier): SelectorDesignator;
  1385. PROCEDURE ^ NewParameterDesignator*(position: Position; left: Designator; expressionList: ExpressionList): ParameterDesignator;
  1386. PROCEDURE ^ NewArrowDesignator*(position: Position; left: Designator): ArrowDesignator;
  1387. PROCEDURE ^ NewBracketDesignator*(position: Position; left: Designator; expressionList: ExpressionList): BracketDesignator;
  1388. PROCEDURE ^ NewSymbolDesignator*(position: Position; left: Designator; symbol: Symbol): SymbolDesignator;
  1389. PROCEDURE ^ NewIndexDesignator*(position: Position; left: Designator): IndexDesignator;
  1390. PROCEDURE ^ NewProcedureCallDesignator*(position: Position; left: Designator; parameters: ExpressionList): ProcedureCallDesignator;
  1391. PROCEDURE ^ NewBuiltinCallDesignator*(position: Position; id: LONGINT; left: Designator; parameters: ExpressionList): BuiltinCallDesignator;
  1392. PROCEDURE ^ NewTypeGuardDesignator*(position: Position; left: Designator; type: Type): TypeGuardDesignator;
  1393. PROCEDURE ^ NewDereferenceDesignator*(position: Position; left: Designator): DereferenceDesignator;
  1394. PROCEDURE ^ NewSupercallDesignator*(position: Position; left: Designator): SupercallDesignator;
  1395. PROCEDURE ^ NewSelfDesignator*(position: Position): SelfDesignator;
  1396. PROCEDURE ^ NewResultDesignator*(position: Position): ResultDesignator;
  1397. PROCEDURE ^ NewExpression*(): Expression;
  1398. PROCEDURE ^ CloneExpression*(e: Expression): Expression;
  1399. PROCEDURE ^ CloneDesignator*(e: Expression): Designator;
  1400. PROCEDURE ^ NewElement*(position: Position; from, to: Expression): Expression;
  1401. PROCEDURE ^ NewSet*(position: Position): Set;
  1402. PROCEDURE ^ NewMathArrayExpression*(position: Position): MathArrayExpression;
  1403. PROCEDURE ^ NewBinaryExpression*(position: Position; left, right: Expression; operator: LONGINT): BinaryExpression;
  1404. PROCEDURE ^ NewRangeExpression*(position: Position; first, last, step: Expression): RangeExpression;
  1405. PROCEDURE ^ NewTensorRangeExpression*(position: Position): TensorRangeExpression;
  1406. PROCEDURE ^ NewUnaryExpression*(position: Position; operand: Expression; operator: LONGINT): UnaryExpression;
  1407. PROCEDURE ^ NewConversion*(position: Position; expression: Expression; type: Type; typeExpression: Expression): Conversion;
  1408. PROCEDURE ^ NewValue*(): Value;
  1409. PROCEDURE ^ NewIntegerValue*(position: Position; value: Basic.Integer): IntegerValue;
  1410. PROCEDURE ^ NewCharacterValue*(position: Position; value: CHAR): CharacterValue;
  1411. PROCEDURE ^ NewSetValue*(position: Position; value: Basic.Set): SetValue;
  1412. PROCEDURE ^ NewMathArrayValue*(position: Position): MathArrayValue;
  1413. PROCEDURE ^ NewRealValue*(position: Position; value: LONGREAL): RealValue;
  1414. PROCEDURE ^ NewComplexValue*(position: Position; realValue, imagValue: LONGREAL): ComplexValue;
  1415. PROCEDURE ^ NewStringValue*(position: Position; value: String): StringValue;
  1416. PROCEDURE ^ NewBooleanValue*(position: Position; value: BOOLEAN): BooleanValue;
  1417. PROCEDURE ^ NewNilValue*(position: Position): NilValue;
  1418. PROCEDURE ^ NewEnumerationValue*(position: Position; value: Basic.Integer): EnumerationValue;
  1419. PROCEDURE ^ NewStatement*(outer: Statement): Statement;
  1420. PROCEDURE ^ CloneStatement*(statement: Statement): Statement;
  1421. PROCEDURE ^ NewStatementSequence*(): StatementSequence;
  1422. PROCEDURE ^ CloneStatementSequence*(statementSequence: StatementSequence): StatementSequence;
  1423. PROCEDURE ^ NewModifier*(position: Position; identifier: Identifier; expression: Expression): Modifier;
  1424. PROCEDURE ^ NewStatementBlock*(position: Position; outer: Statement): StatementBlock;
  1425. PROCEDURE ^ NewStatementDesignator*(position: Position; s: Statement): StatementDesignator;
  1426. PROCEDURE ^ NewBody*(position: Position; scope: ProcedureScope): Body;
  1427. PROCEDURE ^ NewIfPart*(): IfPart;
  1428. PROCEDURE ^ NewIfStatement*(position: Position; outer: Statement): IfStatement;
  1429. PROCEDURE ^ NewAssignment*(position: Position; left: Designator; right: Expression; outer: Statement): Assignment;
  1430. PROCEDURE ^ NewCommunicationStatement*(position: Position; op: LONGINT; left: Designator; right: Expression; outer: Statement): CommunicationStatement;
  1431. PROCEDURE ^ NewProcedureCallStatement*(position: Position; ignore: BOOLEAN; call: Designator; outer: Statement): ProcedureCallStatement;
  1432. PROCEDURE ^ NewCaseStatement*(position: Position; outer: Statement): CaseStatement;
  1433. PROCEDURE ^ NewCasePart*(): CasePart;
  1434. PROCEDURE ^ NewWithPart*(): WithPart;
  1435. PROCEDURE ^ NewWithStatement*(position: Position; outer: Statement): WithStatement;
  1436. PROCEDURE ^ NewWhileStatement*(position: Position; outer: Statement): WhileStatement;
  1437. PROCEDURE ^ NewRepeatStatement*(position: Position; outer: Statement): RepeatStatement;
  1438. PROCEDURE ^ NewForStatement*(position: Position; outer: Statement): ForStatement;
  1439. PROCEDURE ^ NewLoopStatement*(position: Position; outer: Statement): LoopStatement;
  1440. PROCEDURE ^ NewExitableBlock*(position: Position; outer: Statement): ExitableBlock;
  1441. PROCEDURE ^ NewExitStatement*(position: Position; outer: Statement): ExitStatement;
  1442. PROCEDURE ^ NewReturnStatement*(position: Position; outer: Statement): ReturnStatement;
  1443. PROCEDURE ^ NewAwaitStatement*(position: Position; outer: Statement): AwaitStatement;
  1444. PROCEDURE ^ NewCode*(position: Position; outer: Statement): Code;
  1445. PROCEDURE ^ NewProcedureScope*(outer: Scope): ProcedureScope;
  1446. PROCEDURE ^ NewModuleScope*(): ModuleScope;
  1447. PROCEDURE ^ NewRecordScope*(outer: Scope): RecordScope;
  1448. PROCEDURE ^ NewCellScope*(outer: Scope): CellScope;
  1449. PROCEDURE ^ NewEnumerationScope*(outer: Scope): EnumerationScope;
  1450. PROCEDURE ^ Init;
  1451. BEGIN
  1452. END FoxSyntaxTree.