microScheme
|
Functions | |
void | parse_eval_print (string sexpr) |
Parse and evaluate the s-expression, and print the result. More... | |
void | readsinglesymbol (ifstream &fin, string &str) |
Read single single symbol into the end of a string buffer. More... | |
void | readfile (ifstream &fin) |
Read, parse, evaluate, and print the expression one by one from the input stream. More... | |
void | readfile (char *fn) |
Read the expressions from the file. More... | |
void | readconsole () |
Read, parse, evaluate, and print the expression one by one from the standard input, interactively. More... | |
int | main (int argc, char *argv[]) |
Call either the batch or interactive main drivers. More... | |
Driver code implementing the main read-parse-eval-print loop. Supports both (1) an interactive mode, and (2) a batch mode where input expressions are read from the file specified by the first command-line argument.
int main | ( | int | argc, |
char * | argv[] | ||
) |
Call either the batch or interactive main drivers.
References readconsole(), and readfile().
void parse_eval_print | ( | string | sexpr | ) |
Parse and evaluate the s-expression, and print the result.
sexpr | The string vaule holding the s-expression. |
References eval(), and parse().
Referenced by readconsole(), and readfile().
void readconsole | ( | ) |
Read, parse, evaluate, and print the expression one by one from the standard input, interactively.
References parse_eval_print().
Referenced by main().
void readfile | ( | ifstream & | fin | ) |
Read, parse, evaluate, and print the expression one by one from the input stream.
fin | The input file stream. |
References iswhitespace(), parse_eval_print(), and readsinglesymbol().
Referenced by main(), and readfile().
void readfile | ( | char * | fn | ) |
void readsinglesymbol | ( | ifstream & | fin, |
string & | str | ||
) |
Read single single symbol into the end of a string buffer.
fin | The input file stream. |
str | The string buffer. |
References iswhitespace().
Referenced by readfile().