Namespace BOOSE
Classes
- Array
An array of integers or reals.
array int myArray 10,2\narray real prices 10\n[array][(type)][(size)][(optional dimentions, 1 if not given)]
- BOOSEException
Generic BOOSE Language exception Extends Exception
- Boolean
Boolean datatype, also used for Conditional Commands.
- Call
Command to call a previously defined method.
method int testMethod\n int one, int two\n testMethod = one* two\nend method\nint global = 55\ncall testMethod 10 15
- Canvas
Abstract class that implements CanvasInterface. See CanvasInterface documentation for what to implement. This class handles all the drawing on your system according to above documentation. BOOSE does not by default specify a default drawing Canvas (only this).
- CanvasCommand
Abstract class that is inherited by derived canvas commands that draw on a canvas. It stores the x and y positions of the last drawing operation.
- CanvasException
Exception that should be thrown by operations that fail on the Canvas.
- Cast
Cast real values to int values. Syntax: cast intVarrealVar Both variables must be previously defined.
real circ = 100.123\nint c\ncast c circ\ncircle c
- Circle
Draw a circle round the current cursor position.
circle 50 Canvas exception if a non-integer is passed.
- Command
Abstract class for BOOSE commands. Can handle a parameter list or expression. This class will seperate the parameters or expression from the command and store in the "ParameterList". The Command's Compile() method is called by the parser and this is expected to set the Command's parameters. BOOSE implementation of commands makes definitions "sealed". Sealed classes cannot be inherited, so you can't use what's there to remove the restrictions, you will have to totally rewrite them.
- CommandException
Exception genereted by the StoredProgram class when a command fails
- CommandOneParameter
Commands with one parameter. The command system adds one parameter at a time. Can be used by any one parameter command.
- CommandThreeParameters
Commands with two parameters. Each command has an Xpos and Ypos that operates from the current cursor position.
- CommandTwoParameters
Commands with two parameters. Each command has an Xpos and Ypos that operates from the current cursor position.
- CompoundCommand
CompoundCommand is a building block for shared functionality between CompoundCommands, such as IF, WHILE, FOR ,ELSE and ENDS Classes the inherit from here tend to be "sealed" so that they cnnot be inherited from to manipulate restrictions.
- ConditionalCommand
Used for Ifs, Whiles and Fors
- DrawTo
Draw a line from to current cursor position to the provided x,y position.
drawto 200,200
- Else
An Else is like an Endif but it pops the corresponding If off the stack and pushes itself on so that it becomes the corresponding command to the end
- End
End command for If/While/For/Method. BOOSE has only one End type command which has a parameter to say what it belongs so eg. "end if". End checks Boose types for the ciorresponding command (If/While/For/Method) and will likely require a complete rewrite to replcae those commands. It would probbaly be easier to replace Parser, StoredProgram, CompoundCommand and this. Look at the metghods each provides, if you like, and try and fill in their fucntionality.
- Evaluation
An evaluation encompasses all things that can have a value, such as variables, expressions and conditions used in loops and ifs.
- FactoryException
exception genereted by the StoredProgram class
- For
For command. Adds processing at compile() and execute() to process a for command.
- If
If command. Adds processing at compile() and execute() to process an if command.
- Int
Command Class to define and store integer values.
- Method
Method declaration command. Overcoming method restrictions will require a complete rewrite. It would be simpler to do this after Parser and StoredProgram. You are getting to the stage where you need to do a big rewrite.
- MoveTo
Set the cursor position, for subsequent drawing operations, to the provide x,y position.
- Parser
The parser takes a program, who's lines are seperated by "\n", and attempts to create a StoredProgram. Once the SToredProgram has been created it then can be run. As much processing that can be done is done here because it has no run penalty (other than starting the program). Command objects are created and their parameters processed as much as possible. Variables are checked for existance but expressions cannot be processed until runtime.
- ParserException
exception genereted by the Parser class to denote syntax errors
- Peek
Peek an array, i.e. get the value of an array cell. [variable] = peek [array name] [row] [optional column]
- PenColour
Set the pen for the next drawing operations to the provided r,g,b colour.
- Poke
Poke an array, i.e. set the value of an array cell. poke [array name] [row] [optional column] = [value]
- Real
Class for a Real Number Variable.
- Rect
Draw a rectangle of provided with and heigh with the current cursor position being the top left corner.
- RestrictionException
Exception thrown when restrictions are breached. If you get this you need to write your own code for the facility.
- StoredProgram
A collection class for storing a program of Command objects, extends ArrayList to add a program counter and a flag to indicate that the syntax is ok and the program valid. Adds methods below to process variables and methods and implements flow of control for ifs and loops.
- StoredProgramException
exception genereted by the StoredProgram class
- VarException
Exception raised by variable commands.
- While
While command. So far blank as it doesn't do anything beyond ConditionalCommand but it makes the code clearer (in the factory).
Interfaces
- ICanvas
Implement ICanvas for your BOOSE renderer. It has an Xpos and Ypos of the current cursor position, and a pen colour. Your class should implement the methods below to draw on its "bitmap" (i.e. it may not be a bitmap, it could draw in ASCII text for example).
- ICommand
Interface for new commands. Any new Command class should implement this interface and be generated by a CommandFactory that implements the ICommandFactory interface. Contains methods to set the Command up after its creation, manage its parameters when it is compiled and execute it when it is called.
- ICommandFactory
To add commands to BOOSE you must create a CommandFactory that uses this interface. You should extend the existing BOOSE:CommandFactory (which implements this interface) and then implement the MakeCommand() method. It shoudld create a new command object based on the string passed. Any standard BOOSE commands can then be made by calling base.MakeCommand();
- IEvaluation
IEvaluation adds properties to get and set an Evaluations name, value and expression. An evaluation can be a variable declaration, such as "int total" or "real area". It can be change of value of a variable, such as "total = total + 1", the part after the "=" is an referred to as an "expression". In the first two cases the parser will generate an Int object and a Real Object. In the third case it will generate a "Evaluation" object.
- IParser
The Parser Class takes a BOOSE program as a String with each command seperated by '\n' and creates command objects for each valid command and stores them in the passed in StoredProgram. Exceptions are generated for any syntax errors. When each valid command is generated its Compile() method is called. The valid command will have its parameters processed and any variables identified. It is the role of StoredProgram to run the commands.
Enums
- ConditionalCommand.conditionalTypes
Enumerated type to represent individual conditional commands.