edu.vub.at.objects.natives
Class System

at.objects.natives.NATSystem

 class System

Instances of this class represent the 'system' object, accessible from the lexical root during execution of 'iat'. This object contains various native methods to interface with the shell environment. The interface of the system object is as follows: def system := object: { def argv := the table of extra command-line arguments passed to iat def exit() { quits iat } def print(@objs) { print objects to standard output } def println(@objs) { print objects to standard output, followed by a newline } // def read() { read character from standard input } def readln() { read next line from input } // def reset() { reset VM into fresh startup state and re-evaluates init and argument file } }

Author:
tvc
See Also:
Serialized Form

Field Summary
 Table getArgv
          def argv := command-line arguments passed to iat
 
Constructor Summary
NATSystem(at.IAT shell, java.lang.String[] argv)
           
 
Method Summary
 Table argv()
          def argv := command-line arguments passed to iat
 Nil exit()
          def exit() { quits iat }
 Nil print(Object[] objs)
          def print(@obj) { print obj to standard output }
 Nil println(Object[] objs)
          def println(@obj) { self.print(@[@obj, '\n']) }
 Nil readNextLine:catch:(Closure success, Closure failure)
          readNextLine: { |line| ... } catch: { |ioException| ... } Reads the next line on the input stream, represented by an ATText or nil if EOF has been reached.
 
Methods inherited from class edu.vub.at.objects.natives.NativeATObject
==, freeVariables, super
 
Methods inherited from interface edu.vub.at.objects.AbstractGrammar
freeVariables
 
Methods inherited from interface edu.vub.at.objects.Object
super
 

Field Detail

getArgv

public Table getArgv
def argv := command-line arguments passed to iat

Constructor Detail

NATSystem

public NATSystem(at.IAT shell,
                 java.lang.String[] argv)
Method Detail

argv

public Table argv()
def argv := command-line arguments passed to iat

Returns:
a table of ATText values

exit

public Nil exit()
def exit() { quits iat }


print

public Nil print(Object[] objs)
def print(@obj) { print obj to standard output }

Parameters:
obj - the object to print
Throws:
edu.vub.at.exceptions.InterpreterException - if obj cannot be converted into a native text value

println

public Nil println(Object[] objs)
def println(@obj) { self.print(@[@obj, '\n']) }


readNextLine:catch:

public Nil readNextLine:catch:(Closure success,
                               Closure failure)
readNextLine: { |line| ... } catch: { |ioException| ... } Reads the next line on the input stream, represented by an ATText or nil if EOF has been reached. The line string is subsequently passed to the first closure. Any exception is signalled by invoking the "catch:" closure.

Returns:
nil