pnuts.lang
Interface Implementation

All Known Implementing Classes:
CachedPnutsImpl, CompilerPnutsImpl, ImplementationAdapter, JAASPnutsImpl, PnutsImpl, PnutsImplAdapter, SecurePnutsImpl

public interface Implementation

Defines an abstract interface of script interpreter's implementation,

See Also:
Context.setImplementation(Implementation), Context.getImplementation()

Method Summary
 java.lang.Object accept(SimpleNode node, Context context)
          Interpret an AST
 java.lang.Object eval(java.lang.String expr, Context context)
          Evaluate an expreesion
 java.lang.Object load(java.lang.String file, Context context)
          Load a script file using classloader
 java.lang.Object load(java.net.URL scriptURL, Context context)
          Load a script file from a URL
 java.lang.Object loadFile(java.lang.String filename, Context context)
          Load a script file from local file system
 

Method Detail

eval

java.lang.Object eval(java.lang.String expr,
                      Context context)
Evaluate an expreesion

Parameters:
expr - the expression to be evaluated
context - the context in which the expression is evaluated
Returns:
the result of the evaluation

loadFile

java.lang.Object loadFile(java.lang.String filename,
                          Context context)
                          throws java.io.FileNotFoundException
Load a script file from local file system

Parameters:
filename - the file name of the script
context - the context in which the expression is evaluated
Returns:
the result of the evaluation
Throws:
java.io.FileNotFoundException

load

java.lang.Object load(java.lang.String file,
                      Context context)
                      throws java.io.FileNotFoundException
Load a script file using classloader

Parameters:
file - the name of the script
context - the context in which the script is executed
Returns:
the result of the evaluation
Throws:
java.io.FileNotFoundException

load

java.lang.Object load(java.net.URL scriptURL,
                      Context context)
Load a script file from a URL

Parameters:
scriptURL - the URL of the script
context - the context in which the script is executed
Returns:
the result of the evaluation

accept

java.lang.Object accept(SimpleNode node,
                        Context context)
Interpret an AST

Parameters:
node - the AST
context - the context in which the AST is interpreted