Graphviz 13.0.0~dev.20250607.1528
|
#include <stdbool.h>
#include <stdio.h>
#include <cghdr.h>
#include <stdlib.h>
#include <util/alloc.h>
#include <util/streq.h>
#include <util/unreachable.h>
#include "grammar.h"
#include <limits.h>
Go to the source code of this file.
Data Structures | |
union | s |
struct | item_s |
struct | list_s |
struct | gstack_s |
union | yyalloc |
Macros | |
#define | YYBISON 30802 |
#define | YYBISON_VERSION "3.8.2" |
#define | YYSKELETON_NAME "yacc.c" |
#define | YYPURE 2 |
#define | YYPUSH 0 |
#define | YYPULL 1 |
#define | YYSTYPE AAGSTYPE |
#define | yyparse aagparse |
#define | yylex aaglex |
#define | yyerror aagerror |
#define | yydebug aagdebug |
#define | yynerrs aagnerrs |
#define | YY_CAST(Type, Val) ((Type) (Val)) |
#define | YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) |
#define | YY_NULLPTR ((void*)0) |
#define | YYPTRDIFF_T long |
#define | YYPTRDIFF_MAXIMUM LONG_MAX |
#define | YYSIZE_T unsigned |
#define | YYSIZE_MAXIMUM |
#define | YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) |
#define | YY_(Msgid) Msgid |
#define | YY_ATTRIBUTE_PURE |
#define | YY_ATTRIBUTE_UNUSED |
#define | YY_USE(E) ((void) (E)) |
#define | YY_INITIAL_VALUE(Value) Value |
#define | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
#define | YY_IGNORE_MAYBE_UNINITIALIZED_END |
#define | YY_IGNORE_USELESS_CAST_BEGIN |
#define | YY_IGNORE_USELESS_CAST_END |
#define | YY_ASSERT(E) ((void) (0 && (E))) |
#define | YYSTACK_ALLOC YYMALLOC |
#define | YYSTACK_FREE YYFREE |
#define | YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM |
#define | YYMALLOC malloc |
#define | YYFREE free |
#define | YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1) |
#define | YYSTACK_BYTES(N) |
#define | YYCOPY_NEEDED 1 |
#define | YYSTACK_RELOCATE(Stack_alloc, Stack) |
#define | YYFINAL 6 |
#define | YYLAST 59 |
#define | YYNTOKENS 23 |
#define | YYNNTS 33 |
#define | YYNRULES 59 |
#define | YYNSTATES 76 |
#define | YYMAXUTOK 268 |
#define | YYTRANSLATE(YYX) |
#define | YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State]) |
#define | YYPACT_NINF (-18) |
#define | yypact_value_is_default(Yyn) ((Yyn) == YYPACT_NINF) |
#define | YYTABLE_NINF (-53) |
#define | yytable_value_is_error(Yyn) 0 |
#define | yyerrok (yyerrstatus = 0) |
#define | yyclearin (yychar = AAGEMPTY) |
#define | YYACCEPT goto yyacceptlab |
#define | YYABORT goto yyabortlab |
#define | YYERROR goto yyerrorlab |
#define | YYNOMEM goto yyexhaustedlab |
#define | YYRECOVERING() (!!yyerrstatus) |
#define | YYBACKUP(Token, Value) |
#define | YYERRCODE AAGUNDEF |
#define | YYDPRINTF(Args) ((void) 0) |
#define | YY_SYMBOL_PRINT(Title, Kind, Value, Location) |
#define | YY_STACK_PRINT(Bottom, Top) |
#define | YY_REDUCE_PRINT(Rule) |
#define | YYINITDEPTH 200 |
#define | YYMAXDEPTH 10000 |
#define | YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) |
Typedefs | |
typedef union s | val_t |
typedef struct item_s | item |
typedef struct list_s | list_t |
typedef struct gstack_s | gstack_t |
typedef enum yysymbol_kind_t | yysymbol_kind_t |
typedef signed char | yytype_int8 |
typedef short | yytype_int16 |
typedef unsigned char | yytype_uint8 |
typedef unsigned short | yytype_uint16 |
typedef yytype_int8 | yy_state_t |
typedef int | yy_state_fast_t |
Functions | |
static void | appendnode (aagscan_t scanner, char *name, char *port, char *sport) |
static void | attrstmt (aagscan_t scanner, int tkind, char *macroname) |
static void | startgraph (aagscan_t scanner, char *name, bool directed, bool strict) |
static void | getedgeitems (aagscan_t scanner) |
static void | newedge (aagscan_t scanner, Agnode_t *t, char *tport, Agnode_t *h, char *hport, char *key) |
static void | edgerhs (aagscan_t scanner, Agnode_t *n, char *tport, item *hlist, char *key) |
static void | appendattr (aagscan_t scanner, char *name, char *value) |
static void | bindattrs (aagextra_t *ctx, int kind) |
static void | applyattrs (aagextra_t *ctx, void *obj) |
static void | endgraph (aagscan_t scanner) |
static void | endnode (aagscan_t scanner) |
static void | endedge (aagscan_t scanner) |
static void | freestack (aagscan_t scanner) |
static char * | concat (aagscan_t scanner, char *, char *) |
static char * | concatPort (Agraph_t *G, char *, char *) |
static void | opensubg (aagscan_t scanner, char *name) |
static void | closesubg (aagscan_t scanner) |
static void | graph_error (aagscan_t scanner) |
void * | malloc (YYSIZE_T) |
void | free (void *) |
static void | yydestruct (const char *yymsg, yysymbol_kind_t yykind, YYSTYPE *yyvaluep, aagscan_t scanner) |
int | yyparse (aagscan_t scanner) |
static item * | newitem (int tag, void *p0, char *p1) |
static item * | cons_node (Agnode_t *n, char *port) |
static item * | cons_attr (char *name, char *value) |
static item * | cons_list (item *list) |
static item * | cons_subg (Agraph_t *subg) |
static gstack_t * | push (gstack_t *s, Agraph_t *subg) |
static gstack_t * | pop (gstack_t *s) |
static void | delete_items (Agraph_t *G, item *ilist) |
static void | deletelist (Agraph_t *G, list_t *list) |
static void | listapp (list_t *list, item *v) |
static void | nomacros (void) |
static void | mkport (aagscan_t scanner, Agedge_t *e, char *name, char *val) |
Agraph_t * | agconcat (Agraph_t *g, const char *filename, void *chan, Agdisc_t *disc) |
merges the file contents with a pre-existing graph | |
Agraph_t * | agread (void *fp, Agdisc_t *disc) |
constructs a new graph | |
Variables | |
static const char | Key [] = "key" |
static const yytype_int8 | yytranslate [] |
static const yytype_int8 | yypact [] |
static const yytype_int8 | yydefact [] |
static const yytype_int8 | yypgoto [] |
static const yytype_int8 | yydefgoto [] |
static const yytype_int8 | yytable [] |
static const yytype_int8 | yycheck [] |
static const yytype_int8 | yystos [] |
static const yytype_int8 | yyr1 [] |
static const yytype_int8 | yyr2 [] |
#define YY_ACCESSING_SYMBOL | ( | State | ) | YY_CAST (yysymbol_kind_t, yystos[State]) |
#define YYBACKUP | ( | Token, | |
Value | |||
) |
#define yypact_value_is_default | ( | Yyn | ) | ((Yyn) == YYPACT_NINF) |
#define YYSIZE_MAXIMUM |
#define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM |
#define YYSTACK_BYTES | ( | N | ) |
#define YYSTACK_RELOCATE | ( | Stack_alloc, | |
Stack | |||
) |
#define YYTRANSLATE | ( | YYX | ) |
typedef int yy_state_fast_t |
typedef yytype_int8 yy_state_t |
typedef enum yysymbol_kind_t yysymbol_kind_t |
typedef short yytype_int16 |
typedef signed char yytype_int8 |
typedef unsigned short yytype_uint16 |
typedef unsigned char yytype_uint8 |
enum yysymbol_kind_t |
|
static |
Definition at line 1696 of file grammar.c.
References aagget_extra(), gstack_s::attrlist, cons_attr(), listapp(), NULL, aagextra_s::S, and scanner.
Referenced by yyparse().
|
static |
Definition at line 1795 of file grammar.c.
References aagget_extra(), agnode(), agstrfree(), concatPort(), cons_node(), aagextra_s::G, G, listapp(), aagextra_s::S, S, and scanner.
Referenced by yyparse().
|
static |
Definition at line 1723 of file grammar.c.
References aghtmlstr(), AGINEDGE, AGOUTEDGE, AGTYPE, agxset(), agxset_html(), gstack_s::attrlist, list_s::first, Key, aagextra_s::S, streq(), T_atom, and T_attr.
Referenced by endnode(), and newedge().
|
static |
Definition at line 1754 of file grammar.c.
References aagget_extra(), agattr_html(), agattr_text(), AGEDGE, aghtmlstr(), AGNODE, AGRAPH, bindattrs(), deletelist(), aagextra_s::G, G, nomacros(), NULL, Agsym_s::print, aagextra_s::S, S, scanner, T_atom, T_edge, T_graph, T_node, and UNREACHABLE.
Referenced by yyparse().
|
static |
Definition at line 1706 of file grammar.c.
References agattr_text(), AGEDGE, agstrfree(), gstack_s::attrlist, list_s::first, gstack_s::g, aagextra_s::G, Key, NULL, aagextra_s::S, streq(), T_atom, and T_attr.
Referenced by attrstmt(), endedge(), and endnode().
|
static |
Definition at line 2003 of file grammar.c.
References aagget_extra(), gstack_s::g, pop(), aagextra_s::S, scanner, gstack_s::subg, and aagextra_s::SubgraphDepth.
Referenced by yyparse().
|
static |
Definition at line 1888 of file grammar.c.
References aagget_extra(), agstrdup(), agstrfree(), free(), aagextra_s::G, G, gv_alloc(), len(), s1(), and scanner.
Referenced by yyparse().
|
static |
Definition at line 1908 of file grammar.c.
References agstrdup(), agstrfree(), agxbfree(), agxbprint(), agxbuse(), G, and s1().
Referenced by appendnode().
|
static |
Definition at line 1645 of file grammar.c.
References newitem(), and T_atom.
Referenced by appendattr().
Definition at line 1642 of file grammar.c.
References newitem(), and T_node.
Referenced by appendnode().
Definition at line 1651 of file grammar.c.
References newitem(), NULL, and T_subgraph.
Referenced by getedgeitems().
Definition at line 1669 of file grammar.c.
References aghtmlstr(), agstrfree(), delete_items(), free(), G, T_atom, and T_list.
Referenced by delete_items(), and deletelist().
Definition at line 1681 of file grammar.c.
References delete_items(), list_s::first, G, list_s::last, and NULL.
Referenced by attrstmt(), endedge(), endnode(), and freestack().
|
static |
Definition at line 1921 of file grammar.c.
References aagget_extra(), agfstnode(), agnxtnode(), agsubnode(), gstack_s::g, head, newedge(), NULL, aagextra_s::S, scanner, and T_subgraph.
Referenced by endedge().
|
static |
Definition at line 1848 of file grammar.c.
References aagget_extra(), AGEDGE, agfstnode(), agnxtnode(), agsubnode(), gstack_s::attrlist, bindattrs(), deletelist(), gstack_s::edgelist, edgerhs(), list_s::first, gstack_s::g, aagextra_s::G, G, Key, gstack_s::nodelist, NULL, aagextra_s::S, scanner, streq(), gstack_s::subg, T_atom, and T_subgraph.
Referenced by yyparse().
|
static |
Definition at line 1986 of file grammar.c.
References aagget_extra(), aginternalmapclearlocalnames(), aglexeof(), G, and scanner.
Referenced by graph_error(), and yyparse().
|
static |
Definition at line 1815 of file grammar.c.
References aagget_extra(), AGNODE, applyattrs(), bindattrs(), deletelist(), aagextra_s::G, G, aagextra_s::S, S, and scanner.
Referenced by yyparse().
void free | ( | void * | ) |
|
static |
Definition at line 2014 of file grammar.c.
References aagget_extra(), gstack_s::attrlist, deletelist(), gstack_s::edgelist, aagextra_s::G, gstack_s::nodelist, pop(), aagextra_s::S, and scanner.
Referenced by graph_error(), and yyparse().
|
static |
Definition at line 1833 of file grammar.c.
References aagget_extra(), cons_list(), cons_subg(), listapp(), NULL, aagextra_s::S, S, and scanner.
Referenced by yyparse().
|
static |
Definition at line 2025 of file grammar.c.
References aagget_extra(), agclose(), endgraph(), freestack(), aagextra_s::G, NULL, and scanner.
Referenced by yyparse().
Definition at line 1687 of file grammar.c.
References list_s::first, list_s::last, item_s::next, and NULL.
Referenced by appendattr(), appendnode(), and getedgeitems().
void * malloc | ( | YYSIZE_T | ) |
Definition at line 1939 of file grammar.c.
References aagget_extra(), agattr_text(), AGEDGE, agxset(), gstack_s::g, NULL, aagextra_s::S, and scanner.
Referenced by newedge().
|
static |
Definition at line 1951 of file grammar.c.
References aagget_extra(), agedge(), aghead, agtail, applyattrs(), gstack_s::g, HEADPORT_ID, mkport(), aagextra_s::S, scanner, and TAILPORT_ID.
Referenced by edgerhs().
|
static |
Definition at line 1633 of file grammar.c.
References gv_alloc().
Referenced by cons_attr(), cons_list(), cons_node(), and cons_subg().
|
static |
Definition at line 1745 of file grammar.c.
References agwarningf().
Referenced by attrstmt().
|
static |
Definition at line 1992 of file grammar.c.
References aagget_extra(), agerrorf(), agstrfree(), agsubg(), gstack_s::g, aagextra_s::G, push(), aagextra_s::S, scanner, aagextra_s::SubgraphDepth, and YYMAXDEPTH.
Referenced by yyparse().
Definition at line 1654 of file grammar.c.
References gstack_s::down, gstack_s::g, and gv_alloc().
Referenced by opensubg(), and startgraph().
|
static |
Definition at line 1974 of file grammar.c.
References aagget_extra(), agopen(), agstrfree(), Agdesc_s::directed, aagextra_s::Disc, aagextra_s::G, NULL, push(), aagextra_s::S, scanner, and aagextra_s::SubgraphDepth.
Referenced by yyparse().
|
static |
Definition at line 954 of file grammar.c.
References scanner, YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN, YY_IGNORE_MAYBE_UNINITIALIZED_END, YY_SYMBOL_PRINT, and YY_USE.
Referenced by yyparse().
int yyparse | ( | aagscan_t | scanner | ) |
Definition at line 978 of file grammar.c.
References AAGEMPTY, AAGEOF, AAGerror, AAGUNDEF, appendattr(), appendnode(), attrstmt(), closesubg(), concat(), endedge(), endgraph(), endnode(), freestack(), getedgeitems(), graph_error(), NULL, opensubg(), scanner, startgraph(), str, T_edge, T_graph, T_node, YY_, YY_ACCESSING_SYMBOL, YY_ASSERT, YY_CAST, YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN, YY_IGNORE_MAYBE_UNINITIALIZED_END, YY_IGNORE_USELESS_CAST_BEGIN, YY_IGNORE_USELESS_CAST_END, YY_INITIAL_VALUE, YY_REDUCE_PRINT, YY_STACK_PRINT, YY_SYMBOL_PRINT, YYABORT, YYACCEPT, yychar, yycheck, yydefact, yydefgoto, yydestruct(), YYDPRINTF, yyerror, YYERROR, YYFINAL, YYINITDEPTH, YYLAST, yylex, yylval, YYMAXDEPTH, yynerrs, YYNOMEM, YYNSTATES, YYNTOKENS, yypact, yypact_value_is_default, yypgoto, YYPOPSTACK, YYPTRDIFF_T, yyr1, yyr2, YYSIZE_T, YYSIZEOF, YYSTACK_ALLOC, YYSTACK_BYTES, YYSTACK_FREE, YYSTACK_RELOCATE, YYSTYPE, YYSYMBOL_YYEMPTY, YYSYMBOL_YYEOF, YYSYMBOL_YYerror, yytable, yytable_value_is_error, and YYTRANSLATE.
|
static |
Definition at line 87 of file grammar.c.
Referenced by applyattrs(), applyattrs(), bindattrs(), bindattrs(), endedge(), and endedge().
|
static |
Definition at line 718 of file grammar.c.
Referenced by yyparse().
|
static |
Definition at line 675 of file grammar.c.
Referenced by yyparse().
|
static |
|
static |
Definition at line 660 of file grammar.c.
Referenced by yyparse().
|
static |
|
static |
Definition at line 743 of file grammar.c.
Referenced by yyparse().
|
static |
|
static |
|
static |
Definition at line 708 of file grammar.c.
Referenced by yyparse().
|
static |