Graphviz 16.1.1~dev.20261012.0359
Loading...
Searching...
No Matches
compile.c File Reference
#include "config.h"
#include <assert.h>
#include <ast/error.h>
#include <cgraph/cgraph.h>
#include <gvpr/actions.h>
#include <gvpr/compile.h>
#include <inttypes.h>
#include <limits.h>
#include <math.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <util/agxbuf.h>
#include <util/alloc.h>
#include <util/list.h>
#include <util/prisize_t.h>
#include <util/startswith.h>
#include <util/strview.h>
#include <util/unreachable.h>
#include <gvpr/gdefs.h>
#include <ctype.h>
#include <gvpr/trie.c>
Include dependency graph for compile.c:

Go to the source code of this file.

Macros

#define MIN(a, b)   ((a) < (b) ? (a) : (b))
 
#define MAX(a, b)   ((a) > (b) ? (a) : (b))
 
#define MINTYPE   (LAST_M + 1) /* First type occurs after last M_ */
 
#define haveGraph   (1 <= codePhase && codePhase <= 4)
 
#define haveTarget   (2 <= codePhase && codePhase <= 4)
 
#define inWalk   (2 <= codePhase && codePhase <= 3)
 

Functions

static int isedge (Agobj_t *obj)
 
static void * int2ptr (long long i)
 
static long long ptr2int (const void *p)
 
static char * nameOf (Expr_t *ex, Agobj_t *obj, agxbuf *tmps)
 
static char * bbOf (Expr_t *pgm, char *pt, bool getll)
 
static char * xyOf (Expr_t *pgm, char *pt, bool getx)
 
static int posOf (Agnode_t *np, int idx, double *v)
 
static Agdesc_t xargs (char *args)
 
static char * deparse (Expr_t *ex, Exnode_t *n, agxbuf *xb)
 
static Agobj_t * deref (Expr_t *pgm, Exnode_t *x, Exref_t *ref, Agobj_t *objp, Gpr_t *state)
 
static void assignable (Agobj_t *objp, unsigned char *name)
 
static int setattr (Agobj_t *objp, char *name, char *val)
 
static char * kindToStr (int kind)
 
static char * kindOf (Agobj_t *objp)
 string representation of object’s kind
 
static int lookup (Expr_t *pgm, Agobj_t *objp, Exid_t *sym, Extype_t *v)
 
static int getArg (long long n, Gpr_t *state, strview_t *out)
 
static int setDfltAttr (Agraph_t *gp, char *k, char *name, char *value)
 
static int toKind (char *k, char *fn)
 
static char * nxtAttr (Agraph_t *gp, char *k, char *name)
 
static char * getDfltAttr (Agraph_t *gp, char *k, char *name)
 
static Extype_t getval (Expr_t *pgm, Exnode_t *node, Exid_t *sym, Exref_t *ref, void *env, int elt, Exdisc_t *disc)
 
static char * typeName (long op)
 
static int setval (Expr_t *pgm, Exnode_t *x, Exid_t *sym, Exref_t *ref, void *env, Extype_t v)
 
static Extype_t length (Exid_t *rhs, Exdisc_t *disc)
 
static int in (Extype_t lhs, Exid_t *rhs, Exdisc_t *disc)
 
static tctype typeChk (tctype intype, Exid_t *sym)
 
static tctype typeChkExp (Exref_t *ref, Exid_t *sym)
 
static Extype_t refval (Expr_t *pgm, Exnode_t *node, Exid_t *sym, Exref_t *ref)
 
static int binary (Exnode_t *l, Exnode_t *ex, Exnode_t *r, int arg)
 
static int strToTvtype (char *s)
 
static char * tvtypeToStr (long long v)
 
static int stringOf (Expr_t *prog, Exnode_t *x, int arg)
 
static int convert (Exnode_t *x, long type, int arg)
 
static Extype_t keyval (Extype_t v, long type)
 
static Exdisc_t * initDisc (Gpr_t *state)
 
static Exnode_t * compile (Expr_t *prog, char *src, char *input, int line, const char *lbl, const char *sfx, int kind)
 
