summaryrefslogtreecommitdiff
path: root/src/variable.h
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2011-12-29 23:30:49 -0700
committerMike Buland <eichlan@xagasoft.com>2011-12-29 23:30:49 -0700
commit35f71b12dc48a928d98743f607f62b2f6dbe7307 (patch)
treef4297f57e570f52f3776392fc8ed4075db1ab4ac /src/variable.h
parentf66458278ce3663397fc985a1253c85b74f011e6 (diff)
downloadstage-35f71b12dc48a928d98743f607f62b2f6dbe7307.tar.gz
stage-35f71b12dc48a928d98743f607f62b2f6dbe7307.tar.bz2
stage-35f71b12dc48a928d98743f607f62b2f6dbe7307.tar.xz
stage-35f71b12dc48a928d98743f607f62b2f6dbe7307.zip
Goto works, scopes work.
Diffstat (limited to 'src/variable.h')
-rw-r--r--src/variable.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/variable.h b/src/variable.h
index 42dd865..7f482a3 100644
--- a/src/variable.h
+++ b/src/variable.h
@@ -6,6 +6,17 @@
6#include <bu/string.h> 6#include <bu/string.h>
7#include <bu/hash.h> 7#include <bu/hash.h>
8 8
9#include "enums.h"
10
11class VariableRef
12{
13public:
14 ScopeId sid;
15 Bu::String sName;
16
17 bool operator==( const VariableRef &rhs ) const;
18};
19
9class Variable 20class Variable
10{ 21{
11friend uint32_t Bu::__calcHashCode<Variable>( const Variable &k ); 22friend uint32_t Bu::__calcHashCode<Variable>( const Variable &k );
@@ -35,7 +46,7 @@ public:
35 virtual ~Variable(); 46 virtual ~Variable();
36 47
37 static Variable newSituationName( const Bu::String &s ); 48 static Variable newSituationName( const Bu::String &s );
38 static Variable newVariableName( const Bu::String &s ); 49 static Variable newVariableName( const Bu::String &s, ScopeId sid );
39 50
40 Type getType() const { return eType; } 51 Type getType() const { return eType; }
41 52
@@ -43,6 +54,7 @@ public:
43 int64_t getInt() const; 54 int64_t getInt() const;
44 double getFloat() const; 55 double getFloat() const;
45 Bu::String getString() const; 56 Bu::String getString() const;
57 VariableRef getVariableRef() const;
46 58
47 Variable to( Type e ) const; 59 Variable to( Type e ) const;
48 60
@@ -81,6 +93,7 @@ private:
81 Bu::String *sValue; 93 Bu::String *sValue;
82 VList *lValue; 94 VList *lValue;
83 VHash *hValue; 95 VHash *hValue;
96 VariableRef *rValue;
84 }; 97 };
85}; 98};
86 99