Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

lispreader.cxx File Reference

#include <assert.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include "construo_error.hxx"
#include <lispreader.hxx>

Include dependency graph for lispreader.cxx:

Include dependency graph

Go to the source code of this file.

Defines

#define TOKEN_ERROR   -1
#define TOKEN_EOF   0
#define TOKEN_OPEN_PAREN   1
#define TOKEN_CLOSE_PAREN   2
#define TOKEN_SYMBOL   3
#define TOKEN_STRING   4
#define TOKEN_INTEGER   5
#define TOKEN_REAL   6
#define TOKEN_PATTERN_OPEN_PAREN   7
#define TOKEN_DOT   8
#define TOKEN_TRUE   9
#define TOKEN_FALSE   10
#define MAX_TOKEN_LENGTH   1024

Functions

lisp_stream_tlisp_stream_init_file (lisp_stream_t *stream, FILE *file)
lisp_stream_tlisp_stream_init_string (lisp_stream_t *stream, char *buf)
lisp_stream_tlisp_stream_init_any (lisp_stream_t *stream, void *data, int(*next_char)(void *data), void(*unget_char)(char c, void *data))
lisp_object_tlisp_make_integer (int value)
lisp_object_tlisp_make_real (float value)
lisp_object_tlisp_make_symbol (const char *value)
lisp_object_tlisp_make_string (const char *value)
lisp_object_tlisp_make_cons (lisp_object_t *car, lisp_object_t *cdr)
lisp_object_tlisp_make_boolean (int value)
lisp_object_tlisp_read (lisp_stream_t *in)
void lisp_free (lisp_object_t *obj)
lisp_object_tlisp_read_from_string (const char *buf)
int lisp_type (lisp_object_t *obj)
int lisp_integer (lisp_object_t *obj)
char * lisp_symbol (lisp_object_t *obj)
char * lisp_string (lisp_object_t *obj)
int lisp_boolean (lisp_object_t *obj)
float lisp_real (lisp_object_t *obj)
lisp_object_tlisp_car (lisp_object_t *obj)
lisp_object_tlisp_cdr (lisp_object_t *obj)
lisp_object_tlisp_cxr (lisp_object_t *obj, const char *x)
int lisp_list_length (lisp_object_t *obj)
lisp_object_tlisp_list_nth_cdr (lisp_object_t *obj, int index)
lisp_object_tlisp_list_nth (lisp_object_t *obj, int index)
void lisp_dump (lisp_object_t *obj, FILE *out)


Define Documentation

#define MAX_TOKEN_LENGTH   1024
 

Definition at line 45 of file lispreader.cxx.

#define TOKEN_CLOSE_PAREN   2
 

Definition at line 34 of file lispreader.cxx.

Referenced by lisp_read().

#define TOKEN_DOT   8
 

Definition at line 40 of file lispreader.cxx.

Referenced by lisp_read().

#define TOKEN_EOF   0
 

Definition at line 32 of file lispreader.cxx.

Referenced by lisp_read().

#define TOKEN_ERROR   -1
 

Definition at line 31 of file lispreader.cxx.

Referenced by lisp_read().

#define TOKEN_FALSE   10
 

Definition at line 42 of file lispreader.cxx.

Referenced by lisp_read().

#define TOKEN_INTEGER   5
 

Definition at line 37 of file lispreader.cxx.

Referenced by lisp_read().

#define TOKEN_OPEN_PAREN   1
 

Definition at line 33 of file lispreader.cxx.

Referenced by lisp_read().

#define TOKEN_PATTERN_OPEN_PAREN   7
 

Definition at line 39 of file lispreader.cxx.

Referenced by lisp_read().

#define TOKEN_REAL   6
 

Definition at line 38 of file lispreader.cxx.

Referenced by lisp_read().

#define TOKEN_STRING   4
 

Definition at line 36 of file lispreader.cxx.

Referenced by lisp_read().

#define TOKEN_SYMBOL   3
 

Definition at line 35 of file lispreader.cxx.

Referenced by lisp_read().

#define TOKEN_TRUE   9
 

Definition at line 41 of file lispreader.cxx.

Referenced by lisp_read().


Function Documentation

int lisp_boolean lisp_object_t   obj
 

Definition at line 557 of file lispreader.cxx.

References _lisp_object_t::type, and _lisp_object_t::v.

Referenced by lisp_dump(), and LispReader::read_bool().

lisp_object_t* lisp_car lisp_object_t   obj
 

Definition at line 575 of file lispreader.cxx.

References LISP_TYPE_CONS, LISP_TYPE_PATTERN_CONS, ConstruoError::raise(), _lisp_object_t::type, and _lisp_object_t::v.

Referenced by lisp_cxr(), lisp_dump(), ParticleFactory::ParticleFactory(), LispReader::read_bool(), LispReader::read_float(), LispReader::read_int(), LispReader::read_vector(), and World::World().

lisp_object_t* lisp_cdr lisp_object_t   obj
 

Definition at line 584 of file lispreader.cxx.

References _lisp_object_t::type, and _lisp_object_t::v.

Referenced by lisp_cxr(), lisp_dump(), ParticleFactory::ParticleFactory(), LispReader::read_vector(), Spring::Spring(), and World::World().

lisp_object_t* lisp_cxr lisp_object_t   obj,
const char *    x
 

Definition at line 592 of file lispreader.cxx.

References lisp_car(), and lisp_cdr().

void lisp_dump lisp_object_t   obj,
FILE *    out
 

Definition at line 649 of file lispreader.cxx.

References lisp_boolean(), lisp_car(), lisp_cdr(), lisp_integer(), lisp_real(), lisp_string(), lisp_symbol(), lisp_type(), LISP_TYPE_BOOLEAN, LISP_TYPE_CONS, LISP_TYPE_EOF, LISP_TYPE_INTEGER, LISP_TYPE_PARSE_ERROR, LISP_TYPE_PATTERN_CONS, LISP_TYPE_REAL, LISP_TYPE_STRING, and LISP_TYPE_SYMBOL.

Referenced by ParticleFactory::write_lisp(), and World::write_lisp().

void lisp_free lisp_object_t   obj
 

Definition at line 483 of file lispreader.cxx.

References LISP_TYPE_CONS, LISP_TYPE_EOF, LISP_TYPE_INTERNAL, LISP_TYPE_PARSE_ERROR, LISP_TYPE_PATTERN_CONS, LISP_TYPE_PATTERN_VAR, LISP_TYPE_STRING, LISP_TYPE_SYMBOL, _lisp_object_t::type, and _lisp_object_t::v.

Referenced by lisp_read(), World::World(), ParticleFactory::write_lisp(), and World::write_lisp().

int lisp_integer lisp_object_t   obj
 

Definition at line 532 of file lispreader.cxx.

References _lisp_object_t::type, and _lisp_object_t::v.

Referenced by lisp_dump(), and LispReader::read_int().

int lisp_list_length lisp_object_t   obj
 

Definition at line 608 of file lispreader.cxx.

References _lisp_object_t::type, and _lisp_object_t::v.

lisp_object_t* lisp_list_nth lisp_object_t   obj,
int    index
 

Definition at line 639 of file lispreader.cxx.

References lisp_list_nth_cdr(), and _lisp_object_t::v.

lisp_object_t* lisp_list_nth_cdr lisp_object_t   obj,
int    index
 

Definition at line 624 of file lispreader.cxx.

References _lisp_object_t::type, and _lisp_object_t::v.

Referenced by lisp_list_nth().

lisp_object_t* lisp_make_boolean int    value
 

Definition at line 365 of file lispreader.cxx.

References _lisp_object_t::v.

Referenced by lisp_read(), and LispWriter::write_boolean().

lisp_object_t* lisp_make_cons lisp_object_t   car,
lisp_object_t   cdr
 