static void checkGuard (Exnode_t *gp, char *src, int line)
 
static case_stmt * mkStmts (Expr_t *prog, char *src, case_infos_t cases, const char *lbl)
 
static bool mkBlock (comp_block *bp, Expr_t *prog, char *src, parse_block *inp, size_t i)
 
static const char * doFlags (compflags_t flags)
 
comp_prog * compileProg (parse_prog *inp, Gpr_t *state, compflags_t flags)
 
void freeCompileProg (comp_prog *p)
 
Agraph_t * readG (FILE *fp)
 
Agraph_t * openG (char *name, Agdesc_t desc)
 
Agraph_t * openSubg (Agraph_t *g, char *name)
 
Agnode_t * openNode (Agraph_t *g, char *name)
 
Agedge_t * openEdge (Agraph_t *g, Agnode_t *t, Agnode_t *h, char *key)
 

Variables

static int codePhase
 
static int a2t []
 

Macro Definition Documentation

◆ haveGraph

#define haveGraph   (1 <= codePhase && codePhase <= 4)

Definition at line 1662 of file compile.c.

◆ haveTarget

#define haveTarget   (2 <= codePhase && codePhase <= 4)

Definition at line 1663 of file compile.c.

◆ inWalk

#define inWalk   (2 <= codePhase && codePhase <= 3)

Definition at line 1664 of file compile.c.

◆ MAX

#define MAX (   a,
  b 
)    ((a) > (b) ? (a) : (b))

Definition at line 44 of file compile.c.

◆ MIN

#define MIN (   a,
  b 
)    ((a) < (b) ? (a) : (b))

Definition at line 43 of file compile.c.

◆ MINTYPE

#define MINTYPE   (LAST_M + 1) /* First type occurs after last M_ */

Definition at line 1530 of file compile.c.

Function Documentation

◆ assignable()

static void assignable ( Agobj_t *  objp,
unsigned char *  name 
)
static

Definition at line 271 of file compile.c.

References AGNODE, AGRAPH, AGTYPE, E, exerror(), G, TFA_Advance, TFA_Definition, TFA_Init, TFA_State, V, and Y.

Referenced by setval().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bbOf()

static char * bbOf ( Expr_t *  pgm,
char *  pt,
bool  getll 
)
static

Definition at line 91 of file compile.c.

References exstralloc(), exstring(), and len().

Referenced by getval().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ binary()

static int binary ( Exnode_t *  l,
Exnode_t *  ex,
Exnode_t *  r,
int  arg 
)
static

Definition at line 1843 of file compile.c.

References BUILTIN, compare(), Exdata_u::constant, Exnode_s::data, EQ, GE, int2ptr(), EX_STYPE::integer, INTEGRAL, LE, NE, Exnode_s::op, Exnode_s::type, and Exdata_u::value.

Referenced by initDisc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkGuard()

static void checkGuard ( Exnode_t *  gp,
char *  src,
int  line 
)
static

Definition at line 2243 of file compile.c.

References error, ERROR_WARNING, exisAssign(), exnoncast(), and setErrorFileLine().

Referenced by mkStmts().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ compile()

static Exnode_t * compile ( Expr_t *  prog,
char *  src,
char *  input,
int  line,
const char *  lbl,
const char *  sfx,
int  kind 
)
static

Definition at line 2204 of file compile.c.

References agxbdisown(), agxbprint(), error, ERROR_ERROR, excomp(), exexpr(), getErrorErrors(), label(), and NULL.

Referenced by compileProg(), mkBlock(), and mkStmts().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ compileProg()

comp_prog * compileProg ( parse_prog *  inp,
Gpr_t *  state,
compflags_t  flags 
)

Definition at line 2367 of file compile.c.

