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
17
extern
"C"
{
18
#endif
19
20
typedef
enum
{
Begin
=
21
0,
End
,
BeginG
,
EndG
,
Node
,
Edge
,
Eof
,
Error
}
case_t
;
22
23
typedef
struct
{
24
int
gstart
;
25
char
*
guard
;
26
int
astart
;
27
char
*
action
;
28
}
case_info
;
29
30
static
inline
void
free_case_info
(
case_info
c) {
31
free
(c.
guard
);
32
free
(c.
action
);
33
}
34
35
DEFINE_LIST_WITH_DTOR
(case_infos,
case_info
,
free_case_info
)
36
37
typedef struct {
38
int
l_beging
;
39
char
*
begg_stmt
;
40
case_infos_t
node_stmts
;
41
case_infos_t
edge_stmts
;
42
}
parse_block
;
43
44
DEFINE_LIST
(parse_blocks,
parse_block
)
45
46
typedef struct {
47
char
*
source
;
48
int
l_begin
, l_end, l_endg;
49
char
*
begin_stmt
;
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
free
void free(void *)
list.h
DEFINE_LIST_WITH_DTOR
#define DEFINE_LIST_WITH_DTOR(name, type, dtor)
Definition
list.h:34
DEFINE_LIST
#define DEFINE_LIST(name, type)
Definition
list.h:26
parseProg
parse_prog * parseProg(char *, int)
parses input into gpr sections
Definition
parse.c:381
free_case_info
static void free_case_info(case_info c)
Definition
parse.h:30
freeParseProg
void freeParseProg(parse_prog *)
Definition
parse.c:491
case_t
case_t
Definition
parse.h:20
Error
@ Error
Definition
parse.h:21
Node
@ Node
Definition
parse.h:21
End
@ End
Definition
parse.h:21
Edge
@ Edge
Definition
parse.h:21
Eof
@ Eof
Definition
parse.h:21
Begin
@ Begin
Definition
parse.h:20
BeginG
@ BeginG
Definition
parse.h:21
EndG
@ EndG
Definition
parse.h:21
case_info
Definition
parse.h:23
case_info::guard
char * guard
Definition
parse.h:25
case_info::astart
int astart
Definition
parse.h:26
case_info::action
char * action
Definition
parse.h:27
case_info::gstart
int gstart
Definition
parse.h:24
parse_block
Definition
parse.h:37
parse_block::l_beging
int l_beging
Definition
parse.h:38
parse_block::node_stmts
case_infos_t node_stmts
Definition
parse.h:40
parse_block::edge_stmts
case_infos_t edge_stmts
Definition
parse.h:41
parse_block::begg_stmt
char * begg_stmt
Definition
parse.h:39
parse_prog
Definition
parse.h:46
parse_prog::l_begin
int l_begin
Definition
parse.h:48
parse_prog::end_stmt
char * end_stmt
Definition
parse.h:52
parse_prog::endg_stmt
char * endg_stmt
Definition
parse.h:51
parse_prog::begin_stmt
char * begin_stmt
Definition
parse.h:49
parse_prog::blocks
parse_blocks_t blocks
Definition
parse.h:50
parse_prog::source
char * source
Definition
parse.h:47
lib
gvpr
parse.h
Generated by
1.9.8