initial version of ppcg
[ppcg.git] / clan / include / clan / symbol.h
blob71b5bf4e79102433d58013b3ac71f0669bc2432d
2 /*+------- <| --------------------------------------------------------**
3 ** A Clan **
4 **--- /.\ -----------------------------------------------------**
5 ** <| [""M# symbol.h **
6 **- A | # -----------------------------------------------------**
7 ** /.\ [""M# First version: 01/05/2008 **
8 **- [""M# | # U"U#U -----------------------------------------------**
9 | # | # \ .:/
10 | # | #___| #
11 ****** | "--' .-" ******************************************************
12 * |"-"-"-"-"-#-#-## Clan : the Chunky Loop Analyzer (experimental) *
13 **** | # ## ###### *****************************************************
14 * \ .::::'/ *
15 * \ ::::'/ Copyright (C) 2008 Cedric Bastoul *
16 * :8a| # # ## *
17 * ::88a ### This is free software; you can redistribute it *
18 * ::::888a 8a ##::. and/or modify it under the terms of the GNU Lesser *
19 * ::::::::888a88a[]::: General Public License as published by the Free *
20 *::8:::::::::SUNDOGa8a::. Software Foundation, either version 3 of the *
21 *::::::::8::::888:Y8888:: License, or (at your option) any later version. *
22 *::::':::88::::888::Y88a::::::::::::... *
23 *::'::.. . ..... .. ... . *
24 * This software is distributed in the hope that it will be useful, but *
25 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY *
26 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License *
27 * for more details. *
28 * *
29 * You should have received a copy of the GNU Lesser General Public License *
30 * along with software; if not, write to the Free Software Foundation, Inc., *
31 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
32 * *
33 * Clan, the Chunky Loop Analyzer *
34 * Written by Cedric Bastoul, Cedric.Bastoul@inria.fr *
35 * *
36 ******************************************************************************/
39 #ifndef CLAN_SYMBOL_H
40 # define CLAN_SYMBOL_H
42 # include <stdio.h>
43 # include <scoplib/scop.h>
44 # include <scoplib/macros.h>
46 # if defined(__cplusplus)
47 extern "C"
49 # endif
52 /**
53 * The clan_symbol_t structure is a node of the symbol table of the parser.
55 struct clan_symbol
57 char * identifier; /**< Symbol identifier */
58 int type; /**< Symbol type (variable, iterator...) */
59 int rank; /**< Depth for iterators, number for others */
60 struct clan_symbol * next; /**< Next symbol in the symbol table */
62 typedef struct clan_symbol clan_symbol_t;
63 typedef struct clan_symbol * clan_symbol_p;
66 /*+****************************************************************************
67 * Structure display function *
68 ******************************************************************************/
69 void clan_symbol_print_structure(FILE *, clan_symbol_p, int);
70 void clan_symbol_print(FILE *, clan_symbol_p);
73 /*+****************************************************************************
74 * Memory allocation/deallocation function *
75 ******************************************************************************/
76 clan_symbol_p clan_symbol_malloc();
77 void clan_symbol_free(clan_symbol_p);
80 /*+****************************************************************************
81 * Processing functions *
82 ******************************************************************************/
83 clan_symbol_p clan_symbol_lookup(clan_symbol_p, char *);
84 clan_symbol_p clan_symbol_add(clan_symbol_p *, char *, int, int);
85 void clan_symbol_remove(clan_symbol_p*, clan_symbol_p);
86 int clan_symbol_get_rank(clan_symbol_p, char *);
87 int clan_symbol_get_type(clan_symbol_p, char *);
88 char ** clan_symbol_iterators(clan_symbol_p *, int);
89 char ** clan_symbol_id_array(clan_symbol_p, int, int *);
92 # if defined(__cplusplus)
94 # endif
95 #endif /* define CLAN_SYMBOL_H */