References comp_prog::begin_stmt, parse_prog::begin_stmt, comp_prog::blocks, parse_prog::blocks, codePhase, compile(), doFlags(), Gpr_t::dp, comp_prog::end_stmt, parse_prog::end_stmt, comp_prog::endg_stmt, parse_prog::endg_stmt, error, ERROR_ERROR, exinit(), exopen(), flags, freeCompileProg(), G, getErrorErrors(), gv_calloc(), initDisc(), parse_prog::l_begin, parse_prog::l_end, parse_prog::l_endg, LIST_AT, LIST_IS_EMPTY, LIST_SIZE, mkBlock(), comp_prog::n_blocks, NULL, comp_prog::prog, setErrorLine(), parse_prog::source, symbols, T_graph, TBITS, tchk, Exid_s::type, comp_prog::uses_graph, VOIDTYPE, and Y.

Referenced by gvpr_core().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ convert()

static int convert ( Exnode_t *  x,
long  type,
int  arg 
)
static

Definition at line 2080 of file compile.c.

References AGNODE, AGRAPH, AGTYPE, BUILTIN, Exdata_u::constant, Exnode_s::data, exerror(), FLOATING, int2ptr(), INTEGER, EX_STYPE::integer, isedge(), STRING, EX_STYPE::string, strToTvtype(), T_edge, T_graph, T_node, tvtypeToStr(), type, Exnode_s::type, validTVT(), and Exdata_u::value.

Referenced by initDisc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ deparse()

static char * deparse ( Expr_t *  ex,
Exnode_t *  n,
agxbuf *  xb 
)
static

Definition at line 194 of file compile.c.

References agxbuse(), and exdump().

Referenced by deref(), getval(), refval(), and setval().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ deref()

static Agobj_t * deref ( Expr_t *  pgm,
Exnode_t *  x,
Exref_t *  ref,
Agobj_t *  objp,
Gpr_t *  state 
)
static

Definition at line 204 of file compile.c.

References AGHEAD, AGTAIL, agxbfree(), Exdata_u::constant, Gpr_t::curgraph, Gpr_t::curobj, Exnode_s::data, deparse(), deref(), Exdata_u::dyna, DYNAMIC, exerror(), Exid_s::index, int2ptr(), EX_STYPE::integer, isedge(), Exid_s::lex, Exid_s::name, Exref_s::next, Gpr_t::nextgraph, Gpr_t::outgraph, Exref_s::symbol, Gpr_t::target, Gpr_t::tvedge, Gpr_t::tvnext, Gpr_t::tvroot, Exdata_u::value, and Exdata_u::variable.

Referenced by deref(), getval(), and setval().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ doFlags()

static const char * doFlags ( compflags_t  flags)
static

Definition at line 2353 of file compile.c.

References flags.

Referenced by compileProg().

Here is the caller graph for this function:

◆ freeCompileProg()

void freeCompileProg ( comp_prog *  p)

Definition at line 2446 of file compile.c.

References comp_prog::blocks, comp_block::edge_stmts, exclose(), free(), comp_prog::n_blocks, comp_block::node_stmts, and comp_prog::prog.

Referenced by compileProg(), and gvpr().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getArg()

static int getArg ( long long  n,
Gpr_t *  state,
strview_t *  out 
)
static

get value associated with $n

Parameters
out[out] Found argument on success
Returns
0 on success

Definition at line 465 of file compile.c.

References Gpr_t::args, exerror(), LIST_GET, LIST_SIZE, NULL, and out().

Referenced by getval().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getDfltAttr()

static char * getDfltAttr ( Agraph_t *  gp,
char *  k,
char *  name 
)
static

Definition at line 546 of file compile.c.

References agattr_text(), Agsym_s::defval, error, ERROR_WARNING, kindToStr(), and toKind().

Referenced by getval().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getval()

static Extype_t getval ( Expr_t *  pgm,
Exnode_t *  node,
Exid_t *  sym,
Exref_t *  ref,
void *  env,
int  elt,
Exdisc_t *  disc 
)
static

Definition at line 558 of file compile.c.

References addEdge(), addNode(), agattr_text(), agattrsym(), agcontains(), agdegree(), agfstedge(), agfstin(), agfstnode(), agfstout(), agfstsubg(), aghead, aghtmlstr(), AGINEDGE, agisdirected(), agisstrict(), agnedges(), agnnodes(), AGNODE, agnode(), agnxtedge(), agnxtin(), agnxtnode(), agnxtout(), agnxtsubg(), AGOUTEDGE, AGRAPH, agraphof(), agrelabel_node(), agroot(), agsubg(), agtail, AGTYPE, agxbfree(), agxget(), Gpr_t::args, bbOf(), canon(), cloneG(), cloneO(), closeFile(), colorx(), compOf(), CONSTANT, copy(), copyAttr(), Gpr_t::curgraph, Gpr_t::curobj, strview_t::data, deleteObj(), deparse(), deref(), disc, error, ERROR_ERROR, ERROR_WARNING, EX_ARRAY, EX_CALL, exerror(), exstralloc(), findBinding(), EX_STYPE::floating, gvprbinding::fn, freadFile(), fwriteFile(), getArg(), getDfltAttr(), graphviz_node_induce(), ID, Exid_s::index, indexOf(), Gpr_t::infname, int2ptr(), EX_STYPE::integer, isEdge(), kindOf(), LAST_V, Exid_s::lex, LIST_APPEND, LIST_REMOVE, LIST_SIZE, lockGraph(), lookup(), match(), MAX, MIN, Exid_s::name, nameOf(), Gpr_t::nextgraph, NULL, nxtAttr(), openEdge(), openFile(), openG(), openNode(), openSubg(), Gpr_t::outFile, Gpr_t::outgraph, ptr2int(), readFile(), readLine(), rindexOf(), setattr(), setDfltAttr(), sfioWrite(), strview_t::size, SIZE_MAX, EX_STYPE::string, Gpr_t::target, Gpr_t::tgtname, toHtml(), toKind(), toLower(), toUpper(), Gpr_t::tvedge, Gpr_t::tvnext, Gpr_t::tvroot, Gpr_t::tvt, UNREACHABLE, writeFile(), xargs(), and xyOf().

Referenced by initDisc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ in()

static int in ( Extype_t  lhs,
Exid_t *  rhs,
Exdisc_t *  disc 
)
static

gvpr’s custom in implementation

The main purpose of this is to extend in to work on the command line options array, ARGV.

Parameters
lhsThe left-hand side operand to in.
rhsThe right-hand side operand to in.
discThe libexpr discipline.
Returns
Non-zero if lhs was found to be within rhs.

Definition at line 1646 of file compile.c.

References Gpr_t::args, disc, exerror(), Exid_s::index, EX_STYPE::integer, LIST_SIZE, and Exid_s::name.

Referenced by agdeledgeimage(), initDisc(), installedge(), MdiChild::loadFile(), newedge(), and Blocks::totalOrder().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initDisc()

static Exdisc_t * initDisc ( Gpr_t *  state)
static

Definition at line 2168 of file compile.c.

References a2t, binary(), Exdisc_s::binaryf, convert(), Exdisc_s::convertf, Gpr_t::dp, Gpr_t::errf, error, ERROR_ERROR, errorf(), Exdisc_s::errorf, EX_CHARSTRING, EX_UNDECLARED, EX_VERSION, Exdisc_s::exitf, Gpr_t::exitf, Exdisc_s::flags, Exdisc_s::getf, getval(), in(), Exdisc_s::inf, Exdisc_s::keyf, keyval(), length(), Exdisc_s::lengthf, Exdisc_s::reff, refval(), Exdisc_s::setf, setval(), stringOf(), Exdisc_s::stringof, Exdisc_s::symbols, symbols, typeName(), Exdisc_s::typename, Exdisc_s::types, Exdisc_s::user, and Exdisc_s::version.

Referenced by compileProg().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ int2ptr()

static void * int2ptr ( long long  i)
static

Definition at line 51 of file compile.c.

Referenced by binary(), convert(), deref(), getval(), keyval(), setval(), and stringOf().

Here is the caller graph for this function:

◆ isedge()

static int isedge ( Agobj_t *  obj)
static

