|
LispBM
|
#include <stdbool.h>#include <ctype.h>#include <string.h>#include <stdlib.h>#include "lbm_memory.h"#include "lbm_types.h"#include "lbm_channel.h"#include "tokpar.h"#include "symrepr.h"#include "heap.h"#include "env.h"
Data Structures | |
| struct | matcher |
Macros | |
| #define | NUM_FIXED_SIZE_TOKENS 18 |
| #define | NUM_TYPE_QUALIFIERS 9 |
| #define | TD_BUF_SIZE 128 |
| #define | FBUF_ADD(X, N) if ((N) < TD_BUF_SIZE) { fbuf[(N)] = (X); N++; } else goto tok_double_no_tok; |
Functions | |
| static signed char | translate_escape_char (char c) |
| static int | tok_match_fixed_size_tokens (lbm_char_channel_t *chan, const matcher *m, unsigned int start_pos, unsigned int num, uint32_t *res) |
| int | tok_syntax (lbm_char_channel_t *chan, uint32_t *res) |
| static bool | alpha_char (char c) |
| static bool | num_char (char c) |
| static bool | symchar0 (char c) |
| static bool | symchar (char c) |
| int | tok_symbol (lbm_char_channel_t *chan) |
| int | tok_string (lbm_char_channel_t *chan, unsigned int *string_len) |
| int | tok_char (lbm_char_channel_t *chan, char *res) |
| int | tok_double (lbm_char_channel_t *chan, token_float *result) |
| bool | tok_clean_whitespace (lbm_char_channel_t *chan) |
| int | tok_integer (lbm_char_channel_t *chan, token_int *result) |
Variables | |
| char | tokpar_sym_str [TOKENIZER_MAX_SYMBOL_AND_STRING_LENGTH+1] |
| const matcher | fixed_size_tokens [NUM_FIXED_SIZE_TOKENS] |
| const matcher | type_qual_table [NUM_TYPE_QUALIFIERS] |
| #define FBUF_ADD | ( | X, | |
| N | |||
| ) | if ((N) < TD_BUF_SIZE) { fbuf[(N)] = (X); N++; } else goto tok_double_no_tok; |
| #define NUM_FIXED_SIZE_TOKENS 18 |
| #define NUM_TYPE_QUALIFIERS 9 |
| #define TD_BUF_SIZE 128 |
|
static |
|
static |
|
static |
|
static |
| int tok_char | ( | lbm_char_channel_t * | chan, |
| char * | res | ||
| ) |
Attempt to read a character from the character stream.
| chan | Character channel to read characters from. |
| res | Result character if successful. |
| bool tok_clean_whitespace | ( | lbm_char_channel_t * | chan | ) |
Clean off whitespace from head of the character stream
| int tok_double | ( | lbm_char_channel_t * | chan, |
| token_float * | result | ||
| ) |
Attempt to read a floating point number from the character stream.
| chan | Character channel to read characters from. |
| res | Result token_float-object if successful. |
| int tok_integer | ( | lbm_char_channel_t * | chan, |
| token_int * | result | ||
| ) |
Attempt to read an integer value from the character stream.
| chan | Character channel to read characters from. |
| res | Result token_int-object if successful. |
|
static |
| int tok_string | ( | lbm_char_channel_t * | chan, |
| unsigned int * | string_len | ||
| ) |
Attempt to read a string from the character stream. If successful the resulting string is found in tokpar_sym_str.
| chan | Character channel to read characters from. |
| int tok_symbol | ( | lbm_char_channel_t * | chan | ) |
Attempt to read a symbol from the character stream. If successful the resulting symbol string is found in tokpar_sym_str.
| chan | Character channel to read characters from. |
| int tok_syntax | ( | lbm_char_channel_t * | chan, |
| uint32_t * | res | ||
| ) |
Attempt to read a "syntax" token from the character stream. A "syntax" token is for example '(', ')', '@' and so on.
| chan | Character channel to read characters from. |
| res | Result token identifier. |
|
inlinestatic |
| const matcher fixed_size_tokens[NUM_FIXED_SIZE_TOKENS] |
| char tokpar_sym_str[TOKENIZER_MAX_SYMBOL_AND_STRING_LENGTH+1] |
| const matcher type_qual_table[NUM_TYPE_QUALIFIERS] |