|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectHttpServlet
fi.hu.cs.titokone.AssariUI
This class is a servlet providing a HTML interface to the TTK91 simulator's core functions. It provides a method for compiling a program (the output is printed out, but not stored as such), for compiling and running a program either in whole or for a fixed number of commands (the program's output to screen and STDOUT is printed out, as is the memory up to the stack pointer and the registers' values and computer state). The TTK91 simulatee computer is recreated for each request.
Field Summary | |
static int |
EXECUTE_ALL
This field defines the value to input in the command counter to execute commands until the program stops. |
static int |
MAX_CYCLES
This field contains the maximum number of TTK91 cpu cycles the given TTK91 code is allowed to execute until it is assumed to be in an infinite loop and is stopped. |
private Settings |
settings
|
Constructor Summary | |
AssariUI()
This method sets up a new AssariUI servlet. |
Method Summary | |
void |
doGet(HttpServletRequest request,
HttpServletResponse response)
This method responds to a GET command. |
void |
doPost(HttpServletRequest request,
HttpServletResponse response)
This method respons to a POST command. |
private java.lang.String |
getPrintOut(TTK91Core computer)
This method gathers a printout of the computer's state after running an application and returns it. |
private java.lang.String |
makeForm(java.lang.String code,
java.lang.String kbdInput,
java.lang.String fileInput,
java.lang.String printout,
int commandCounter)
This method produces a string containing an HTML form that contains the input fields. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private Settings settings
public static final int EXECUTE_ALL
public static final int MAX_CYCLES
Constructor Detail |
public AssariUI()
Method Detail |
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, java.io.IOException
ServletException
java.io.IOException
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, java.io.IOException
ServletException
java.io.IOException
private java.lang.String makeForm(java.lang.String code, java.lang.String kbdInput, java.lang.String fileInput, java.lang.String printout, int commandCounter)
code
- The code string to insert in the TTK91 code text field.kbdInput
- The input string to insert in the KBD input text
field.fileInput
- The input string to insert in the STDIN input
text field.printout
- The output string to insert in the Program Output
text field.commandCounter
- The number to insert in the counter for how
many commands should be executed, or 0 if the field has either not
been changed or has been changed to an invalid value (nonnumeric).
private java.lang.String getPrintOut(TTK91Core computer)
computer
- A TTK91Core to draw the state information from.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |