#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include "dlispparser.h"
Internal static functions used inside parser reader | |
This section describes function that are used only inside the parser system. | |
static void | lisp_error (FILE *f, const char *sentence) |
generate an error, and exit. | |
static void | skip_to_newline (FILE *f) |
skip up to the next newline | |
static int | peek_char_raw (FILE *f) |
peek one character, only for read_noncomment_char | |
static void | skip_to_comment_terminator (FILE *f) |
Multi-line comment procedure. | |
static int | read_noncomment_char (FILE *f) |
read a new character, excluding comments. | |
static int | peek_char (FILE *f) |
peek one character, taking comments in consideration. | |
static int | force_read_char (FILE *f, int want_char, const char *accept_char) |
Force-read char, and give error. | |
static void | skip_spaces (FILE *f) |
skip space, ignoring comments. | |
static dlisp_lispentry * | alloc_lispentry (FILE *f) |
allocate lisp entry structure. | |
static char * | read_lisp_name (FILE *f, const char *terminatorstring) |
read lisp symbol, delimited by terminatorstring. | |
static dlisp_lispentry * | read_lisp_entity (FILE *f) |
read a entity. | |
Functions | |
dlisp_lispentry * | dlisp_read_lisp_bracket (FILE *f) |
Read inside bracket of lisp string. | |
dlisp_lispentry * | dlisp_read_lisp_text (FILE *f) |
read a string of lisp text, with many brackets, and create a tree representation of it. |
|
allocate lisp entry structure.
|
|
Read inside bracket of lisp string. Read from a file stream, and return a dlisp_lispentry structure parsing the lisp construct.
|
|
read a string of lisp text, with many brackets, and create a tree representation of it.
|
|
Force-read char, and give error.
|
|
generate an error, and exit. Noting the current character position
|
|
peek one character, taking comments in consideration.
|
|
peek one character, only for read_noncomment_char
|
|
read a entity. entity -> lisp-bracket | term lisp-bracket -> (entity*) |
|
read lisp symbol, delimited by terminatorstring. escape is done with "\" current buffer position previous char, used for checking \ |
|
read a new character, excluding comments.
|
|
skip space, ignoring comments.
|
|
Multi-line comment procedure. skip to !# |
|
skip up to the next newline
|