Graphviz 13.0.0~dev.20241220.2304
|
#include <ast/ast.h>
#include <ast/error.h>
#include <gvpr/parse.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <util/agxbuf.h>
#include <util/alloc.h>
#include <util/gv_ctype.h>
#include <util/unreachable.h>
Go to the source code of this file.
Macros | |
#define | BSIZE 8 |
Functions | |
static char * | caseStr (case_t cs) |
convert case_t to string | |
static int | eol (FILE *str) |
eat characters until eol | |
static int | readc (FILE *str, agxbuf *ostr) |
static void | unreadc (FILE *str, int c) |
push character back onto stream; if newline, reduce lineno | |
static int | skipWS (FILE *str) |
static void | parseID (FILE *str, int c, char *buf, size_t bsize) |
Put initial alpha in buffer; add additional alphas, up to buffer size. | |
static case_t | parseKind (FILE *str) |
static int | endString (FILE *ins, agxbuf *outs, char ec) |
static int | endBracket (FILE *ins, agxbuf *outs, char bc, char ec) |
static char * | parseBracket (FILE *str, agxbuf *buf, int bc, int ec) |
static char * | parseAction (FILE *str, agxbuf *buf) |
static char * | parseGuard (FILE *str, agxbuf *buf) |
static case_t | parseCase (FILE *str, char **guard, int *gline, char **action, int *aline) |
static void | addBlock (parse_blocks_t *list, char *stmt, int line, case_infos_t nodelist, case_infos_t edgelist) |
create new block and append to list; return new item as tail | |
static void | addCase (case_infos_t *list, char *guard, int gline, char *action, int line) |
create new case_info and append to list | |
static void | bindAction (case_t cs, char *action, int aline, char **ap, int *lp) |
parse_prog * | parseProg (char *input, int isFile) |
parses input into gpr sections | |
static void | freeBlocks (parse_blocks_t *ip) |
void | freeParseProg (parse_prog *prog) |
Variables | |
static int | lineno = 1 |
static int | col0 = 1 |
static int | startLine = 1 |
static int | kwLine = 1 |
static char * | case_str [] |
|
static |
Definition at line 338 of file parse.c.
Referenced by parseProg().
|
static |
Definition at line 351 of file parse.c.
References error, ERROR_WARNING, guard, and kwLine.
Referenced by parseProg().
|
static |
Definition at line 368 of file parse.c.
References caseStr(), error, ERROR_ERROR, ERROR_WARNING, and kwLine.
Referenced by parseProg().
|
static |
Definition at line 38 of file parse.c.
References case_str.
Referenced by bindAction().
|
static |
Definition at line 231 of file parse.c.
References agxbputc(), endBracket(), endString(), ins(), and readc().
Referenced by endBracket(), and parseBracket().
|
static |
Definition at line 204 of file parse.c.
References agxbputc(), error, ERROR_ERROR, ins(), and lineno.
Referenced by endBracket().
|
static |
|
static |
Definition at line 481 of file parse.c.
References parse_block::begg_stmt, parse_block::edge_stmts, free(), and parse_block::node_stmts.
Referenced by freeParseProg().
void freeParseProg | ( | parse_prog * | prog | ) |
Definition at line 491 of file parse.c.
References parse_prog::begin_stmt, parse_prog::blocks, parse_prog::end_stmt, parse_prog::endg_stmt, free(), and freeBlocks().
Referenced by gvpr(), and parseProg().
|
static |
Definition at line 279 of file parse.c.
References parseBracket(), and str.
Referenced by parseCase().
|
static |
Definition at line 258 of file parse.c.
References agxbdisown(), endBracket(), error, ERROR_ERROR, getErrorErrors(), lineno, skipWS(), startLine, str, and unreadc().
Referenced by parseAction(), and parseGuard().
|
static |
Definition at line 298 of file parse.c.
References agxbfree(), Begin, BeginG, End, EndG, Eof, Error, getErrorErrors(), guard, parseAction(), parseGuard(), parseKind(), startLine, str, and UNREACHABLE.
Referenced by parseProg().
|
static |
Definition at line 283 of file parse.c.
References parseBracket(), and str.
Referenced by parseCase().
|
static |
Definition at line 140 of file parse.c.
References gv_isalpha(), readc(), str, and unreadc().
Referenced by parseKind().
|
static |
parse_prog * parseProg | ( | char * | input, |
int | isFile | ||
) |
Definition at line 381 of file parse.c.
References addBlock(), addCase(), Begin, parse_prog::begin_stmt, BeginG, bindAction(), parse_prog::blocks, col0, End, parse_prog::end_stmt, EndG, parse_prog::endg_stmt, Eof, error, Error, ERROR_ERROR, free(), freeParseProg(), getErrorErrors(), guard, kwLine, parse_prog::l_begin, parse_prog::l_end, parse_prog::l_endg, lineno, NULL, parseCase(), parse_prog::source, startLine, str, and UNREACHABLE.
Referenced by gvpr_core().
|
static |
Definition at line 58 of file parse.c.
References agxbputc(), col0, eol(), lineno, and str.
Referenced by endBracket(), parseID(), and skipWS().
|
static |
Definition at line 128 of file parse.c.
References gv_isspace(), readc(), and str.
Referenced by parseBracket(), and parseKind().
|
static |
|
static |
|
static |
Definition at line 29 of file parse.c.
Referenced by eol(), parseProg(), and readc().
|
static |
Definition at line 31 of file parse.c.
Referenced by addCase(), bindAction(), parseKind(), and parseProg().
|
static |
Definition at line 28 of file parse.c.
Referenced by endString(), eol(), parseBracket(), parseKind(), parseProg(), ppDirective(), ppDirective(), readc(), and unreadc().
|
static |
Definition at line 30 of file parse.c.
Referenced by parseBracket(), parseCase(), and parseProg().