-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathASTNode.h
More file actions
72 lines (47 loc) · 1.81 KB
/
Copy pathASTNode.h
File metadata and controls
72 lines (47 loc) · 1.81 KB
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
69
70
71
/***************************************************************************
ASTNode.h
-------------------
begin : Tue Jun 25 09:50:11 CEST 2002
copyright : (C) 2002 by Manuel Astudillo
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation; either version 2 of the *
* License, or (at your option) any later version. *
* *
***************************************************************************/
#ifndef AST_NODE_H
#define AST_NODE_H
#include <vector>
#include <string>
#include <wchar.h>
#include "Symbol.h"
using namespace std;
#if defined (WIN32) && defined (_USRDLL)
class __declspec(dllexport) ASTNode;
#else
class ASTNode;
#endif
class ASTNode {
protected:
std::wstring m_symbol;
std::wstring m_image;
ASTNode *m_parent;
unsigned short m_line, m_col;
std::vector <ASTNode*> children;
public:
virtual ~ASTNode ();
void init (const Symbol *s, ASTNode *parent);
void setImage (wstring image);
void setSymbol (wstring symbol);
std::wstring getImage ();
std::wstring getSymbol ();
void setParent (ASTNode *parent);
ASTNode *getParent ();
void addChild (ASTNode *child);
std::vector <ASTNode*> *getChildren ();
void print (int tabs);
};
#endif