com.caucho.quercus.program
Class QuercusProgram

java.lang.Object
  extended by com.caucho.quercus.program.QuercusProgram

public class QuercusProgram
extends java.lang.Object

Represents a compiled Quercus program.


Constructor Summary
QuercusProgram(QuercusContext quercus, Path sourceFile, java.util.HashMap<java.lang.String,Function> functionMap, java.util.ArrayList<Function> functionList, java.util.HashMap<java.lang.String,InterpretedClassDef> classMap, java.util.ArrayList<InterpretedClassDef> classList, FunctionInfo functionInfo, Statement statement)
          Creates a new quercus program
QuercusProgram(QuercusContext quercus, Path sourceFile, QuercusPage page)
          Creates a new quercus program
 
Method Summary
 void addDepend(Path path)
          Adds a dependency.
 QuercusProgram createExprReturn()
          Creates a return for the final expr.
 Value execute(Env env)
          Execute the program
 AbstractFunction findFunction(java.lang.String name)
          Finds a function.
 void finishCompiling()
          Notifies waiting listeners that compilation has finished.
 java.util.Collection<InterpretedClassDef> getClasses()
          Returns the classes.
 java.util.ArrayList<InterpretedClassDef> getClassList()
          Returns the functions.
 QuercusPage getCompiledPage()
          Returns the compiled page.
 java.lang.Throwable getCompileException()
           
 java.util.ArrayList<PersistentDependency> getDependencyList()
           
 FunctionInfo getFunctionInfo()
           
 java.util.ArrayList<Function> getFunctionList()
          Returns the functions.
 java.util.Collection<Function> getFunctions()
          Returns the functions.
 QuercusContext getPhp()
          Returns the engine.
 QuercusPage getProfilePage()
          Returns the profiling page.
 AbstractFunction[] getRuntimeFunctionList()
           
 Path getSourcePath()
          Returns the source path.
 Statement getStatement()
           
 void importDefinitions(Env env)
          Imports the page definitions.
 void init(Env env)
          Imports the page definitions.
 boolean isCompilable()
          Returns true if the page can be compiled or it is unknown.
 boolean isCompiling()
          Returns true if this page is being compiled.
 boolean isModified()
          Returns true if the function is modified.
 void setCompilable(boolean isCompilable)
          Set to false if page cannot be compiled.
 void setCompiledPage(QuercusPage page)
          Sets the compiled page.
 void setCompileException(java.lang.Throwable e)
           
 void setProfilePage(QuercusPage page)
          Sets the profiling page.
 boolean setRuntimeFunction(AbstractFunction[] funList)
          Sets a runtime function array after an env.
 boolean startCompiling()
          Start compiling
 java.lang.String toString()
           
 void waitForCompile()
          Set to true if this page is being compiled.
 void waitForRuntimeFunctionList(long timeout)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QuercusProgram

public QuercusProgram(QuercusContext quercus,
                      Path sourceFile,
                      java.util.HashMap<java.lang.String,Function> functionMap,
                      java.util.ArrayList<Function> functionList,
                      java.util.HashMap<java.lang.String,InterpretedClassDef> classMap,
                      java.util.ArrayList<InterpretedClassDef> classList,
                      FunctionInfo functionInfo,
                      Statement statement)
Creates a new quercus program

Parameters:
quercus - the owning quercus engine
sourceFile - the path to the source file
statement - the top-level statement

QuercusProgram

public QuercusProgram(QuercusContext quercus,
                      Path sourceFile,
                      QuercusPage page)
Creates a new quercus program

Parameters:
quercus - the owning quercus engine
sourceFile - the path to the source file
statement - the top-level statement
Method Detail

getPhp

public QuercusContext getPhp()
Returns the engine.


getSourcePath

public Path getSourcePath()
Returns the source path.


getFunctionInfo

public FunctionInfo getFunctionInfo()

getStatement

public Statement getStatement()

startCompiling

public boolean startCompiling()
Start compiling


finishCompiling

public void finishCompiling()
Notifies waiting listeners that compilation has finished.


waitForCompile

public void waitForCompile()
Set to true if this page is being compiled.


isCompiling

public boolean isCompiling()
Returns true if this page is being compiled.


setCompilable

public void setCompilable(boolean isCompilable)
Set to false if page cannot be compiled.


isCompilable

public boolean isCompilable()
Returns true if the page can be compiled or it is unknown.


setCompileException

public void setCompileException(java.lang.Throwable e)

getCompileException

public java.lang.Throwable getCompileException()

addDepend

public void addDepend(Path path)
Adds a dependency.


getDependencyList

public java.util.ArrayList<PersistentDependency> getDependencyList()

isModified

public boolean isModified()
Returns true if the function is modified.


getCompiledPage

public QuercusPage getCompiledPage()
Returns the compiled page.


setCompiledPage

public void setCompiledPage(QuercusPage page)
Sets the compiled page.


getProfilePage

public QuercusPage getProfilePage()
Returns the profiling page.


setProfilePage

public void setProfilePage(QuercusPage page)
Sets the profiling page.


findFunction

public AbstractFunction findFunction(java.lang.String name)
Finds a function.


getFunctions

public java.util.Collection<Function> getFunctions()
Returns the functions.


getFunctionList

public java.util.ArrayList<Function> getFunctionList()
Returns the functions.


getClasses

public java.util.Collection<InterpretedClassDef> getClasses()
Returns the classes.


getClassList

public java.util.ArrayList<InterpretedClassDef> getClassList()
Returns the functions.


createExprReturn

public QuercusProgram createExprReturn()
Creates a return for the final expr.


execute

public Value execute(Env env)
Execute the program

Parameters:
env - the calling environment
Returns:
null if there is no return value

init

public void init(Env env)
Imports the page definitions.


setRuntimeFunction

public boolean setRuntimeFunction(AbstractFunction[] funList)
Sets a runtime function array after an env.


getRuntimeFunctionList

public AbstractFunction[] getRuntimeFunctionList()

waitForRuntimeFunctionList

public void waitForRuntimeFunctionList(long timeout)

importDefinitions

public void importDefinitions(Env env)
Imports the page definitions.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object