|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.vub.at.IAT
IAT is the main entry point for the 'iat' Interactive AmbientTalk shell. usage: iat [options] [file] [arguments] Environment variables used by iat: AT_HOME: path to the AmbientTalk home directory (for native libraries) AT_OBJECTPATH: default objectpath to use (is prefixed by '.' and suffixed by AT_HOME by the interpreter) Command Line Options: -i, --init init-file: specifies which file to load as the preamble of the language (the content of this file is evaluated in the context of the global lexical root) -o, --objectpath objectpath: specifies the object-path, a list of directories separated by ';' which contain the necessary libraries -e, --eval codestring: evaluates the given codestring and ignores the filename -p, --print print value of last evaluated expression, then quit instead of entering REPL -h, --help display help, then quit -v, --version display version information, then quit -q, --quiet quiet mode - don't print welcome message or any prompts Program arguments: an optional filename and optional arguments to the script Program behaviour: iat evaluates the code in the argument file, if one is given, then enters a read-eval-print loop (unless -p was specified, in which case it prints out the last evaluated expression and quits) During execution of the iat program, the AmbientTalk Lexical root contains an object called 'system'. For more information about this object, see the OBJSystem class:
edu.vub.at.natives.OBJSystem
Field Summary | |
static java.lang.String[] |
_ARGUMENTS_ARG_
|
private static java.lang.String |
_ENV_AT_HOME_
|
private static java.lang.String |
_ENV_AT_OBJECTPATH_
|
static java.lang.String |
_EVAL_ARG_
|
private static ELActor |
_evaluator
|
private static java.lang.String |
_EXEC_NAME_
|
static java.lang.String |
_FILE_ARG_
|
static boolean |
_HELP_ARG_
|
protected static java.util.Properties |
_IAT_PROPS_
|
static java.lang.String |
_INIT_ARG_
|
private static java.lang.String |
_INPUT_PROMPT_
|
static java.lang.String |
_OBJECTPATH_ARG_
|
private static java.lang.String |
_OUTPUT_PROMPT_
|
static boolean |
_PRINT_ARG_
|
static boolean |
_QUIET_ARG_
|
static boolean |
_VERSION_ARG_
|
Constructor Summary | |
IAT()
|
Method Summary | |
private static void |
abort(java.lang.String message)
|
static void |
boot()
Performs the main boot sequence of the AmbientTalk VM and environment: 1) Create a virtual machine using the correct object path and actor initialisation 2) Create a new actor which knows how to interface with IAT (it knows execute: and the system object) 3) Create a barrier which allows synchronizing between an actor and the REPL 4) Ensure the barrier is informed of results by registering it as an observer 5) Send the main code specified by the user to be executed by the actor. |
private static SAFLobby |
computeObjectPath(java.lang.String objectPath)
|
private static SAFWorkingDirectory |
computeWorkingDirectory()
|
private static void |
handleATException(InterpreterException e)
|
private static void |
handleParseError(XParseError e)
|
private static java.lang.String |
initObjectPathString()
Initializes the lobby namespace with a slot for each directory in the object path. |
private static java.lang.String |
loadMainCode()
Load the code in the main argument file or the code specified using the -e option. |
static void |
main(java.lang.String[] args)
Startup sequence: I) parse command-line arguments, extract properties II) check for simple -help or -version arguments III) Boot sequence: 1) initialize the lobby using the object path (-o or default) 2) add system object to the global lexical scope 3) evaluate init file (-i or default) in context of the global scope 4) if -e was specified, then evaluate the given code in a 'main' namespace else if a filename was specified then load the file and evaluate it within its 'main' namespace else skip 5) if -p was specified, then print value of last evaluation quit else IV) enter REPL: 1) print input prompt (unless -q) 2) read input 3) parse input 4) eval input in the 'main' namespace 5) print output prompt (unless -q) 6) print value of last evaluation |
private static void |
parseAndSend(java.lang.String code,
java.lang.String inFile)
|
private static void |
parseArguments(java.lang.String[] args)
|
private static ATAbstractGrammar |
parseInitFile()
|
private static void |
printObjectPath()
|
private static void |
printToConsole(java.lang.String txt)
|
private static void |
printVersion()
|
private static void |
processInformativeArguments()
|
private static void |
readEvalPrintLoop()
Reads a single line of input, and schedules it for evaluation. |
private static java.lang.String |
readFromConsole()
|
private static void |
warn(java.lang.String message)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final java.lang.String _EXEC_NAME_
private static final java.lang.String _ENV_AT_OBJECTPATH_
private static final java.lang.String _ENV_AT_HOME_
protected static final java.util.Properties _IAT_PROPS_
private static java.lang.String _INPUT_PROMPT_
private static java.lang.String _OUTPUT_PROMPT_
public static java.lang.String _FILE_ARG_
public static java.lang.String[] _ARGUMENTS_ARG_
public static java.lang.String _INIT_ARG_
public static java.lang.String _OBJECTPATH_ARG_
public static java.lang.String _EVAL_ARG_
public static boolean _PRINT_ARG_
public static boolean _HELP_ARG_
public static boolean _VERSION_ARG_
public static boolean _QUIET_ARG_
private static ELActor _evaluator
Constructor Detail |
public IAT()
Method Detail |
private static void parseArguments(java.lang.String[] args)
private static void processInformativeArguments()
private static java.lang.String initObjectPathString()
private static final SAFLobby computeObjectPath(java.lang.String objectPath)
private static final SAFWorkingDirectory computeWorkingDirectory()
private static ATAbstractGrammar parseInitFile() throws InterpreterException
InterpreterException
private static java.lang.String loadMainCode()
private static void readEvalPrintLoop()
public static void boot()
public static void main(java.lang.String[] args)
args
- arguments passed to the JVM, which should all be interpreted as arguments to 'iat'private static void printObjectPath()
private static void parseAndSend(java.lang.String code, java.lang.String inFile)
private static void handleParseError(XParseError e)
private static void handleATException(InterpreterException e)
private static java.lang.String readFromConsole() throws java.io.IOException
java.io.IOException
private static void printToConsole(java.lang.String txt)
private static void abort(java.lang.String message)
private static void warn(java.lang.String message)
private static void printVersion()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |