FoxSyntaxTree.SymU 61 KB

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