|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--pnuts.lang.PnutsImpl
This class defines an abstract interface of script interpreter's implementation, It also gives the default implementation, which is a pure interpreter.
Context.setPnutsImpl()
,
Context.getPnutsImpl()
Constructor Summary | |
PnutsImpl()
|
Method Summary | |
java.lang.Object |
accept(SimpleNode node,
Context context)
|
protected void |
checkException(Context context,
java.lang.Throwable t)
Check if any exception handler for the specified exception is defined. |
java.lang.Object |
eval(java.lang.String str,
Context context)
Evaluate an expreesion |
java.lang.Object |
load(java.io.Reader reader,
Context context)
|
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 |
protected void |
popFile(Context context)
Tell the context that the current script file has been completed. |
protected void |
pushFile(java.lang.Object file,
Context context)
Tell the context that it's started processing the script file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PnutsImpl()
Method Detail |
public java.lang.Object eval(java.lang.String str, Context context)
expr
- the expression to be evaluatedcontext
- the context in which the expression is evaluatedpublic java.lang.Object loadFile(java.lang.String filename, Context context) throws java.io.FileNotFoundException
filename
- the file name of the scriptcontext
- the context in which the expression is evaluatedpublic java.lang.Object load(java.lang.String file, Context context) throws java.io.FileNotFoundException
file
- the name of the scriptcontext
- the context in which the script is executedpublic java.lang.Object load(java.net.URL scriptURL, Context context)
scriptURL
- the URL of the scriptcontext
- the context in which the script is executedpublic java.lang.Object load(java.io.Reader reader, Context context)
public java.lang.Object accept(SimpleNode node, Context context)
protected void pushFile(java.lang.Object file, Context context)
protected void popFile(Context context)
protected void checkException(Context context, java.lang.Throwable t)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |