1 |
/* |
2 |
* Parser: P a r s e r H e a d e r |
3 |
* |
4 |
* Generated from: parser.g |
5 |
* |
6 |
* Terence Parr, Russell Quong, Will Cohen, and Hank Dietz: 1989-2001 |
7 |
* Parr Research Corporation |
8 |
* with Purdue University Electrical Engineering |
9 |
* with AHPCRC, University of Minnesota |
10 |
* ANTLR Version 1.33MR33 |
11 |
*/ |
12 |
|
13 |
#ifndef Parser_h |
14 |
#define Parser_h |
15 |
|
16 |
#ifndef ANTLR_VERSION |
17 |
#define ANTLR_VERSION 13333 |
18 |
#endif |
19 |
|
20 |
#include "AParser.h" |
21 |
|
22 |
|
23 |
#include "config.h" |
24 |
|
25 |
#include <cmath> |
26 |
#include <list> |
27 |
|
28 |
#include "lsys.h" |
29 |
#include "util.h" |
30 |
|
31 |
#define PURIFY(a,b) |
32 |
|
33 |
void parse_file (FILE *file, const string &path, lsys &l) t_err; |
34 |
void parse_file (const string &path, lsys &l) t_err; |
35 |
|
36 |
extern list<string> include_dirs; |
37 |
class Parser : public ANTLRParser { |
38 |
public: |
39 |
static const ANTLRChar *tokenName(int tk); |
40 |
enum { SET_SIZE = 49 }; |
41 |
protected: |
42 |
static const ANTLRChar *_token_tbl[]; |
43 |
private: |
44 |
#line 97 "parser.g" |
45 |
|
46 |
public: |
47 |
string current_file; |
48 |
protected: |
49 |
void syn(_ANTLRTokenPtr tok, ANTLRChar *egroup, SetWordType *eset, |
50 |
ANTLRTokenType etok, int k); |
51 |
|
52 |
bool istok (_ANTLRTokenPtr tok, const char *s) |
53 |
{ return strcmp (tok->getText(), s) == 0; }; |
54 |
|
55 |
file_pos here () |
56 |
{ return file_pos (current_file, LT(1)->getLine (), -1); }; |
57 |
protected: |
58 |
static SetWordType err1[8]; |
59 |
static SetWordType WildCard_set[8]; |
60 |
static SetWordType WildCard_errset[8]; |
61 |
static SetWordType err4[8]; |
62 |
static SetWordType err5[8]; |
63 |
static SetWordType setwd1[49]; |
64 |
static SetWordType err6[8]; |
65 |
static SetWordType err7[8]; |
66 |
static SetWordType err8[8]; |
67 |
static SetWordType err9[8]; |
68 |
static SetWordType err10[8]; |
69 |
static SetWordType err11[8]; |
70 |
static SetWordType setwd2[49]; |
71 |
static SetWordType err12[8]; |
72 |
static SetWordType err13[8]; |
73 |
static SetWordType err14[8]; |
74 |
static SetWordType setwd3[49]; |
75 |
static SetWordType err15[8]; |
76 |
static SetWordType err16[8]; |
77 |
static SetWordType err17[8]; |
78 |
static SetWordType setwd4[49]; |
79 |
static SetWordType err18[8]; |
80 |
static SetWordType err19[8]; |
81 |
static SetWordType setwd5[49]; |
82 |
static SetWordType err20[8]; |
83 |
static SetWordType err21[8]; |
84 |
static SetWordType err22[8]; |
85 |
static SetWordType setwd6[49]; |
86 |
private: |
87 |
void zzdflthandlers( int _signal, int *_retsignal ); |
88 |
|
89 |
public: |
90 |
Parser(ANTLRTokenBuffer *input); |
91 |
void parse_file(lsys & l); |
92 |
void parse_lsys(lsys & l); |
93 |
void statement(lsys & l); |
94 |
void parse_rule(lsys & l); |
95 |
void parse_modvec(module_vec & v); |
96 |
void parse_module(module & m); |
97 |
void module_head(module & m); |
98 |
string module_name(void); |
99 |
string module_ref(void); |
100 |
void expr_any(module & v); |
101 |
void expr_modvec(module & v); |
102 |
void expr_numeric(module & v); |
103 |
void expr_0(module & v); |
104 |
void expr_1(module & v); |
105 |
void expr_2(module & v); |
106 |
void expr_3(module & v); |
107 |
void expr_4(module & v); |
108 |
void expr_5(module & v); |
109 |
void expr_atom(module & v); |
110 |
void expr_module(module & m); |
111 |
}; |
112 |
|
113 |
#endif /* Parser_h */ |