main.cpp File Reference

#include "parse.hpp"
#include "eval.hpp"
#include <sstream>

Functions

void parse_eval_print (string sexpr)
 Parse and evaluate the s-expression, and print the result.
void readsinglesymbol (ifstream &fin, string &str)
 Read single single symbol into the end of a string buffer.
void readfile (ifstream &fin)
 Read, parse, evaluate, and print the expression one by one from the input stream.
void readfile (char *fn)
 Read the expressions from the file.
void readconsole ()
 Read, parse, evaluate, and print the expression one by one from the standard input, interactively.
int main (int argc, char *argv[])
 Call either the batch or interactive main drivers.

Detailed Description

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.

Function Documentation

int main int  argc,
char *  argv[]
 

Call either the batch or interactive main drivers.

void parse_eval_print string  sexpr  ) 
 

Parse and evaluate the s-expression, and print the result.

Parameters:
sexpr The string vaule holding the s-expression.

void readconsole  ) 
 

Read, parse, evaluate, and print the expression one by one from the standard input, interactively.

void readfile char *  fn  ) 
 

Read the expressions from the file.

Parameters:
fn The file name.

void readfile ifstream &  fin  ) 
 

Read, parse, evaluate, and print the expression one by one from the input stream.

Parameters:
fin The input file stream.

void readsinglesymbol ifstream &  fin,
string &  str
 

Read single single symbol into the end of a string buffer.

Parameters:
fin The input file stream.
str The string buffer.


Generated on Thu Mar 8 12:59:27 2007 for a1 by  doxygen 1.4.6