org.millscript.millscript.vm
Class Machine

java.lang.Object
  extended by org.millscript.millscript.vm.TraceableMachine
      extended by org.millscript.millscript.vm.BasicMachine
          extended by org.millscript.millscript.vm.Machine
All Implemented Interfaces:
org.millscript.commons.alert.AlertDecorator

public final class Machine
extends BasicMachine
implements org.millscript.commons.alert.AlertDecorator

This class implements the MillScript machine.


Field Summary
 
Fields inherited from class org.millscript.millscript.vm.BasicMachine
piggyBank, valueStack
 
Fields inherited from class org.millscript.millscript.vm.TraceableMachine
doingIndex
 
Constructor Summary
Machine(Configuration c)
          Constructs a new machine with the specified configuration.
 
Method Summary
 org.millscript.commons.alert.Alert decorate(org.millscript.commons.alert.Alert alert)
           
 Configuration getConfig()
          Returns this machines configuration.
 Binding popBinding()
          Pops a regular expression Binding off the stack and returns it.
 java.lang.Boolean popBoolean()
          Pops a Boolean off the stack and returns it.
 java.util.Calendar popCalendar()
          Pops a Calendar off the stack and returns it.
 java.lang.Character popCharacter()
          Pops a Character off the stack and returns it.
 DatabaseSource popDatabaseSource()
          Pops a DatabaseSource off the stack and returns it.
 Fragment popFragment()
          Pops a Fragment off the stack and returns it.
 Function popFunction()
          Pops a Function off the stack and returns it.
 org.millscript.commons.util.IList popIList()
          Pops a List off the stack and returns it.
 Image popImage()
          Pops an Image off the stack and returns it.
 org.millscript.commons.util.IMap popIMap()
          Pops a Map off the stack and returns it.
 int popInt()
          Pops an int off the stack and returns it.
 java.lang.Integer popInteger()
          Pops an Integer off the stack and returns it.
 java.lang.Object[] popObjectArray()
          Pops an object array off the stack and returns it.
 java.util.regex.Pattern popPattern()
          Pops a traditional regular expression Pattern off the stack and returns it.
 SpiceClass popSpiceClass()
          Pops a Spice Class off the stack and returns it.
 SpiceObject popSpiceObject()
          Pops a Spice Object off the stack and returns it.
 java.lang.String popString()
          Pops a String off the stack and returns it.
 Page popURL()
          Pops a URL off the stack and returns it.
 XmlComment popXmlComment()
          Pops an XmlComment off the stack and returns it.
 XmlElement popXmlElement()
          Pops an XmlElement off the stack and returns it.
 void printResults(boolean interactive)
          Clears the value stack, optionally printing all the objects left on it.
 
Methods inherited from class org.millscript.millscript.vm.BasicMachine
getCount, getIndex, peekObject, pokeObject, popArgsArray, popArgsIntoArray, popArgsIterator, popArgsList, popObject, pushArgsArray, pushArgsIterator, pushArgsList, pushArgsMapIterator, pushBoolean, pushObject, reset, restoreSaved, saveRef, setCount, startSaving
 
Methods inherited from class org.millscript.millscript.vm.TraceableMachine
doingList, enterFunction, enterUpdater, exitFunction, exitUpdater
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Machine

public Machine(Configuration c)
Constructs a new machine with the specified configuration.

Parameters:
c - the configuration for this machine
Method Detail

decorate

public org.millscript.commons.alert.Alert decorate(org.millscript.commons.alert.Alert alert)
Specified by:
decorate in interface org.millscript.commons.alert.AlertDecorator
See Also:
AlertDecorator.decorate(org.millscript.commons.alert.Alert)

getConfig

public Configuration getConfig()
Returns this machines configuration.

Returns:
this machines configuration

popBinding

public Binding popBinding()
Pops a regular expression Binding off the stack and returns it.

Returns:
a Binding from the top of the stack
Throws:
AlertException - if the stack item cannot be cast to a Binding

popBoolean

public java.lang.Boolean popBoolean()
Pops a Boolean off the stack and returns it.

Returns:
a Boolean from the top of the stack
Throws:
AlertException - if the stack item cannot be cast to a Boolean

