com.svincent.moksa
Class PrologPackageManager

java.lang.Object
  |
  +--com.svincent.moksa.WamObject
        |
        +--com.svincent.moksa.PrologPackageManager

public class PrologPackageManager
extends WamObject

Manages Prolog source.

Currently operates on a "class path" concept, with no versioning, and thus, all the same issues as the normal Java classloader has.

By default, the prolog path includes the Java CLASSPATH, as well as searching in the 'library' subdirectory of the installation directory.


Inner Class Summary
static class PrologPackageManager.PrologClassLoader
           
 
Constructor Summary
PrologPackageManager(PrologEngine _engine)
           
 
Method Summary
 void addDirs(java.lang.String path)
          Add all the directories (and archive files) in the given path to the Prolog search path.
 void addJarDirs(java.lang.String path)
          Add all the archive files in the directories in the given path to the Prolog search path.
static java.lang.String calculateClassName(java.lang.String prologSourceName)
           
 java.io.File findClass(java.lang.String className)
          Find the location of the file corresponding to the given class in the current prolog search path.
 java.io.File findFile(java.lang.String fileName)
          Find the first file with the given name in the path, return it.
 java.io.File findModule(java.lang.String moduleName)
          Finds a Prolog module.
 void loadModule(PrologEngine engine, PrologParser parser, java.lang.String moduleName)
           
 void loadModule(PrologEngine engine, java.lang.String moduleName)
          Loads the given filename into the given PrologEngine.
static void main(java.lang.String[] args)
           
static void readProlog(PrologEngine engine, PrologParser parser, java.lang.String fileName)
           
 
Methods inherited from class com.svincent.moksa.WamObject
tag, tag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrologPackageManager

public PrologPackageManager(PrologEngine _engine)
Method Detail

findModule

public java.io.File findModule(java.lang.String moduleName)

Finds a Prolog module. It can either return a class file or a Prolog source file, depending on the ages of the relative files.


findClass

public java.io.File findClass(java.lang.String className)
Find the location of the file corresponding to the given class in the current prolog search path. Return null if nothing is found.

findFile

public java.io.File findFile(java.lang.String fileName)
Find the first file with the given name in the path, return it. Search the path for this file, then return the File corresponding to the archive or directory in which it can be found. Return null if nothing is found.

addDirs

public void addDirs(java.lang.String path)
Add all the directories (and archive files) in the given path to the Prolog search path.

addJarDirs

public void addJarDirs(java.lang.String path)
Add all the archive files in the directories in the given path to the Prolog search path.

main

public static void main(java.lang.String[] args)

loadModule

public void loadModule(PrologEngine engine,
                       java.lang.String moduleName)
                throws PrologException
Loads the given filename into the given PrologEngine. Searches for an appropriate Loader instance first.

loadModule

public void loadModule(PrologEngine engine,
                       PrologParser parser,
                       java.lang.String moduleName)
                throws PrologException

calculateClassName

public static java.lang.String calculateClassName(java.lang.String prologSourceName)

readProlog

public static void readProlog(PrologEngine engine,
                              PrologParser parser,
                              java.lang.String fileName)
                       throws PrologException



This is documentation for Moksa Prolog, which can be found at http://www.svincent.com/moksa/

Copyright © 1999 Shawn P. Vincent.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.