jitcraft/AST.h
changeset 54 8e22792a3921
parent 29 c0e27b4f0672
child 55 e073a9fe8e57
     1.1 --- a/jitcraft/AST.h	Sat Jul 07 17:11:31 2012 -0700
     1.2 +++ b/jitcraft/AST.h	Sat Jul 07 20:28:29 2012 -0700
     1.3 @@ -20,8 +20,8 @@
     1.4  
     1.5  #include "PoolAllocator.h"
     1.6  #include "Token.h"
     1.7 -#include "StringPool.h"
     1.8  #include "NameBinding.h"
     1.9 +#include <vector>
    1.10  
    1.11  namespace jc {
    1.12  
    1.13 @@ -160,10 +160,10 @@
    1.14      Variable *variable_;
    1.15      Expression *initialization_;
    1.16      ExpressionList *postDimensions_;
    1.17 -    Name *tag_;
    1.18 +    ScopedRoot<String> tag_;
    1.19  
    1.20    public:
    1.21 -    VariableDeclaration(const SourcePosition &pos, Variable *var, Name *tag,
    1.22 +    VariableDeclaration(const SourcePosition &pos, Variable *var, Handle<String> tag,
    1.23                          ExpressionList *postDimensions, Expression *initialization)
    1.24        : Statement(pos),
    1.25          variable_(var),
    1.26 @@ -173,7 +173,7 @@
    1.27      {
    1.28      }
    1.29  
    1.30 -    Name *tag() const {
    1.31 +    String *tag() const {
    1.32          return tag_;
    1.33      }
    1.34      Kind kind() const {
    1.35 @@ -196,18 +196,18 @@
    1.36  class Parameter : public PoolObject
    1.37  {
    1.38      Variable *variable_;
    1.39 -    Name *tag_;
    1.40 +    ScopedRoot<String> tag_;
    1.41      bool reference_;
    1.42  
    1.43    public:
    1.44 -    Parameter(Variable *var, Name *tag, bool reference)
    1.45 +    Parameter(Variable *var, Handle<String> tag, bool reference)
    1.46        : variable_(var),
    1.47          tag_(tag),
    1.48          reference_(reference)
    1.49      {
    1.50      }
    1.51  
    1.52 -    Name *tag() const {
    1.53 +    String *tag() const {
    1.54          return tag_;
    1.55      }
    1.56      Variable *variable() const {
    1.57 @@ -220,11 +220,11 @@
    1.58  
    1.59  class NameProxy : public Expression
    1.60  {
    1.61 -    Name *name_;
    1.62 +    ScopedRoot<String> name_;
    1.63      BoundName *binding_;
    1.64  
    1.65    public:
    1.66 -    NameProxy(const SourcePosition &pos, Name *name, BoundName *binding)
    1.67 +    NameProxy(const SourcePosition &pos, Handle<String> name, BoundName *binding)
    1.68        : Expression(pos),
    1.69          name_(name),
    1.70          binding_(binding)
    1.71 @@ -234,7 +234,7 @@
    1.72      Kind kind() const {
    1.73          return kNameProxy;
    1.74      }
    1.75 -    Name *name() const {
    1.76 +    String *name() const {
    1.77          return name_;
    1.78      }
    1.79      void accept(AstVisitor *visitor) {
    1.80 @@ -688,7 +688,7 @@
    1.81  
    1.82  class EnumStatement : public Statement
    1.83  {
    1.84 -    Name *name_;
    1.85 +    ScopedRoot<String> name_;
    1.86  
    1.87    public:
    1.88      struct Entry {
    1.89 @@ -705,7 +705,7 @@
    1.90      typedef std::vector<Entry> EntryList;
    1.91  
    1.92    public:
    1.93 -    EnumStatement(const SourcePosition &pos, Name *name, EntryList *entries)
    1.94 +    EnumStatement(const SourcePosition &pos, Handle<String> name, EntryList *entries)
    1.95        : Statement(pos),
    1.96          name_(name),
    1.97          entries_(entries)
    1.98 @@ -715,7 +715,7 @@
    1.99      Kind kind() const {
   1.100          return kEnumStatement;
   1.101      }
   1.102 -    Name *name() const {
   1.103 +    String *name() const {
   1.104          return name_;
   1.105      }
   1.106      EntryList *entries() const {