Definition at line 354 of file lispreader.cxx.

References _lisp_object_t::v.

Referenced by LispWriter::create_lisp(), and lisp_read().

lisp_object_t* lisp_make_integer int    value
 

Definition at line 314 of file lispreader.cxx.

References _lisp_object_t::v.

Referenced by lisp_read(), and LispWriter::write_int().

lisp_object_t* lisp_make_real float    value
 

Definition at line 324 of file lispreader.cxx.

References _lisp_object_t::v.

Referenced by lisp_read(), LispWriter::write_float(), and LispWriter::write_vector().

lisp_object_t* lisp_make_string const char *    value
 

Definition at line 344 of file lispreader.cxx.

References _lisp_object_t::v.

Referenced by lisp_read(), and LispWriter::write_string().

lisp_object_t* lisp_make_symbol const char *    value
 

Definition at line 334 of file lispreader.cxx.

References _lisp_object_t::v.

Referenced by lisp_read(), and LispWriter::write_symbol().

lisp_object_t* lisp_read lisp_stream_t   in
 

Definition at line 386 of file lispreader.cxx.

References lisp_free(), lisp_make_boolean(), lisp_make_cons(), lisp_make_integer(), lisp_make_real(), lisp_make_string(), lisp_make_symbol(), lisp_nil, lisp_nil_p, TOKEN_CLOSE_PAREN, TOKEN_DOT, TOKEN_EOF, TOKEN_ERROR, TOKEN_FALSE, TOKEN_INTEGER, TOKEN_OPEN_PAREN, TOKEN_PATTERN_OPEN_PAREN, TOKEN_REAL, TOKEN_STRING, TOKEN_SYMBOL, TOKEN_TRUE, and _lisp_object_t::v.

Referenced by lisp_read_from_string(), and World::World().

lisp_object_t* lisp_read_from_string const char *    buf
 

Definition at line 515 of file lispreader.cxx.

References lisp_read(), and lisp_stream_init_string().

float lisp_real lisp_object_t   obj
 

Definition at line 565 of file lispreader.cxx.

References LISP_TYPE_INTEGER, _lisp_object_t::type, and _lisp_object_t::v.

Referenced by lisp_dump(), LispReader::read_float(), and LispReader::read_vector().

lisp_stream_t* lisp_stream_init_any lisp_stream_t   stream,
void *    data,
int(*    next_char)(void *data),
void(*    unget_char)(char c, void *data)
 

Definition at line 299 of file lispreader.cxx.

References LISP_STREAM_ANY, lisp_stream_t::type, and lisp_stream_t::v.

lisp_stream_t* lisp_stream_init_file lisp_stream_t   stream,
FILE *    file
 

Definition at line 280 of file lispreader.cxx.

References LISP_STREAM_FILE, lisp_stream_t::type, and lisp_stream_t::v.

Referenced by World::World().

lisp_stream_t* lisp_stream_init_string lisp_stream_t   stream,
char *    buf
 

Definition at line 289 of file lispreader.cxx.

References LISP_STREAM_STRING, lisp_stream_t::type, and lisp_stream_t::v.

Referenced by lisp_read_from_string(), and World::World().

char* lisp_string lisp_object_t   obj
 

Definition at line 548 of file lispreader.cxx.

References LISP_TYPE_STRING, ConstruoError::raise(), _lisp_object_t::type, and _lisp_object_t::v.

Referenced by lisp_dump().

char* lisp_symbol lisp_object_t   obj
 

Definition at line 540 of file lispreader.cxx.

References _lisp_object_t::type, and _lisp_object_t::v.

Referenced by lisp_dump(), and World::World().

int lisp_type lisp_object_t   obj
 

Definition at line 524 of file lispreader.cxx.

References LISP_TYPE_NIL, and _lisp_object_t::type.

Referenced by lisp_dump().


Generated on Thu Jul 24 10:24:52 2003 for Construo by doxygen1.3-rc3