|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.millscript.millscript.vm.Package
public class Package
This class represents a MillScript Package.
| Constructor Summary | |
|---|---|
Package(Engine e,
java.lang.String fqn,
boolean b)
Constructs a new package with the given fully qualified name and nickname. |
|
| Method Summary | |
|---|---|
void |
addInventory(org.millscript.commons.vfs.VFolder dir)
Adds the contents of the specified Inventory to the set of autoloadable variables. |
void |
autoload(java.lang.String sym)
Autoloads the bindings for the specified symbol. |
org.millscript.commons.util.MapIterator<java.lang.String,Loader> |
autoloadablesIterator()
Returns an iterator over all the autoloadable symbols in this package. |
GlobalIdent |
bind(java.lang.String sym,
java.lang.Object obj)
Makes a binding in this package from the specified symbol to the specified object. |
void |
bindConst(java.lang.String sym,
java.lang.Object obj)
Makes a binding in this package from the specified symbol to the specified object. |
org.millscript.commons.util.MapIterator<java.lang.String,GlobalIdent> |
bindingsIterator()
Returns an iterator over all the bindings in this package. |
void |
bindProtectedConst(java.lang.String sym,
java.lang.Object obj)
Makes a binding in this package from the specified symbol to the specified object. |
void |
bindProtectedVar(java.lang.String sym,
java.lang.Object obj)
Makes a binding in this package from the specified symbol to the specified object. |
protected GlobalIdent |
bindRef(java.lang.String sym,
Ref ref)
Makes a binding in this package from the specified symbol to the specifed reference. |
void |
bindVar(java.lang.String sym,
java.lang.Object obj)
Makes a binding in this package from the specified symbol to the specified object. |
GlobalIdent |
declareGlobal(java.lang.String sym)
Declares the specified symbol as a global symbol. |
GlobalIdent |
findIdentFor(java.lang.String nn,
java.lang.String sym)
Returns the ident for the specified global symbol. |
CompilerState |
getCompilerState()
Returns a new compiler state for this package. |
Configuration |
getConfig()
Returns this packages configuration. |
java.lang.String |
getFullyQualifiedPackageName()
Returns this packages fully qualified name. |
boolean |
getIsProtected(java.lang.String sym)
Returns true if the specified symbol is protected. |
boolean |
hasBindingFor(java.lang.String sym)
Returns true if the supplied symbol has a binding in this package. |
Package |
hasPervasiveImport(java.lang.String sym)
Looks to see if the specified symbol is already imported in a pervasive package. |
void |
importPackage(java.lang.String nn,
Package p)
Imports the specified package object into this package, with the given nickname. |
void |
importPackage(java.lang.String nn,
java.lang.String fqn)
Imports the specified fully qualified package into this package, with the given nickname. |
void |
interpret(java.lang.String origin,
java.io.Reader r)
Interprets the characters returned by the specified reader into this package. |
void |
interpret(java.lang.String origin,
java.lang.String s)
Interprets the contents of the specified string into this package. |
void |
interpret(org.millscript.commons.vfs.VFile f)
Interprets the bytes returned from reading the specified file as UTF-8 text, into this package. |
void |
loadConf(Source source)
Loads the specified configuration for this package. |
void |
loadConf(java.lang.String origin,
java.io.Reader r)
Loads the specified configuration for this package. |
void |
loadConf(org.millscript.commons.vfs.VFile packageConf)
Loads the specified configuration for this package. |
Loader |
makeLoaderFor(org.millscript.commons.vfs.VEntry e)
Returns the relevant loader for the specified virtual entry, if one is available. |
java.lang.Object |
valueOf(java.lang.String sym)
Returns the reference associated with the specified symbol. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Package(Engine e,
java.lang.String fqn,
boolean b)
e - the engine this package is associated withfqn - the new packages fully qualified nameb - a boolean indicating if this package is pervasive| Method Detail |
|---|
public void addInventory(org.millscript.commons.vfs.VFolder dir)
dir - the inventory to addpublic void autoload(java.lang.String sym)
sym - the symbol to load bindings forpublic org.millscript.commons.util.MapIterator<java.lang.String,Loader> autoloadablesIterator()
public GlobalIdent bind(java.lang.String sym,
java.lang.Object obj)
sym - the symbol to bind the object to.obj - the object to bind to the specified symbol.
public void bindConst(java.lang.String sym,
java.lang.Object obj)
sym - the symbol to bind the object to.obj - the object to bind to the specified symbol.
public void bindVar(java.lang.String sym,
java.lang.Object obj)
sym - the symbol to bind the object to.obj - the object to bind to the specified symbol.
public void bindProtectedConst(java.lang.String sym,
java.lang.Object obj)
sym - the symbol to bind the object to.obj - the object to bind to the specified symbol.
public void bindProtectedVar(java.lang.String sym,
java.lang.Object obj)
sym - the symbol to bind the object to.obj - the object to bind to the specified symbol.
protected GlobalIdent bindRef(java.lang.String sym,
Ref ref)
sym - the symbol to bind the reference to.ref - the reference to bind to the specified symbol.
public org.millscript.commons.util.MapIterator<java.lang.String,GlobalIdent> bindingsIterator()
public GlobalIdent declareGlobal(java.lang.String sym)
null reference. This method is
sym - the symbol to declare as a global variable
public GlobalIdent findIdentFor(java.lang.String nn,
java.lang.String sym)
nn - the nickname of the package the request symbol was imported
withsym - the symbol you wish to find.
public CompilerState getCompilerState()
public Configuration getConfig()
public java.lang.String getFullyQualifiedPackageName()
public boolean getIsProtected(java.lang.String sym)
true if the specified symbol is protected.
sym - the symbol to test protected status for
true if the symbol is protected.public boolean hasBindingFor(java.lang.String sym)
sym - the symbol to test for
true if the symbol has a binding and
false otherwise.public final Package hasPervasiveImport(java.lang.String sym)
sym - the symbol to look for.
null
public void importPackage(java.lang.String nn,
java.lang.String fqn)
nn - the nickname for the imported packagefqn - the fully qualified name of the package to import.
public void importPackage(java.lang.String nn,
Package p)
nn - the nickname for the imported packagep - the package object to import.public void interpret(org.millscript.commons.vfs.VFile f)
f - the File to read from.
public void interpret(java.lang.String origin,
java.io.Reader r)
origin - the origin message for the readerr - the reader to interpret characters from.
public void interpret(java.lang.String origin,
java.lang.String s)
origin - the origin message for the readers - the string to interpret.
public void loadConf(java.lang.String origin,
java.io.Reader r)
origin - the origin message for the configurationr - a reader to read the configuration frompublic void loadConf(org.millscript.commons.vfs.VFile packageConf)
packageConf - a File specifying the configuration file for this
package.public void loadConf(Source source)
source - a Source to read configuration frompublic Loader makeLoaderFor(org.millscript.commons.vfs.VEntry e)
e - the VEntry to make a loader for.
nullpublic java.lang.Object valueOf(java.lang.String sym)
sym - the symbol to find a value for.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||