[Oberon] FPGA Oberon - Definition Module Tool

Skulski, Wojciech skulski at pas.rochester.edu
Sat Mar 25 15:38:44 CET 2017


> I am thinking of a simple tool that could extract definition info from *.Mod

How about Def.Mod which is available under Oberon System V4?

Right click on "Def.Show Def.Mod" opens a new viewer with the following:

DEFINITION Def;	(* CAS  *)

	PROCEDURE Show;	(* ( "*" | "^" | name ) [ "\P" ]   --P option enforces plain text style *)
END Def.
----------------------------------------------------------------
Def.Show Documents.Mod opens the following viewer:

DEFINITION Documents;
	CONST
		profile = "Documents.Profile";	(* on startup all openers contained in this file are registered automatically *)
	TYPE
		Opener = POINTER TO RECORD
			pattern-, cmd-: ARRAY 32 OF CHAR;
			next-: Opener
		END;
	VAR
		openers-: Opener;
	PROCEDURE Open;	(* ^ | name	Opens the specified file with the registered opener, if no specific opener is found for the extension of the file, Edit.Open is used. *)
	PROCEDURE RegisterOpener (pattern, command: ARRAY OF CHAR);	(* Registers the opener command for the pattern. Openers that are registered earlier can be overwritten by (more specific) openers registered later. *)
	PROCEDURE RegisterOpeners;	(* ^ | filename	Registers all the openers contained in the specified file. Their precedence is as they appear in the file. *)
END Documents.

________________________________________
From: Oberon [oberon-bounces at lists.inf.ethz.ch] on behalf of thomas.kral at email.cz [thomas.kral at email.cz]
Sent: Friday, March 24, 2017 7:52 AM
To: ETH Oberon and related systems
Subject: [Oberon] FPGA Oberon - Definition Module Tool

Hi,

I am thinking of a simple tool that could extract definition info from *.Mod and produce respective *.Def file. Definition files can be quickly looked at, to remind a programmer of the interface *.Mod modules export.

While on Linux one could use grep
$ grep PROCEDURE\ * *.Mod.txt

to obtain info at least about procedures, but how about exported types and variables?

I am looking for a recommended way how to simply code such a tool, is it a good idea to use `ORP' parser somehow for the task? I prefer to code it simple, does not have to be perfect, but should carry the idea.

Tomas


More information about the Oberon mailing list