Class End
- Namespace
- BOOSE
- Assembly
- BOOSE.dll
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.
public sealed class End : CompoundCommand, ICommand
- Inheritance
-
End
- Implements
- Inherited Members
Constructors
End()
public End()
Methods
Compile()
Checks that this end matches the last condition (i.e. if this is an end if then the command it pops off the stack is an "if".
public override void Compile()
Exceptions
- CommandException
Thrown if the corresponding command does not match.
Execute()
Ifs are simple, do nothing. Whiles jumps back to the corresponding while command and For gets the from, to and step, checks they will result in a loop and determines whether the count has run out. If it hasn't it jumps to the line after the for.
public override void Execute()
Exceptions
- CommandException
Thrown if invalid for loop.