org.jscience.computing.ai.expertsystem.compiler
Class Main

java.lang.Object
  extended by org.jscience.computing.ai.expertsystem.compiler.Main
All Implemented Interfaces:
TokenConstants

public class Main
extends java.lang.Object
implements TokenConstants

Main class in the Jeops phase of converting rule files into Java classes.

When invoked, the method convert() will create a java file in the same directory as the rule file (with the extension changed from .rules to .java). In this way, rule files can be grouped into packages in the same way as java classes.


Field Summary
 
Fields inherited from interface org.jscience.computing.ai.expertsystem.compiler.parser.TokenConstants
ACTIONS, ASTERISK, CLOSE_CURLY_BRACKET, COMMA, COMMENT, CONDITIONS, DECLARATIONS, DOT, EOF, EQUALS, ERROR, EXTENDS, IDENT, IMPLEMENTS, IMPORT, LOCALDECL, NONE_ABOVE, OPEN_CURLY_BRACKET, PACKAGE, PUBLIC, RULE, RULE_BASE, SEMICOLON, STRING, WHITE_SPACE
 
Constructor Summary
Main(java.lang.String ruleFileName)
          Class constructor.
 
Method Summary
 void convert()
          Creates a java source file that behaves as defined in the rules file.
static void main(java.lang.String[] args)
          Test method for this class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Main

public Main(java.lang.String ruleFileName)
     throws java.io.IOException
Class constructor.

Parameters:
ruleFileName - the name of the rules file.
Throws:
java.io.IOException - if some IO error occurs.
Method Detail

convert

public void convert()
             throws java.io.IOException,
                    JeopsException
Creates a java source file that behaves as defined in the rules file.

Throws:
java.io.IOException - if some IO error occurs.
JeopsException - if some error occurs while converting the rule.

main

public static void main(java.lang.String[] args)
Test method for this class.

Parameters:
args - command-line arguments. None is needed, but one can pass the rule file name for the converting.