Definition at line 39 of file compile.c.

References AGINEDGE, AGOUTEDGE, and AGTYPE.

Referenced by convert(), deref(), and lookup().

Here is the caller graph for this function:

◆ keyval()

static Extype_t keyval ( Extype_t  v,
long  type 
)
static

Definition at line 2156 of file compile.c.

References AGID, int2ptr(), EX_STYPE::integer, and type.

Referenced by initDisc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kindOf()

static char * kindOf ( Agobj_t *  objp)
static

Definition at line 325 of file compile.c.

References agobjkind(), and kindToStr().

Referenced by getval(), and lookup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kindToStr()

static char * kindToStr ( int  kind)
static

Definition at line 312 of file compile.c.

References AGNODE, and AGRAPH.

Referenced by getDfltAttr(), and kindOf().

Here is the caller graph for this function:

◆ length()

static Extype_t length ( Exid_t *  rhs,
Exdisc_t *  disc 
)
static

gvpr’s custom # implementation

The main purpose of this is to extend # to work on the command line options array, ARGV.

Parameters
rhsThe right-hand side operand to #.
discThe libexpr discipline.
Returns
The “length” as defined by us.

Definition at line 1620 of file compile.c.

References Gpr_t::args, disc, exerror(), Exid_s::index, EX_STYPE::integer, LIST_SIZE, and Exid_s::name.

Referenced by arrow_length(), arrow_length_tee(), arrow_type_tee(), doBlock(), fig_textspan(), find_longest_path(), gv_strndup(), gvRenderData(), initDisc(), jpeg_size(), mapToSphere(), position(), positionChildren(), reader(), renderdata(), writer(), and xml_core().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lookup()

static int lookup ( Expr_t *  pgm,
Agobj_t *  objp,
Exid_t *  sym,
Extype_t *  v 
)
static

Definition at line 330 of file compile.c.

References agattr_text(), agattrsym(), agdegree(), AGHEAD, agisdirected(), agisstrict(), agnameof(), agnedges(), agnnodes(), AGNODE, agparent(), AGRAPH, agraphof(), agroot(), AGTAIL, AGTYPE, agxbfree(), agxget(), error, ERROR_WARNING, exerror(), EX_STYPE::floating, ID, Exid_s::index, EX_STYPE::integer, isedge(), kindOf(), Exid_s::lex, Exid_s::name, nameOf(), posOf(), ptr2int(), and EX_STYPE::string.

Referenced by getval().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mkBlock()

static bool mkBlock ( comp_block *  bp,
Expr_t *  prog,
char *  src,
parse_block *  inp,
size_t  i 
)
static
Returns
True if the block uses the input graph

Definition at line 2292 of file compile.c.

References agxbfree(), agxbprint(), agxbuse(), comp_block::begg_stmt, parse_block::begg_stmt, codePhase, compile(), comp_block::does_walk_graph, E, comp_block::edge_stmts, parse_block::edge_stmts, free(), G, getErrorErrors(), parse_block::l_beging, label(), LIST_IS_EMPTY, LIST_SIZE, mkStmts(), comp_block::n_estmts, comp_block::n_nstmts, comp_block::node_stmts, parse_block::node_stmts, PRISIZE_T, symbols, T_edge, T_graph, T_node, tchk, Exid_s::type, V, VOIDTYPE, and Y.

Referenced by compileProg().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mkStmts()

static case_stmt * mkStmts ( Expr_t *  prog,
char *  src,
case_infos_t  cases,
const char *  lbl 
)
static

Definition at line 2253 of file compile.c.

References case_stmt::action, case_info::action, agxbfree(), agxbprint(), agxbuse(), case_info::astart, checkGuard(), compile(), getErrorErrors(), case_info::gstart, case_stmt::guard, case_info::guard, gv_calloc(), INTEGER, LIST_AT, LIST_SIZE, and PRISIZE_T.

Referenced by mkBlock().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nameOf()

static char * nameOf ( Expr_t *  ex,
Agobj_t *  obj,
agxbuf *  tmps 
)
static

