x-engine-c v0.2.13
The C engine for x-lang
Loading...
Searching...
No Matches
symbol.h File Reference

S-expression analyser and reader for symbols. More...

#include "x-obj.h"

Go to the source code of this file.

Functions

x_obj_tx_sexp_symbol_analyse (x_obj_t *p_base, x_obj_t *p_args)
 
x_obj_tx_sexp_symbol_read (x_obj_t *p_base, x_obj_t *p_args)
 

Variables

Analyser / reader primitives (satom).
x_satom_t x_sexp_symbol_analyse_prim
 
x_satom_t x_sexp_symbol_read_prim
 

Detailed Description

S-expression analyser and reader for symbols.

Author
Jon Ruttan (jonru.nosp@m.ttan.nosp@m.@gmai.nosp@m.l.co.nosp@m.m)

Function Documentation

◆ x_sexp_symbol_analyse()

x_obj_t * x_sexp_symbol_analyse ( x_obj_t p_base,
x_obj_t p_args 
)

Analyse: match any non-delimiter sequence as a symbol (negative score).

Analyse: match any non-delimiter sequence as a symbol.

Symbols are the fallback token type. If no delimiter is found, the analyser keeps reading. When a delimiter terminates the sequence, the buffer length is scored as a negative value so that more specific types (which score positively) always win ties.

Parameters
p_baseBase (execution context).
p_argsRead-args containing the token buffer and score.
Returns
The args (keep reading), score (on delimiter), or NULL (empty).

◆ x_sexp_symbol_read()

x_obj_t * x_sexp_symbol_read ( x_obj_t p_base,
x_obj_t p_args 
)

Read a symbol from the token buffer (intern via type_symbol_make).

Read a symbol from the token buffer.

Copies the buffer contents into a new string, then interns it as a symbol through x_type_symbol_make.

Parameters
p_baseBase (execution context).
p_argsRead-args containing the token buffer.
Returns
An interned symbol object.

Variable Documentation

◆ x_sexp_symbol_analyse_prim

x_satom_t x_sexp_symbol_analyse_prim
extern

◆ x_sexp_symbol_read_prim

x_satom_t x_sexp_symbol_read_prim