Parse Expressions

DESCRIPTION:
Returns an object of mode "expression" which is the parsed version of the input.

USAGE:
parse(file="", n=<<see below>>, text=NULL, prompt=<<see below>>, white=F)

OPTIONAL ARGUMENTS:
file:
character string giving the file from which input to the parser should be read. If neither text nor file is provided, or if file is the empty string, the parser reads from standard input.
n:
number of expressions to parse. If negative, parsing will continue to the end of the file. By default, parse reads to the end of the file or text, except when the file is the standard input, in which case n=1.
text:
character vector to use as input to the parser.
prompt:
character string to use as the prompt in interactive use of parse. The default is the value of the option named prompt.
white:
if TRUE, arbitrary white space can separate expressions; otherwise, only newlines or semicolons.

VALUE:
an object of mode expression, containing the parsed version of the expression(s) read.

DETAILS:
Usually, parse() will prompt the user for input when the input is coming from the standard input stream and the standard input and standard error streams appear to be terminals. (Options("prompt") and options("continue") give the prompt strings.) If you desire the prompting even when those streams are pipes or files, set the environmental variable ALWAYS_PROMPT (to anything at all) before starting S-PLUS. parse() will never print prompts if its file argument is not null or if the text argument is given.

The standard .Program calls parse() with no arguments to get input from the user.


SEE ALSO:
eval , options , scan , .Program .

EXAMPLES:
parse(n= -1, file = "my.file") # parse everything on my.file