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
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@lists.inf.ethz.ch] on behalf of thomas.kral@email.cz [thomas.kral@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
Hi Wojciech, I am looking in my copy of V4, does not seem to contain `Def.Mod'. Where it comes from in your version? $ tar -tzf ProjectOberon.V4.tar.gz | grep Def.Mod Many thanks Tomas ---------- Původní zpráva ---------- Od: Skulski, Wojciech <skulski@pas.rochester.edu> Komu: ETH Oberon and related systems <oberon@lists.inf.ethz.ch> Datum: 25. 3. 2017 15:53:54 Předmět: Re: [Oberon] FPGA Oberon - Definition Module Tool "> 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@lists.inf.ethz.ch] on behalf of thomas.kral@ email.cz [thomas.kral@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 -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon "
Hi Wojciech, I am looking in my copy of V4, does not seem to contain `Def.Mod'. Where it comes from in your version? $ tar -tzf ProjectOberon.V4.tar.gz | grep Def.Mod Many thanks Tomas ---------- Původní zpráva ---------- Od: Skulski, Wojciech <skulski@pas.rochester.edu> Komu: ETH Oberon and related systems <oberon@lists.inf.ethz.ch> Datum: 25. 3. 2017 15:53:54 Předmět: Re: [Oberon] FPGA Oberon - Definition Module Tool "> 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@lists.inf.ethz.ch] on behalf of thomas.kral@ email.cz [thomas.kral@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 -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon "
Thomas: I downloaded and installed LinzV4 on the Windows machine. Def.Mod was always part of the V4 distribution. Wojtek ________________________________________ From: thomas.kral@email.cz [thomas.kral@email.cz] Sent: Monday, March 27, 2017 7:14 AM To: ETH Oberon and related systems Cc: Skulski, Wojciech Subject: Re: [Oberon] FPGA Oberon - Definition Module Tool Hi Wojciech, I am looking in my copy of V4, does not seem to contain `Def.Mod'. Where it comes from in your version? $ tar -tzf ProjectOberon.V4.tar.gz | grep Def.Mod Many thanks Tomas ---------- Původní zpráva ---------- Od: Skulski, Wojciech <skulski@pas.rochester.edu> Komu: ETH Oberon and related systems <oberon@lists.inf.ethz.ch> Datum: 25. 3. 2017 15:53:54 Předmět: Re: [Oberon] FPGA Oberon - Definition Module Tool
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@lists.inf.ethz.ch] on behalf of thomas.kral@email.cz [thomas.kral@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 -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
Hi Thomas, what about this one: https://sourceforge.net/p/oberon/oberonv4/ci/master/tree/UV4/Def.Mod regards -- Bernhard From: thomas.kral@email.cz [mailto:thomas.kral@email.cz] Sent: Monday, March 27, 2017 1:14 PM To: ETH Oberon and related systems Subject: Re: [Oberon] FPGA Oberon - Definition Module Tool Hi Wojciech, I am looking in my copy of V4, does not seem to contain `Def.Mod'. Where it comes from in your version? $ tar -tzf ProjectOberon.V4.tar.gz | grep Def.Mod Many thanks Tomas ---------- Původní zpráva ---------- Od: Skulski, Wojciech <skulski@pas.rochester.edu<mailto:skulski@pas.rochester.edu>> Komu: ETH Oberon and related systems <oberon@lists.inf.ethz.ch<mailto:oberon@lists.inf.ethz.ch>> Datum: 25. 3. 2017 15:53:54 Předmět: Re: [Oberon] FPGA Oberon - Definition Module Tool
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@lists.inf.ethz.ch] on behalf of thomas.kral@email.cz<mailto:thomas.kral@email.cz> [thomas.kral@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 -- Oberon@lists.inf.ethz.ch<mailto:Oberon@lists.inf.ethz.ch> mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
Hi Tomas, Note that Def.Mod is written using Oberon-2. If you want to use it on Project Oberon you will have to modify it so that it conforms to the Oberon-07 language report. It would make a good mini-project for you to do to become more familiar with Project Oberon. Here are a couple of tips to get you started: 1. You will need to implement a function named CAP that converts characters in the range "a" to "z" to the corresponding capital letter in the range "A" to "Z". 2. You will need to refactor any code that contains RETURN statements anywhere other than the end of a function PROCEDURE. e.g. replace the following: BEGIN IF sym = eot then RETURN END; sym := none; ln := line ... ... with: BEGIN IF sym # eot THEN sym := none; ln := line ... ... 3. COPY is no longer required to copy character arrays. You can just use an assignment statement: e.g. COPY(x, v) can be written as v := x Regards, Chris Chris Burrows CFB Software http://www.astrobe.com/RISC5 From: Oberon [mailto:oberon-bounces@lists.inf.ethz.ch] On Behalf Of Treutwein Bernhard Sent: Tuesday, 28 March 2017 8:49 PM To: 'thomas.kral@email.cz' Cc: 'ETH Oberon and related systems' Subject: Re: [Oberon] FPGA Oberon - Definition Module Tool Hi Thomas, what about this one: https://sourceforge.net/p/oberon/oberonv4/ci/master/tree/UV4/Def.Mod regards -- Bernhard From: thomas.kral@email.cz [mailto:thomas.kral@email.cz] Sent: Monday, March 27, 2017 1:14 PM To: ETH Oberon and related systems Subject: Re: [Oberon] FPGA Oberon - Definition Module Tool Hi Wojciech, I am looking in my copy of V4, does not seem to contain `Def.Mod'. Where it comes from in your version? $ tar -tzf ProjectOberon.V4.tar.gz | grep Def.Mod Many thanks Tomas ---------- Původní zpráva ---------- Od: Skulski, Wojciech <skulski@pas.rochester.edu> Komu: ETH Oberon and related systems <oberon@lists.inf.ethz.ch> Datum: 25. 3. 2017 15:53:54 Předmět: Re: [Oberon] FPGA Oberon - Definition Module Tool
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@lists.inf.ethz.ch] on behalf of thomas.kral@email.cz [thomas.kral@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 -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
Hi Christopher, Thank you for useful guidelines, I will follow closely. I am also reading Oberon-07 report outlining differences to 02, also Oberon 07 at a glance giving distilled info. I have somehow managed to convert `Splines.Mod' that is referred to in Applications chapters of the project book. Many thanks Tomas ---------- Původní zpráva ---------- Od: Chris Burrows <chris@cfbsoftware.com> Komu: 'ETH Oberon and related systems' <oberon@lists.inf.ethz.ch> Datum: 28. 3. 2017 13:22:18 Předmět: Re: [Oberon] FPGA Oberon - Definition Module Tool "Hi Tomas, Note that Def.Mod is written using Oberon-2. If you want to use it on Project Oberon you will have to modify it so that it conforms to the Oberon- 07 language report. It would make a good mini-project for you to do to become more familiar with Project Oberon. Here are a couple of tips to get you started: 1. You will need to implement a function named CAP that converts characters in the range "a" to "z" to the corresponding capital letter in the range "A" to "Z". 2. You will need to refactor any code that contains RETURN statements anywhere other than the end of a function PROCEDURE. e.g. replace the following: BEGIN IF sym = eot then RETURN END; sym := none; ln := line ... ... with: BEGIN IF sym # eot THEN sym := none; ln := line ... ... 3. COPY is no longer required to copy character arrays. You can just use an assignment statement: e.g. COPY(x, v) can be written as v := x Regards, Chris Chris Burrows CFB Software http://www.astrobe.com/RISC5 From: Oberon [mailto:oberon-bounces@lists.inf.ethz.ch] On Behalf Of Treutwein Bernhard Sent: Tuesday, 28 March 2017 8:49 PM To: 'thomas.kral@email.cz' Cc: 'ETH Oberon and related systems' Subject: Re: [Oberon] FPGA Oberon - Definition Module Tool Hi Thomas, what about this one: https://sourceforge.net/p/oberon/oberonv4/ci/master/ tree/UV4/Def.Mod regards -- Bernhard From: thomas.kral@email.cz [mailto:thomas.kral@email.cz] Sent: Monday, March 27, 2017 1:14 PM To: ETH Oberon and related systems Subject: Re: [Oberon] FPGA Oberon - Definition Module Tool Hi Wojciech, I am looking in my copy of V4, does not seem to contain `Def.Mod'. Where it comes from in your version? $ tar -tzf ProjectOberon.V4.tar.gz | grep Def.Mod Many thanks Tomas ---------- Původní zpráva ---------- Od: Skulski, Wojciech <skulski@pas.rochester.edu> Komu: ETH Oberon and related systems <oberon@lists.inf.ethz.ch> Datum: 25. 3. 2017 15:53:54 Předmět: Re: [Oberon] FPGA Oberon - Definition Module Tool
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@lists.inf.ethz.ch] on behalf of thomas.kral@ email.cz [thomas.kral@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 -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon "
Perhaps CAP and COPY can be offered as procedures exported by one of core modules which are always imported anyway, like Kernel or something. Then the CAP and COPY would not need to be handled on a one-by-one basis. The old software would just compile, as it should. The multiple RETURN will need to be handled, of course. W. ________________________________________ From: Oberon [oberon-bounces@lists.inf.ethz.ch] on behalf of thomas.kral@email.cz [thomas.kral@email.cz] Sent: Wednesday, March 29, 2017 7:48 AM To: chris@cfbsoftware.com; ETH Oberon and related systems Subject: Re: [Oberon] FPGA Oberon - Definition Module Tool Hi Christopher, Thank you for useful guidelines, I will follow closely. I am also reading Oberon-07 report outlining differences to 02, also Oberon07 at a glance giving distilled info. I have somehow managed to convert `Splines.Mod' that is referred to in Applications chapters of the project book. Many thanks Tomas ---------- Původní zpráva ---------- Od: Chris Burrows <chris@cfbsoftware.com> Komu: 'ETH Oberon and related systems' <oberon@lists.inf.ethz.ch> Datum: 28. 3. 2017 13:22:18 Předmět: Re: [Oberon] FPGA Oberon - Definition Module Tool Hi Tomas, Note that Def.Mod is written using Oberon-2. If you want to use it on Project Oberon you will have to modify it so that it conforms to the Oberon-07 language report. It would make a good mini-project for you to do to become more familiar with Project Oberon. Here are a couple of tips to get you started: 1. You will need to implement a function named CAP that converts characters in the range "a" to "z" to the corresponding capital letter in the range "A" to "Z". 2. You will need to refactor any code that contains RETURN statements anywhere other than the end of a function PROCEDURE. e.g. replace the following: BEGIN IF sym = eot then RETURN END; sym := none; ln := line ... ... with: BEGIN IF sym # eot THEN sym := none; ln := line ... ... 3. COPY is no longer required to copy character arrays. You can just use an assignment statement: e.g. COPY(x, v) can be written as v := x Regards, Chris Chris Burrows CFB Software http://www.astrobe.com/RISC5 From: Oberon [mailto:oberon-bounces@lists.inf.ethz.ch] On Behalf Of Treutwein Bernhard Sent: Tuesday, 28 March 2017 8:49 PM To: 'thomas.kral@email.cz' Cc: 'ETH Oberon and related systems' Subject: Re: [Oberon] FPGA Oberon - Definition Module Tool Hi Thomas, what about this one: https://sourceforge.net/p/oberon/oberonv4/ci/master/tree/UV4/Def.Mod regards -- Bernhard From: thomas.kral@email.cz [mailto:thomas.kral@email.cz] Sent: Monday, March 27, 2017 1:14 PM To: ETH Oberon and related systems Subject: Re: [Oberon] FPGA Oberon - Definition Module Tool Hi Wojciech, I am looking in my copy of V4, does not seem to contain `Def.Mod'. Where it comes from in your version? $ tar -tzf ProjectOberon.V4.tar.gz | grep Def.Mod Many thanks Tomas ---------- Původní zpráva ---------- Od: Skulski, Wojciech <skulski@pas.rochester.edu> Komu: ETH Oberon and related systems <oberon@lists.inf.ethz.ch> Datum: 25. 3. 2017 15:53:54 Předmět: Re: [Oberon] FPGA Oberon - Definition Module Tool
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@lists.inf.ethz.ch] on behalf of thomas.kral@email.cz [thomas.kral@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 -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
Def.Mod is written using Oberon-2.
Hi, Reviving an old post. I got `Def.Mod' doing things, when run on itself, I got exported comments (did not know they existed) but NO exported procedures, ther should be just one i.e. `Show()' DEFINITION Def; (*CAS 10 Jul 92 / TK 8.10.2018 RISC*) (* ( "*" | "^" | name ) [ "/P" ] --P option enforces plain text style *) END Def. On module `Out.Mod' I got all with extra line after definition. DEFINITION Out; PROCEDURE Char(ch: CHAR); PROCEDURE String(s: ARRAY OF CHAR); PROCEDURE Int(i, n: INTEGER); PROCEDURE Hex(i: INTEGER); PROCEDURE Real(x: REAL; n: INTEGER); PROCEDURE Bool(bl: BOOLEAN); PROCEDURE Bin(wd, n: INTEGER); PROCEDURE Ln; END Out. Generally I am not able to report any exported variables. Just thinking, as the Oberon-7 grammar slightly differs to Oberon-2, `scanner' and `projector' needs some tinkering possibly? I already excluded CLASS type from the scanner as that is not part of the grammar. -- Tomas Kral <thomas.kral@email.cz>
On Mon, 8 Oct 2018 17:31:44 +0200 Tomas Kral <thomas.kral@email.cz> wrote:
Just thinking, as the Oberon-7 grammar slightly differs to Oberon-2, `scanner' and `projector' needs some tinkering possibly?
Just tried under ARM, works alright there with expanded grammar. So I must have done something wrong around comment or procedure parsing. -- Tomas Kral <thomas.kral@email.cz>
participants (5)
-
Chris Burrows -
Skulski, Wojciech -
thomas.kral@email.cz -
Tomas Kral -
Treutwein Bernhard