|
Graphviz 15.1.0~dev.20260610.0127
|
#include <ast/ast.h>#include <inttypes.h>#include <expr/exparse.h>#include <assert.h>#include <cdt.h>#include <stdarg.h>#include <stdbool.h>#include <stddef.h>#include <stdio.h>#include <util/agxbuf.h>#include <util/arena.h>Go to the source code of this file.
Data Structures | |
| struct | Exid_s |
| struct | Exref_s |
| union | Exdata_u |
| struct | Exnode_s |
| struct | Exdisc_s |
| struct | Expr_s |
Macros | |
| #define | EX_VERSION 20000101L |
| #define | EX_CHARSTRING (1 << 0) /* '...' same as "..." */ |
| #define | EX_UNDECLARED (1 << 9) /* allow undeclared identifiers */ |
| #define | EX_ARRAY (-3) /* getval() array elt */ |
| #define | EX_CALL (-2) /* getval() function call elt */ |
| #define | EX_SCALAR (-1) /* getval() scalar elt */ |
| #define | EX_NAMELEN 32 /* default Exid_t.name length */ |
| #define | EX_ID(n, l, i, t) {{0}, (l), (i), (t), 0, 0, 0, n} |
| #define | DELETE_T MINTOKEN /* exexpr() delete `type' */ |
| #define | INTEGRAL(t) ((t) >= INTEGER && (t) <= CHARACTER) |
| #define | BUILTIN(t) ((t) > MINTOKEN) |
| #define | F 01 /* FLOATING */ |
| #define | I 02 /* INTEGER */ |
| #define | S 03 /* STRING */ |
| #define | TBITS 4 |
| #define | TMASK ((1 << TBITS) - 1) |
| #define | A(n, t) ((t) << ((n) * TBITS)) /* function arg n is type t */ |
| #define | N(t) ((t) >>= TBITS) /* shift for next arg */ |
Typedefs | |
| typedef EX_STYPE | Extype_t |
| typedef union Exdata_u | Exdata_t |
| typedef struct Exdisc_s | Exdisc_t |
| typedef struct Exnode_s | Exnode_t |
| typedef struct Expr_s | Expr_t |
| typedef struct Exref_s | Exref_t |
| typedef void(* | Exerror_f) (const char *, void *, int, const char *,...) |
| typedef void(* | Exexit_f) (void *, int) |
| typedef struct Exid_s | Exid_t |
Functions | |
| Exnode_t * | excast (Expr_t *, Exnode_t *, long, Exnode_t *, int) |
| Exnode_t * | exnoncast (Exnode_t *) |
| void | exclose (Expr_t *) |
| int | excomp (Expr_t *p, const char *name, int line, FILE *fp, char *prefix) |
| char * | excontext (Expr_t *, char *, int) |
| void | exdump (Expr_t *, Exnode_t *, agxbuf *) |
| void | exerror (const char *,...) |
| void | exwarn (const char *,...) |
| Extype_t | exeval (Expr_t *, Exnode_t *, void *) |
| Exnode_t * | exexpr (Expr_t *, const char *, Exid_t *, int) |
| void | exfreenode (Expr_t *, Exnode_t *) |
| Exnode_t * | exnewnode (Expr_t *, long, bool, long, Exnode_t *, Exnode_t *) |
| char * | exnospace (void) |
| Expr_t * | exopen (Exdisc_t *) |
| int | expop (Expr_t *) |
| int | expush (Expr_t *, const char *, int, FILE *) |
| int | extoken_fn (Expr_t *) |
| char * | exstring (Expr_t *, char *) |
| void * | exstralloc (Expr_t *, size_t) |
| char * | extype (long int) |
| Extype_t | exzero (long int) |
| char * | exopname (long) |
| void | exinit (void) |
| char * | extypename (Expr_t *p, long) |
| int | exisAssign (Exnode_t *) |
| static char * | exprintf (arena_t *vm, const char *fmt,...) |
| #define EX_UNDECLARED (1 << 9) /* allow undeclared identifiers */ |
| typedef void(* Exerror_f) (const char *, void *, int, const char *,...) |
| void exclose | ( | Expr_t * | ) |
| int excomp | ( | Expr_t * | p, |
| const char * | name, | ||
| int | line, | ||
| FILE * | fp, | ||
| char * | prefix | ||
| ) |
Compile an expression
The callee takes ownership of the pointer prefix and will free it during expop or exclose.
| p | Program structure to store result in |
| name | Filename of originating source file |
| line | Line number of originating source file |
| fp | Handle to source file |
| prefix | Optional program text to include ahead of the file content |
Referenced by compile().
| char * excontext | ( | Expr_t * | p, |
| char * | buf, | ||
| int | n | ||
| ) |
Definition at line 29 of file excontext.c.
References gv_isspace().
Referenced by make_msg().
Definition at line 617 of file excc.c.
References agxbprint(), agxbputc(), dtfirst, dtnext, Excc_t::expr, gen(), PROCEDURE, and Expr_s::symbols.
Referenced by deparse().
| void exerror | ( | const char * | format, |
| ... | |||
| ) |
Definition at line 63 of file exerror.c.
References expr, format, free(), Expr_s::id, make_msg(), and Exstate_t::program.
Referenced by assignable(), cloneGraph(), cloneO(), cloneSubg(), closeFile(), convert(), copy(), deref(), eval(), ex_error(), exnospace(), exsubstr(), extoken_fn(), freadFile(), fwriteFile(), getArg(), getval(), in(), length(), lookup(), nxtAttr(), openFile(), prformat(), print(), readFile(), readLine(), refval(), scan(), scformat(), setval(), stringOf(), strToTvtype(), toKind(), tvtypeToStr(), typeChk(), writeFile(), xConvert(), and xPrint().
Definition at line 1949 of file exeval.c.
References eval(), and RETURN.
Referenced by eval(), evalEdge(), evalNode(), gvpr_core(), and prformat().
Definition at line 28 of file exexpr.c.
References Exnode_s::data, DELETE_T, dtmatch, excast(), exfreenode(), Exid_s::lex, NAME, NULL, PROCEDURE, Expr_s::symbols, type, and Exid_s::value.
Referenced by compile().
| void exinit | ( | void | ) |
| int exisAssign | ( | Exnode_t * | ) |
| char * exnospace | ( | void | ) |
Definition at line 27 of file exnospace.c.
References exerror().
Referenced by if().
Definition at line 40 of file exopen.c.
References disc, dtinsert, dtopen(), Dtset, exbuiltin, exclose(), Expr_s::file, free_exid(), Expr_s::id, dtdisc_s_::key, Exid_s::name, PROCEDURE, setcontext, and Expr_s::symbols.
Referenced by compileProg().
| char * exopname | ( | long | op | ) |
|
inlinestatic |
Construct an arena-backed string.
| vm | Allocator to use. |
| fmt | printf-style format sting. |
| ... | printf-style varargs. |
Definition at line 275 of file expr.h.
References gv_arena_alloc(), len(), and NULL.
Referenced by eval().
| int expush | ( | Expr_t * | , |
| const char * | , | ||
| int | , | ||
| FILE * | |||
| ) |
| void * exstralloc | ( | Expr_t * | ex, |
| size_t | sz | ||
| ) |
| char * exstring | ( | Expr_t * | ex, |
| char * | s | ||
| ) |
Definition at line 1964 of file exeval.c.
References gv_arena_strdup().
Referenced by bbOf(), colorx(), nameOf(), readLine(), and xyOf().
| int extoken_fn | ( | Expr_t * | ex | ) |
Definition at line 313 of file extoken.c.
References agxbclear(), agxbput(), agxbputc(), agxbuse(), AND, CHARACTER, chrtoi(), DEC, DECLARE, dtinsert, dtmatch, DYNAMIC, EQ, error_info, EX_CHARSTRING, ex_lval, EX_NAMELEN, exerror(), expr, expush(), extoken_fn(), exunlex, FLOATING, EX_STYPE::floating, GE, gv_arena_alloc(), gv_arena_strdup(), gv_isalnum(), gv_isalpha(), gv_isdigit(), gv_isspace(), gv_isxdigit(), ID, EX_STYPE::id, id_string, INC, Exid_s::index, INTEGER, EX_STYPE::integer, LABEL, LE, lex, Exid_s::lex, Error_info_s::line, LSH, NAME, Exid_s::name, NE, Exstate_t::nolabel, NULL, EX_STYPE::op, OR, PRAGMA, RSH, setcontext, streq(), stresc(), STRING, EX_STYPE::string, Expr_s::symbols, UNREACHABLE, UNSIGNED, and Expr_s::vm.
Referenced by extoken_fn().
| char * extype | ( | long int | type | ) |
| char * extypename | ( | Expr_t * | p, |
| long | |||
| ) |
| void exwarn | ( | const char * | format, |
| ... | |||
| ) |
Definition at line 77 of file exerror.c.
References ERROR_WARNING, expr, format, free(), Expr_s::id, make_msg(), and Exstate_t::program.
Referenced by exsub(), readFile(), and writeFile().
| Extype_t exzero | ( | long int | type | ) |
Definition at line 26 of file exzero.c.
References expr, FLOATING, EX_STYPE::floating, INTEGER, EX_STYPE::integer, Exstate_t::nullstring, STRING, EX_STYPE::string, type, and UNSIGNED.
Referenced by eval(), getdyn(), and refval().