blob: a25d463c64fc4765eca54f05c6f77bbb2756bab5 (
plain)
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
|
/****
* absyn.h
* Andy Hammerlindl 2002/07/14
*
* Defines the basic types of abstract syntax objects using forward
* class declarations.
*****/
#ifndef ABSYN_H
#define ABSYN_H
#include "common.h"
#include "symbolmaps.h"
#include "errormsg.h" // For position
// Forward declaration for markPos.
namespace trans {
class coenv;
}
namespace absyntax {
class absyn : public gc {
protected:
const position pos;
void markPos(trans::coenv& c);
public:
absyn(position pos)
: pos(pos) {}
virtual ~absyn();
position getPos() const
{
return pos;
}
virtual void prettyprint(ostream &out, Int indent) = 0;
virtual void createSymMap(AsymptoteLsp::SymbolContext* symContext) {}
private: // Non-copyable
void operator=(const absyn&);
absyn(const absyn&);
};
void prettyindent(ostream &out, Int indent);
void prettyname(ostream &out, string name, Int indent, position pos);
class name;
class ty;
class varinit;
class exp;
class runnable;
class stm;
class dec;
class block;
typedef block file;
// This is the abstract syntax tree of a file, assigned to when running
// yyparse.
extern file *root;
}
#endif
|