| 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 <util/list.h> |
| 14 |
|
| 15 |
#ifdef __cplusplus |
| 16 |
extern "C" { |
| 17 |
#endif |
| 18 |
|
| 19 |
typedef enum { Begin = |
| 20 |
0, End, BeginG, EndG, Node, Edge, Eof, Error } case_t; |
| 21 |
|
| 22 |
typedef struct { |
| 23 |
int gstart; |
| 24 |
char *guard; |
| 25 |
int astart; |
| 26 |
char *action; |
| 27 |
} case_info; |
| 28 |
|
| 29 |
typedef LIST(case_info) case_infos_t; |
| 30 |
|
| 31 |
typedef struct { |
| 32 |
int l_beging; |
| 33 |
char *begg_stmt; |
| 34 |
case_infos_t node_stmts; |
| 35 |
case_infos_t edge_stmts; |
| 36 |
} parse_block; |
| 37 |
|
| 38 |
typedef LIST(parse_block) parse_blocks_t; |
| 39 |
|
| 40 |
typedef struct { |
| 41 |
char *source; |
| 42 |
int l_begin, l_end, l_endg; |
| 43 |
char *begin_stmt; |
| 44 |
parse_blocks_t blocks; |
| 45 |
char *endg_stmt; |
| 46 |
char *end_stmt; |
| 47 |
} parse_prog; |
| 48 |
|
| 49 |
extern parse_prog *parseProg(char *, int); |
| 50 |
extern void freeParseProg (parse_prog *); |
| 51 |
|
| 52 |
#ifdef __cplusplus |
| 53 |
} |
| 54 |
#endif |