Definition at line 58 of file compile.c.

References AGHEAD, agisdirected(), AGMKOUT, agnameof(), AGNODE, AGRAPH, agraphof(), AGTAIL, AGTYPE, agxbput(), agxbputc(), agxbuse(), and exstring().

Referenced by getval(), lookup(), and stringOf().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nxtAttr()

static char * nxtAttr ( Agraph_t *  gp,
char *  k,
char *  name 
)
static

Definition at line 522 of file compile.c.

References agattr_text(), agnxtattr(), exerror(), Agsym_s::name, NULL, and toKind().

Referenced by getval().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ openEdge()

Agedge_t * openEdge ( Agraph_t *  g,
Agnode_t *  t,
Agnode_t *  h,
char *  key 
)

Definition at line 2504 of file compile.c.

References agbindrec(), agedge(), aggetrec(), sameG(), and UDATA.

Referenced by cloneO(), copy(), and getval().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ openG()

Agraph_t * openG ( char *  name,
Agdesc_t  desc 
)

Definition at line 2476 of file compile.c.

References agbindrec(), agopen(), NULL, and UDATA.

Referenced by cloneG(), cloneO(), copy(), and getval().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ openNode()

Agnode_t * openNode ( Agraph_t *  g,
char *  name 
)

Definition at line 2494 of file compile.c.

References agbindrec(), aggetrec(), agnode(), and UDATA.

Referenced by cloneO(), copy(), and getval().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ openSubg()

Agraph_t * openSubg ( Agraph_t *  g,
char *  name 
)

Definition at line 2484 of file compile.c.

References agbindrec(), aggetrec(), agsubg(), and UDATA.

Referenced by cloneO(), compOf(), copy(), getval(), and traverse().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ posOf()

static int posOf ( Agnode_t *  np,
int  idx,
double *  v 
)
static

Definition at line 132 of file compile.c.

References agattr_text(), AGNODE, agroot(), and agxget().

Referenced by lookup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ptr2int()

static long long ptr2int ( const void *  p)
static

Definition at line 53 of file compile.c.

Referenced by getval(), and lookup().

Here is the caller graph for this function:

◆ readG()

Agraph_t * readG ( FILE *  fp)

Definition at line 2465 of file compile.c.

References AGEDGE, aginit(), AGNODE, AGRAPH, agread(), NULL, and UDATA.

Referenced by freadFile(), and readFile().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ refval()

static Extype_t refval ( Expr_t *  pgm,
Exnode_t *  node,
Exid_t *  sym,
Exref_t *  ref 
)
static

Definition at line 1775 of file compile.c.

References agxbfree(), CONSTANT, deparse(), exerror(), exzero(), Exid_s::index, EX_STYPE::integer, Exid_s::lex, TV_bfs, TV_dfs, TV_en, TV_flat, TV_fwd, TV_ne, TV_postdfs, TV_postfwd, TV_postrev, TV_prepostdfs, TV_prepostfwd, TV_prepostrev, TV_rev, and typeChkExp().

Referenced by initDisc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setattr()

static int setattr ( Agobj_t *  objp,
char *  name,
char *  val 
)
static

Definition at line 304 of file compile.c.

References agattr_text(), agattrsym(), agraphof(), agroot(), AGTYPE, and agxset().

Referenced by getval(), and setval().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setDfltAttr()

static int setDfltAttr ( Agraph_t *  gp,
char *  k,
char *  name,
char *  value 
)
static

Definition at line 475 of file compile.c.

References agattr_text(), AGEDGE, AGNODE, AGRAPH, agroot(), error, ERROR_WARNING, and NULL.

Referenced by getval().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setval()

static int setval ( Expr_t *  pgm,
Exnode_t *  x,
Exid_t *  sym,
Exref_t *  ref,
void *  env,
Extype_t  v 
)
static

Definition at line 1538 of file compile.c.

