parse.hpp File Reference

#include "cons.hpp"

Go to the source code of this file.

Functions

Cell * parse (string sexpr)
 Recursively parse sexpr and build the parse tree.
bool iswhitespace (char ch)
 Check whether the character is whitespace.


Detailed Description

Encapsulates the interface for the expression parsing function, which analyzes a string containing an s-expression, and determines its tree structure.

Function Documentation

bool iswhitespace ( char  ch  ) 

Check whether the character is whitespace.

Returns:
True if it is character, false else.
Parameters:
ch The character to check.

Referenced by clearwhitespace(), readfile(), readsinglesymbol(), and separate_parse().

Cell* parse ( string  sexpr  ) 

Recursively parse sexpr and build the parse tree.

Parameters:
sexpr The s-expression stored in a string variable (note that this version of parse has side effects: it may alter the contents of sexpr).
Returns:
A pointer to the conspair cell at the root of the parse tree.

References clearwhitespace(), is_legalexpr(), makecell(), and separate_parse().

Referenced by parse_eval_print(), and separate_parse().


Generated on Wed Oct 17 13:56:48 2012 for a1 by  doxygen 1.5.8