MINERVA text processing and blackboards used for program conversion;...
Move to
Next Prev
Up Top
See also
Calculator
Eliza
JigsawPuzzle
CAD data exchange and processing with STEP/Express ISO-10303-21
CircuitAnalysis
Othello
SymbolicMath
SMTP Client
Welding Robot
Goban
ConvertGui
IF Computer > MINERVA > Example Programs > Applications > ConvertGui

ConvertGui

MINERVA text processing and blackboards used for program conversion; here to convert a MINERVA source program from old (until MINERVA 1.2) to new (from MINERVA 1.3) gui predicates.

The converter convgui.min is 50 lines, driven by the specification given in oldgui.min.

The example is configured as standalone application. Invoke e.g. on Unix with

	Go.sh myguiprogram.min
which will generate myguiprogram.min.new

The conversion is implemented with string replacement using substitute_all/4 for all lines of the source file and for all conversions defined in "oldgui.min".

From the manual:

	substitute_all(+regexp, +string, +substitution, -result)
        	In "string" replaces all substrings defined by "regexp"
        	with "substitution". The modified string is returned
        	in "result".

The program first reads oldgui.min

	applet__get_code_base(A,B) :-
		applet_getCodeBase(A,B).
	applet__get_document_base(A,B) :-
		applet_getDocumentBase(A,B).
		:
second converts its clauses into a procedure to convert strings like
	applet__get_code_base --> applet_getCodeBase
	applet__get_document_base --> applet_getDocumentBase
		:

finally applies this procedure to all lines of the source program.

read on...
MINERVA
ifcomputer logo
f
Expert Services on the Web
Language
English
Japanese
Server
USA
Japan
Site Access
Local Index
Local Contents
Site Contents
Site Index
Printer Friendly
For imode
For PDA
Search
document: http://www.ifcomputer.co.jp/MINERVA/ExamplePrograms/Applications/ConvertGui/home_en.html
published 2008/5/12 update 2001/4/2 (c) 1996-2006 IF Computer Japan
IF Computer 5-28-2 Sendagi, Bunkyo-ku Tel +81-3-5814-3352 info@ifcomputer.com
Customer Support Tokyo 113-0022 Japan   http://www.ifcomputer.com
scroll to top managed with ubiCMS