1 #ifndef _LIBSAPLING_LEXER_H_
2 #define _LIBSAPLING_LEXER_H_
11 void *lexer__data(
const node_t node);
12 void lexer__access(
enum qt qt, node_t *ref,
void *info,
predicate_t predicate,
14 void lexer__print(FILE *stream, node_t *ref,
fpfdata_t fpfdata);
15 void lexer__dump_dot(FILE *stream, node_t *ref,
fpfdata_t fpfdata);
16 int lexer__length(
const node_t *ref);
void(* apply_t)(node_t *ref, const struct info_stack *info)
Performs a user-defined operation on the node.
Definition: graph.h:117
void(* fpfdata_t)(FILE *stream, const void *data)
File print format data function prototype.
Definition: graph.h:152
int(* predicate_t)(const node_t *ref, const struct info_stack *info)
Decides whether to run the apply function on an item. Behavior is modified by quantifiers.
Definition: graph.h:112
void ** lexer__next_terminal(node_t *ref, struct lexer_state *sta)
Processes the set character buffer up until it finds the next acceptable lexeme and returns a pointer...
void lexer__class(node_t *dst, const char *expr)
Build an automaton that accepts a class of characters.
const char * lexer__to_string(node_t *ref, node_t *map)
Prints a lexer automaton in a somewhat-more human readable form.
void lexer__kleene_plus(node_t *dst)
node_t lexer__enumerate_states(node_t *ref)
Returns an AVL map of (node_t, int)
void lexer__copy(node_t *dst, node_t *src)
Build a copy of a given automaton.
void lexer__set_accepting_states_data(node_t *ref, void *data)
Sets the data pointer value of all accepting state of the automaton.
void lexer__minimize(node_t *dst)
void lexer__literal(node_t *dst, const char *expr)
Build an automaton that accepts a string literal.
void lexer__kleene_star(node_t *dst)
void lexer__concatenation(node_t *dst, node_t *src)
void lexer__init(struct lexer_state *ref, const char *buf)
Initializes a lexer state object.
void lexer__union(node_t *dst, node_t *src)
void lexer__anything(node_t *dst)
Build an automaton that accepts one of any character.
qt
Quantifier definitions.
Definition: logic.h:10
Lexer state object.
Definition: lexer.h:144
void ** ref_to_data
Definition: lexer.h:148
int end
Definition: lexer.h:151
const char * buf
Definition: lexer.h:145
char lexeme[4096]
Definition: lexer.h:149
int cursor
Definition: lexer.h:146
int overread
Definition: lexer.h:147