aboutsummaryrefslogtreecommitdiff
path: root/src/astleaf.h
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2009-12-21 18:04:02 +0000
committerMike Buland <eichlan@xagasoft.com>2009-12-21 18:04:02 +0000
commitfb28f6800864176be2ffca29e8e664b641f33170 (patch)
treeba9180ac442939edc4eacbe1fdae93c5a7f87cee /src/astleaf.h
parent51e21a316be6e052251b3dfc7d671061ebd67cee (diff)
downloadbuild-fb28f6800864176be2ffca29e8e664b641f33170.tar.gz
build-fb28f6800864176be2ffca29e8e664b641f33170.tar.bz2
build-fb28f6800864176be2ffca29e8e664b641f33170.tar.xz
build-fb28f6800864176be2ffca29e8e664b641f33170.zip
m3 is copied into trunk, we should be good to go, now.
Diffstat (limited to 'src/astleaf.h')
-rw-r--r--src/astleaf.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/astleaf.h b/src/astleaf.h
new file mode 100644
index 0000000..0c8911b
--- /dev/null
+++ b/src/astleaf.h
@@ -0,0 +1,41 @@
1#ifndef AST_LEAF_H
2#define AST_LEAF_H
3
4#include "astnode.h"
5#include "bu/fstring.h"
6#include "bu/formatter.h"
7
8class AstLeaf : public AstNode
9{
10public:
11 AstLeaf( Type eType );
12 AstLeaf( Type eType, int iNew );
13 AstLeaf( Type eType, float fNew );
14 AstLeaf( Type eType, bool bNew );
15 AstLeaf( Type eType, const Bu::FString &sNew );
16 AstLeaf( Type eType, const char *sNew );
17 virtual ~AstLeaf();
18
19 void setIntValue( int iNew );
20 void setFloatValue( float fNew );
21 void setBoolValue( bool bNew );
22 void setStrValue( const Bu::FString &sNew );
23
24 int getIntValue() const;
25 float getFloatValue() const;
26 bool getBoolValue() const;
27 Bu::FString &getStrValue() const;
28
29private:
30 union
31 {
32 int iVal;
33 float fVal;
34 bool bVal;
35 Bu::FString *sVal;
36 };
37};
38
39Bu::Formatter &operator<<( Bu::Formatter &f, const AstLeaf &l );
40
41#endif