Graphviz 13.0.0~dev.20241220.2304
Loading...
Searching...
No Matches
parse.h
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (c) 2011 AT&T Intellectual Property
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * https://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors: Details at https://graphviz.org
9 *************************************************************************/
10
11#pragma once
12
13#include <cgraph/list.h>
14#include <stdlib.h>
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20 typedef enum { Begin =
22
23 typedef struct {
24 int gstart;
25 char *guard;
26 int astart;
27 char *action;
28 } case_info;
29
30static inline void free_case_info(case_info c) {
31 free(c.guard);
32 free(c.action);
33}
34
36
37 typedef struct {
39 char *begg_stmt;
40 case_infos_t node_stmts;
41 case_infos_t edge_stmts;
42 } parse_block;
43
44DEFINE_LIST(parse_blocks, parse_block)
45
46 typedef struct {
47 char *source;
48 int l_begin, l_end, l_endg;
50 parse_blocks_t blocks;
51 char *endg_stmt;
52 char *end_stmt;
53 } parse_prog;
54
55 extern parse_prog *parseProg(char *, int);
56 extern void freeParseProg (parse_prog *);
57
58#ifdef __cplusplus
59}
60#endif
void free(void *)
#define DEFINE_LIST_WITH_DTOR(name, type, dtor)
Definition list.h:34
#define DEFINE_LIST(name, type)
Definition list.h:26
parse_prog * parseProg(char *, int)
parses input into gpr sections
Definition parse.c:381
static void free_case_info(case_info c)
Definition parse.h:30
void freeParseProg(parse_prog *)
Definition parse.c:491
case_t
Definition parse.h:20
@ Error
Definition parse.h:21
@ Node
Definition parse.h:21
@ End
Definition parse.h:21
@ Edge
Definition parse.h:21
@ Eof
Definition parse.h:21
@ Begin
Definition parse.h:20
@ BeginG
Definition parse.h:21
@ EndG
Definition parse.h:21
char * guard
Definition parse.h:25
int astart
Definition parse.h:26
char * action
Definition parse.h:27
int gstart
Definition parse.h:24
int l_beging
Definition parse.h:38
case_infos_t node_stmts
Definition parse.h:40
case_infos_t edge_stmts
Definition parse.h:41
char * begg_stmt
Definition parse.h:39
int l_begin
Definition parse.h:48
char * end_stmt
Definition parse.h:52
char * endg_stmt
Definition parse.h:51
char * begin_stmt
Definition parse.h:49
parse_blocks_t blocks
Definition parse.h:50
char * source
Definition parse.h:47