popCalendar

public java.util.Calendar popCalendar()
Pops a Calendar off the stack and returns it.

Returns:
a Calendar from the top of the stack
Throws:
AlertException - if the stack item cannot be cast to a Calendar

popCharacter

public java.lang.Character popCharacter()
Pops a Character off the stack and returns it.

Returns:
an Character from the top of the stack
Throws:
AlertException - if the stack item cannot be cast to a Character

popDatabaseSource

public DatabaseSource popDatabaseSource()
Pops a DatabaseSource off the stack and returns it.

Returns:
an DatabaseSource from the top of the stack
Throws:
AlertException - if the stack item cannot be cast to a DatabaseSource

popFragment

public Fragment popFragment()
Pops a Fragment off the stack and returns it.

Returns:
an Fragment from the top of the stack
Throws:
AlertException - if the stack item cannot be cast to a Fragment

popFunction

public Function popFunction()
Pops a Function off the stack and returns it.

Returns:
an Function from the top of the stack
Throws:
AlertException - if the stack item cannot be cast to a Function

popIList

public org.millscript.commons.util.IList popIList()
Pops a List off the stack and returns it.

Returns:
an IList from the top of the stack
Throws:
AlertException - if the stack item cannot be cast to a List

popImage

public Image popImage()
Pops an Image off the stack and returns it.

Returns:
an Image from the top of the stack
Throws:
AlertException - if the stack item cannot be cast to an Image

popIMap

public org.millscript.commons.util.IMap popIMap()
Pops a Map off the stack and returns it.

Returns:
an IMap from the top of the stack
Throws:
AlertException - if the stack item cannot be cast to a MapWithDefault

popInt

public int popInt()
Pops an int off the stack and returns it.

Returns:
an Integers int value from the top of the stack
Throws:
AlertException - if the stack item cannot be cast to an integer

popInteger

public java.lang.Integer popInteger()
Pops an Integer off the stack and returns it.

Returns:
an Integer from the top of the stack
Throws:
AlertException - if the stack item cannot be cast to an Integer

popObjectArray

public java.lang.Object[] popObjectArray()
Pops an object array off the stack and returns it.

Returns:
a object array from the top of the stack
Throws:
AlertException - if the stack item cannot be cast to an object array

popPattern

public java.util.regex.Pattern popPattern()
Pops a traditional regular expression Pattern off the stack and returns it.

Returns:
a Pattern from the top of the stack
Throws:
AlertException - if the stack item cannot be cast to a Pattern

popSpiceClass

public SpiceClass popSpiceClass()
Pops a Spice Class off the stack and returns it.

Returns:
an SpiceClass from the top of the stack
Throws:
AlertException - if the stack item cannot be cast to a SpiceClass

popSpiceObject

public SpiceObject popSpiceObject()
Pops a Spice Object off the stack and returns it.

Returns:
an SpiceObject from the top of the stack
Throws:
AlertException - if the stack item cannot be cast to a SpiceObject

popString

public java.lang.String popString()
Pops a String off the stack and returns it.

Returns:
an String from the top of the stack
Throws:
AlertException - if the stack item cannot be cast to a String

popURL

public Page popURL()
Pops a URL off the stack and returns it.

Returns:
an Page from the top of the stack
Throws:
AlertException - if the stack item cannot be cast to a URL

popXmlComment

public XmlComment popXmlComment()
Pops an XmlComment off the stack and returns it.

Returns:
an XmlComment from the top of the stack
Throws:
AlertException - if the stack item cannot be cast to an XmlComment

popXmlElement

public XmlElement popXmlElement()
Pops an XmlElement off the stack and returns it.

Returns:
an XmlElement from the top of the stack
Throws:
AlertException - if the stack item cannot be cast to an XmlElement

printResults

public void printResults(boolean interactive)
Clears the value stack, optionally printing all the objects left on it. The remaining objects will only be printed if we are in an interactive mode, such as the interpreter.

Parameters:
interactive - a boolean indicating if we are in an interactive mode


Copyright © 2001-2007 Open World Ltd. All Rights Reserved.