References agnameof(), agroot(), agxbfree(), assignable(), Gpr_t::curgraph, Gpr_t::curobj, deparse(), deref(), error, exerror(), Gpr_t::flags, free(), GV_NEXT_SET, Exid_s::index, int2ptr(), EX_STYPE::integer, MAXNAME, Exid_s::name, Gpr_t::name_used, Gpr_t::outgraph, setattr(), EX_STYPE::string, Exref_s::symbol, Gpr_t::tgtname, Gpr_t::tvnext, Gpr_t::tvroot, Gpr_t::tvt, typeName(), and validTVT().

Referenced by initDisc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stringOf()

static int stringOf ( Expr_t *  prog,
Exnode_t *  x,
int  arg 
)
static

Definition at line 2049 of file compile.c.

References agxbfree(), Exdata_u::constant, Exnode_s::data, exerror(), int2ptr(), EX_STYPE::integer, nameOf(), STRING, EX_STYPE::string, tvtypeToStr(), Exnode_s::type, typeName(), and Exdata_u::value.

Referenced by initDisc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ strToTvtype()

static int strToTvtype ( char *  s)
static

Definition at line 1955 of file compile.c.

References exerror(), startswith(), TV_bfs, TV_dfs, TV_en, TV_flat, TV_fwd, TV_ne, TV_postdfs, TV_postfwd, TV_postrev, TV_prepostdfs, TV_prepostfwd, TV_prepostrev, and TV_rev.

Referenced by convert().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toKind()

static int toKind ( char *  k,
char *  fn 
)
static

Definition at line 507 of file compile.c.

References AGEDGE, AGNODE, AGRAPH, and exerror().

Referenced by getDfltAttr(), getval(), and nxtAttr().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tvtypeToStr()

static char * tvtypeToStr ( long long  v)
static

Definition at line 1994 of file compile.c.

References exerror(), TV_bfs, TV_dfs, TV_en, TV_flat, TV_fwd, TV_ne, TV_postdfs, TV_postfwd, TV_postrev, TV_prepostdfs, TV_prepostfwd, TV_prepostrev, and TV_rev.

Referenced by convert(), and stringOf().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ typeChk()

static tctype typeChk ( tctype  intype,
Exid_t *  sym 
)
static

Definition at line 1673 of file compile.c.

References DYNAMIC, E, exerror(), F, FLOATING, G, haveGraph, haveTarget, I, ID, Exid_s::index, INTEGER, LAST_M, Exid_s::lex, NAME, Exid_s::name, S, STRING, T_edge, T_graph, T_node, tchk, Exid_s::type, V, Y, and YALL.

Referenced by typeChkExp().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ typeChkExp()

static tctype typeChkExp ( Exref_t *  ref,
Exid_t *  sym 
)
static

Definition at line 1756 of file compile.c.

References Exref_s::next, Exref_s::symbol, and typeChk().

Referenced by refval().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ typeName()

static char * typeName ( long  op)
static

Definition at line 1532 of file compile.c.

References MINTYPE, and typenames.

Referenced by initDisc(), setval(), and stringOf().

Here is the caller graph for this function:

◆ xargs()

static Agdesc_t xargs ( char *  args)
static

Definition at line 161 of file compile.c.

References Agdirected, Agdesc_s::directed, error, ERROR_WARNING, and Agdesc_s::strict.

Referenced by getval().

Here is the caller graph for this function:

◆ xyOf()

static char * xyOf ( Expr_t *  pgm,
char *  pt,
bool  getx 
)
static

Definition at line 112 of file compile.c.

References exstralloc(), exstring(), and len().

Referenced by getval().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ a2t

int a2t[]
static
Initial value:
T_node, T_edge, T_graph, T_obj}
#define FLOATING
Definition exparse.h:155
#define STRING
Definition gmlparse.h:133
#define INTEGER
Definition gmlparse.h:131
#define T_node
Definition grammar.h:113
#define T_edge
Definition grammar.h:114
#define T_graph
Definition grammar.h:112

Definition at line 2164 of file compile.c.

Referenced by initDisc().

◆ codePhase

int codePhase
static

Definition at line 1660 of file compile.c.

Referenced by compileProg(), and mkBlock().