The use of metagen to automatically generate a ...
Move to
Next Prev
Up Top
See also
HelloWorld
Use Parameters
Directives
Debugger
Arithmetic
Constraints
File From Server
AppletLoadsFile
GetURL
Client-Server with Sockets
Date
ExecProcess
ExecProcess_2
GUI
GuiEvents
Gui Image
Interactive
JavaToMinerva_1
JavaToMinerva_2
JavaToMinerva_3
JavaToMinerva_4
JavaToMinerva_5
JavaToMinerva_6
Java Applet Uses Minerva
JavaArrays
MinervaToJava
MinervaToJavaScript
MinervaToJava_1
MinervaToJava_2
MinervaToJava_3
MinervaToJava_4
Reflection
Servlet
JDBC
Internationalization
StartupArchive
IF Computer > MINERVA > Example Programs > MINERVA Features > MinervaToJava

MinervaToJava

The use of metagen to automatically generate a MINERVA package from an existing Java class.

The example shows how to build a program "random.min" that provides one predicate for every constructor and method of defined by the Java class java.util.Random .

Note that metagen works for any class available at compile time.

To see it in action, use Go.* and Compile.* of this directory.

Here are the sources:

use_random.min

:- package(random).

main(_Args) :- random_create(RandomSequence), for(1,I,20), random_nextInt_1(RandomSequence,100,Random), write(Random),write(' '),flush_output, I = 20, nl,flush_output.

Compile.sh

#!/bin/sh
echo -n ':- ' > random.min
minerva -l $MINERVA_HOME/extender/metagen java.util.Random >> random.min
minervac random
minervac use_random

Go.sh

#!/bin/sh
minerva -l use_random

Please note that the class Random used in this example is not supported in current versions of Microsoft Java environments. Use some other class.

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/MinervaFeatures/MinervaToJava/home_en.html
published 2008/7/21 update 2002/3/20 (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