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.

References readconsole(), and readfile().

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.

References eval(), nil, 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 ( char *  fn  ) 

Read the expressions from the file.

Parameters:
fn The file name.

References readfile().

void readfile ( ifstream &  fin  ) 

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

Parameters:
fin The input file stream.

References iswhitespace(), parse_eval_print(), and readsinglesymbol().

Referenced by main(), and readfile().

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.

References iswhitespace().

Referenced by readfile(), and separate_parse().


Generated on Fri Oct 5 14:08:52 2012 for a1 by  doxygen 1.5.8