microScheme
Functions
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. More...
 
bool iswhitespace (char ch)
 Check whether the character is whitespace. More...
 

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
chThe character to check.

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

Cell* parse ( string  sexpr)

Recursively parse sexpr and build the parse tree.

Parameters
sexprThe 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().