|
x-engine-c v0.2.13
The C engine for x-lang
|
S-expression analyser and reader for integer literals. More...
#include "x-obj.h"Go to the source code of this file.
Functions | |
| x_obj_t * | x_sexp_int_analyse_digits (x_obj_t *p_base, x_obj_t *p_args) |
| x_obj_t * | x_sexp_int_analyse_xdigits (x_obj_t *p_base, x_obj_t *p_args) |
| x_obj_t * | x_sexp_int_analyse_base (x_obj_t *p_base, x_obj_t *p_args) |
| x_obj_t * | x_sexp_int_analyse_prefix (x_obj_t *p_base, x_obj_t *p_args) |
| x_obj_t * | x_sexp_int_analyse_sign (x_obj_t *p_base, x_obj_t *p_args) |
| x_obj_t * | x_sexp_int_read (x_obj_t *p_base, x_obj_t *p_args) |
Variables | |
Analyser state primitives (spair – composable state machines). | |
| x_spair_t | x_sexp_int_analyse_sign_prim |
| x_spair_t | x_sexp_int_analyse_prefix_prim |
| x_spair_t | x_sexp_int_analyse_base_prim |
| x_spair_t | x_sexp_int_analyse_digits_prim |
| x_spair_t | x_sexp_int_analyse_xdigits_prim |
Read primitives (satom – type-internal). | |
| x_satom_t | x_sexp_int_read_prim |
S-expression analyser and reader for integer literals.
Analyse: detect 0x hex prefix or fall through to decimal digits.
Analyse: detect 0x/ prefix or fall through to decimal.0X hex
If the current character is x or X, transitions to the xdigits state. Otherwise delegates to the digits analyser.
| p_base | Base (execution context). |
| p_args | Pair of (self, read-args). |
Analyse: consume decimal digits and score.
Analyse: consume decimal digits and score.
Returns self while digits are being read. On a non-digit, backs up the read pointer and scores the buffer length (or returns NULL if no digits were consumed).
| p_base | Base (execution context). |
| p_args | Pair of (self, read-args). |
Analyse: handle leading 0 (possible hex prefix) or first digit.
Analyse: handle leading 0 (possible hex prefix) or first digit.
A leading 0 transitions to the base state; other digits delegate to the digits analyser; non-digits cause rejection.
| p_base | Base (execution context). |
| p_args | Pair of (self, read-args). |
Analyse: handle optional leading +/- sign.
Analyse: handle optional leading + or - sign.
If a sign character is found, transitions to the prefix state. Otherwise delegates directly to the prefix analyser.
| p_base | Base (execution context). |
| p_args | Pair of (self, read-args). |
Analyse: consume hexadecimal digits and score.
Analyse: consume hexadecimal digits and score.
Identical logic to analyse_digits but accepts 0-9, a-f, A-F.
| p_base | Base (execution context). |
| p_args | Pair of (self, read-args). |
Read an integer literal from the token buffer.
Read an integer literal from the token buffer.
Parses the buffer contents with x_lib_strtoint using base 0 (auto-detecting decimal, octal, or hexadecimal).
| p_base | Base (execution context). |
| p_args | Read-args whose first element is the token buffer. |
| x_spair_t x_sexp_int_analyse_base_prim |
| x_spair_t x_sexp_int_analyse_digits_prim |
| x_spair_t x_sexp_int_analyse_prefix_prim |
|
extern |
| x_spair_t x_sexp_int_analyse_xdigits_prim |
|
extern |