jitcraft/NameBinding.h
changeset 54 8e22792a3921
parent 37 abb03d835b53
child 59 b7d61ddb3c8d
     1.1 --- a/jitcraft/NameBinding.h	Sat Jul 07 17:11:31 2012 -0700
     1.2 +++ b/jitcraft/NameBinding.h	Sat Jul 07 20:28:29 2012 -0700
     1.3 @@ -19,7 +19,6 @@
     1.4  #define _include_name_binding_h_
     1.5  
     1.6  #include "PoolAllocator.h"
     1.7 -#include "StringPool.h"
     1.8  #include "Types.h"
     1.9  #include "Scanner.h"
    1.10  
    1.11 @@ -31,11 +30,12 @@
    1.12  class Type;
    1.13  class NamedEnum;
    1.14  class NamedConstant;
    1.15 +class String;
    1.16  
    1.17  class BoundName : public PoolObject
    1.18  {
    1.19      Scope *scope_;
    1.20 -    Name *name_;
    1.21 +    ScopedRoot<String> name_;
    1.22      ScopedRoot<Type> type_;
    1.23      SourcePosition pos_;
    1.24  
    1.25 @@ -47,11 +47,11 @@
    1.26        CONSTANT
    1.27      };
    1.28  
    1.29 -    BoundName(Scope *scope, Name *name, const SourcePosition &pos);
    1.30 +    BoundName(Scope *scope, Handle<String> name, const SourcePosition &pos);
    1.31  
    1.32      virtual Kind kind() const = 0;
    1.33  
    1.34 -    Name *name() const {
    1.35 +    String *name() const {
    1.36          return name_;
    1.37      }
    1.38      Scope *scope() const {
    1.39 @@ -85,7 +85,7 @@
    1.40      unsigned slot_;
    1.41  
    1.42    public:
    1.43 -    NamedFunction(Scope *scope, Name *name, const SourcePosition &pos);
    1.44 +    NamedFunction(Scope *scope, Handle<String> name, const SourcePosition &pos);
    1.45  
    1.46      Kind kind() const {
    1.47          return FUNCTION;
    1.48 @@ -101,7 +101,7 @@
    1.49  class NamedEnum : public BoundName
    1.50  {
    1.51    public:
    1.52 -    NamedEnum(Scope *scope, Name *name, const SourcePosition &pos)
    1.53 +    NamedEnum(Scope *scope, Handle<String> name, const SourcePosition &pos)
    1.54        : BoundName(scope, name, pos)
    1.55      {
    1.56      }
    1.57 @@ -117,7 +117,7 @@
    1.58      Type *type_;
    1.59  
    1.60    public:
    1.61 -    NamedConstant(Scope *scope, Name *name, const SourcePosition &pos)
    1.62 +    NamedConstant(Scope *scope, Handle<String> name, const SourcePosition &pos)
    1.63        : BoundName(scope, name, pos),
    1.64          type_(NULL)
    1.65      {
    1.66 @@ -147,7 +147,7 @@
    1.67          PARAMETER
    1.68      };
    1.69  
    1.70 -    Variable(Scope *scope, Name *name, const SourcePosition &pos);
    1.71 +    Variable(Scope *scope, Handle<String> name, const SourcePosition &pos);
    1.72  
    1.73      Kind kind() const {
    1.74          return VARIABLE;