[go: up one dir, main page]

File: SCommonAST.h

package info (click to toggle)
sorcerer 1.0
  • links: PTS
  • area: main
  • in suites: slink
  • size: 736 kB
  • ctags: 1,524
  • sloc: ansic: 11,308; cpp: 1,388; makefile: 300
file content (26 lines) | stat: -rw-r--r-- 693 bytes parent folder | download | duplicates (18)
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
#ifndef SCommonAST_h
#define SCommonAST_h

#include <stdio.h>
#include "PCCTSAST.h"
#include "SASTBase.h"

/* If you use SORCERER alone, you can subclass this to get a nice tree def */

class SORCommonAST : public SORASTBase {
protected:
	SORCommonAST *_right, *_down;
	int _type;

public:
	SORCommonAST() { _right = _down = NULL; }
	PCCTS_AST *right()	{ return _right; }	// define the SORCERER interface
	PCCTS_AST *down()	{ return _down; }
	int type() 		{ return _type; }
	void setRight(PCCTS_AST *t) { _right = (SORCommonAST *)t; }
	void setDown(PCCTS_AST *t)  { _down = (SORCommonAST *)t; }
	void setType(int t)		 { _type = t; }
	virtual PCCTS_AST *shallowCopy() {return NULL;}
};

#endif