-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparse.h
68 lines (50 loc) · 1.59 KB
/
parse.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/**********************************************************************
This file is part of the Quantum Computation Language QCL.
(c) Copyright by Bernhard Oemer <[email protected]>, 1998
This program comes without any warranty; without even the implied
warranty of merchantability or fitness for any particular purpose.
This program is free software under the terms of the
GNU General Public Licence (GPL) version 2 or higher
************************************************************************/
#ifndef PARSE_H
#define PARSE_H
#include <stdio.h>
#include <list>
extern char *yytext;
#define YYNEW(o) (yyTest ? 0 : new o)
#define YYTRY(o) { if(!yyTest) { o; } }
#define YYMAXINCLUDE 10
#define YY_USER_INIT { yyToplevelFile=0; yyStringBufferActive=0; yyIncludeStackPt=0; }
extern void yyrestart(FILE*);
extern int yyparse();
extern int yydebug;
extern void yyScanString(string s);
extern void yyScanFile(FILE *f);
extern void yyCleanUp();
class objlist : public list<sObject*> {
public:
~objlist() {
while(size()) {
if(front()) delete front();
pop_front();
}
}
};
//extern sObject *yyObject;
extern objlist *yyObjList;
extern int yyTest;
extern FILE* yyToplevelFile;
extern int yyStringBufferActive;
extern string yyFilenames[YYMAXINCLUDE];
extern FILE* yyFilePointers[YYMAXINCLUDE];
extern int yyLineNos[YYMAXINCLUDE];
extern int yyIncludeStackPt;
extern string yyFilename;
extern int yyLineNo;
extern int yyStmtBeg;
FILE* openqclfile(string fname);
int chksyntax(string s);
int chksyntax(FILE* f);
objlist* parseobj();
string safestring(const char *s);
#endif