Otawa  0.10
ast_parser.h
Go to the documentation of this file.
1 /* A Bison parser, made by GNU Bison 3.0.2. */
2 
3 /* Bison interface for Yacc-like parsers in C
4 
5  Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
6 
7  This program is free software: you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation, either version 3 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program. If not, see <http://www.gnu.org/licenses/>. */
19 
20 /* As a special exception, you may create a larger work that contains
21  part or all of the Bison parser skeleton and distribute that work
22  under terms of your choice, so long as that work isn't itself a
23  parser generator using the skeleton or a modified version thereof
24  as a parser skeleton. Alternatively, if you modify or redistribute
25  the parser skeleton itself, you may (at your option) remove this
26  special exception, which will cause the skeleton and the resulting
27  Bison output files to be licensed under the GNU General Public
28  License without this special exception.
29 
30  This special exception was added by the Free Software Foundation in
31  version 2.2 of Bison. */
32 
33 #ifndef YY_AST_HOME_CASSE_OTAWA_OTAWA_SRC_AST_AST_PARSER_H_INCLUDED
34 # define YY_AST_HOME_CASSE_OTAWA_OTAWA_SRC_AST_AST_PARSER_H_INCLUDED
35 /* Debug traces. */
36 #ifndef YYDEBUG
37 # define YYDEBUG 0
38 #endif
39 #if YYDEBUG
40 extern int ast_debug;
41 #endif
42 /* "%code requires" blocks. */
43 #line 21 "ast_parser.yy" /* yacc.c:1909 */
44 
45 #include <stdio.h>
46 #include <stdlib.h>
47 #include <memory.h>
48 #include <otawa/ast.h>
49 #include <elm/genstruct/Vector.h>
50 #include <otawa/ast/ASTLoader.h>
51 
52 using namespace elm;
53 using namespace otawa;
54 using namespace otawa::ast;
55 
56 // Proto
57 #define size_t unsigned long
58 int ast_lex(void);
59 void ast_error(otawa::ast::ASTLoader *loader, const char *msg);
60 
61 
62 #line 63 "/home/casse/otawa/otawa/src/ast/ast_parser.h" /* yacc.c:1909 */
63 
64 /* Token type. */
65 #ifndef YYTOKENTYPE
66 # define YYTOKENTYPE
68  {
69  ERROR = 258,
70  _LABEL = 259,
71  NAME = 260,
72  SEQ = 261,
73  IF = 262,
74  WHILE = 263,
75  DOWHILE = 264,
76  FOR = 265,
77  CODE = 266,
78  APPEL = 267,
79  VIDE = 268,
80  NUMBER = 269,
81  UN_OP = 270,
82  BIN_OP = 271,
83  BI_OP = 272
84  };
85 #endif
86 
87 /* Value type. */
88 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
89 typedef union YYSTYPE YYSTYPE;
90 union YYSTYPE
91 {
92 #line 46 "ast_parser.yy" /* yacc.c:1909 */
93 
94  char *str;
95  otawa::ast::AST *ast;
96 
97 #line 98 "/home/casse/otawa/otawa/src/ast/ast_parser.h" /* yacc.c:1909 */
98 };
99 # define YYSTYPE_IS_TRIVIAL 1
100 # define YYSTYPE_IS_DECLARED 1
101 #endif
102 
103 /* Location type. */
104 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
105 typedef struct YYLTYPE YYLTYPE;
106 struct YYLTYPE
107 {
108  int first_line;
109  int first_column;
110  int last_line;
111  int last_column;
112 };
113 # define YYLTYPE_IS_DECLARED 1
114 # define YYLTYPE_IS_TRIVIAL 1
115 #endif
116 
117 
118 extern YYSTYPE ast_lval;
119 extern YYLTYPE ast_lloc;
120 int ast_parse (otawa::ast::ASTLoader *loader);
121 
122 #endif /* !YY_AST_HOME_CASSE_OTAWA_OTAWA_SRC_AST_AST_PARSER_H_INCLUDED */
Definition: ast_parser.h:73
yytokentype
Definition: ipet_parser.cpp:120
Definition: ast_parser.h:77
Definition: ast_parser.h:75
struct YYLTYPE YYLTYPE
Definition: ast_parser.h:105
union YYSTYPE YYSTYPE
Definition: ast_parser.h:89
Definition: ast_parser.h:81
int ast_parse(otawa::ast::ASTLoader *loader)
YYLTYPE ast_lloc
Definition: ast_parser.h:74
int ast_lex(void)
Definition: ast_parser.h:79
Definition: ast_parser.h:83
void ast_error(otawa::ast::ASTLoader *loader, const char *msg)
Definition: ast_parser.cpp:1735
YYSTYPE ast_lval
This class may be used for loading AST from an external file using the Heptane format (see doc/ direc...
Definition: ASTLoader.h:38
Definition: ast_parser.h:71
Definition: ast_parser.h:76
Definition: ast_parser.h:72
Definition: ast_parser.h:70
Definition: ast_parser.h:82
Definition: ast_parser.h:78
Definition: ast_parser.h:80
This is the base class for the representation of programs as Abstract Syntax Trees.
Definition: AST.h:53
Definition: ast_parser.h:69