orc
Class Orc

java.lang.Object
  extended by orc.Orc

public class Orc
extends java.lang.Object

Main class for Orc. Parses Orc file and executes it.

Run with the argument "-help" to get a list of command-line options.

Author:
wcook, dkitchin

Constructor Summary
Orc()
           
 
Method Summary
static Expression compile(java.io.Reader source, Config cfg)
           
static Expression compile(java.io.Reader source, Config cfg, boolean includeStdlib)
           
protected static Node compile(java.io.Reader source, Node target, Config cfg)
           
static java.io.File createTmpdir(java.lang.String prefix)
          Create a new temporary directory and return the path to that directory.
static boolean deleteDirectory(java.io.File directory)
          Delete a directory recursively
static void main(java.lang.String[] args)
          Orc toplevel main function.
static java.io.Reader openInclude(java.lang.String name)
          Open an include file.
static OrcInstance runEmbedded(java.io.File source)
          Deprecated.  
static OrcInstance runEmbedded(java.io.Reader source)
          Deprecated.  
static OrcInstance runEmbedded(java.io.Reader source, Config cfg)
          Deprecated.  
static OrcInstance runEmbedded(java.lang.String source)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Orc

public Orc()
Method Detail

main

public static void main(java.lang.String[] args)
Orc toplevel main function. Command line arguments are forwarded to Config for parsing.

Parameters:
args -

compile

public static Expression compile(java.io.Reader source,
                                 Config cfg)
                          throws ParseError
Throws:
ParseError

openInclude

public static java.io.Reader openInclude(java.lang.String name)
                                  throws java.io.FileNotFoundException
Open an include file. Include files are actually stored as class resources, so that they will continue to work when Orc is deployed as a servlet or JAR, so you can't use any old filename. Specifically, the filename is always interpreted relatively to the orc.inc package, and you can't use "." or ".." in paths.

TODO: support relative names correctly.

Parameters:
name - of the include file relative to orc/inc (e.g. "prelude.inc")
Returns:
Reader to read the file.
Throws:
java.io.FileNotFoundException - if the resource is not found.

compile

public static Expression compile(java.io.Reader source,
                                 Config cfg,
                                 boolean includeStdlib)
                          throws ParseError
Throws:
ParseError

compile

protected static Node compile(java.io.Reader source,
                              Node target,
                              Config cfg)

runEmbedded

public static OrcInstance runEmbedded(java.lang.String source)
Deprecated. 


runEmbedded

public static OrcInstance runEmbedded(java.io.File source)
Deprecated. 


runEmbedded

public static OrcInstance runEmbedded(java.io.Reader source)
Deprecated. 


runEmbedded

public static OrcInstance runEmbedded(java.io.Reader source,
                                      Config cfg)
Deprecated. 

Compile an Orc source program from the given input stream. Start a new Orc engine running this program in a separate thread. Returns an OrcInstance object with information about the running instance.

Parameters:
source -
cfg -

createTmpdir

public static java.io.File createTmpdir(java.lang.String prefix)
                                 throws java.io.IOException
Create a new temporary directory and return the path to that directory. The directory will NOT be deleted automatically; you can use deleteDirectory to do that when you are done with it.

Throws:
java.io.IOException

deleteDirectory

public static boolean deleteDirectory(java.io.File directory)
Delete a directory recursively