jitcraft/NameBinding.cpp
author David Anderson <dvander@alliedmods.net>
Tue Jul 10 02:11:13 2012 -0700 (2012-07-10)
changeset 68 b40b0e18a918
parent 63 dd57743d220e
child 85 06a0015b6a5c
permissions -rw-r--r--
Added support for ISourcePawnEngine natives.
dvander@0
     1
/*
dvander@0
     2
 * Copyright (C) 2012 David Anderson
dvander@0
     3
 *
dvander@0
     4
 * This file is part of JITCraft.
dvander@0
     5
 *
dvander@0
     6
 * JITCraft is free software: you can redistribute it and/or modify it under
dvander@0
     7
 * the terms of the GNU General Public License as published by the Free
dvander@0
     8
 * Software Foundation, either version 3 of the License, or (at your option)
dvander@0
     9
 * any later version.
dvander@0
    10
 * 
dvander@0
    11
 * Foobar is distributed in the hope that it will be useful, but WITHOUT ANY
dvander@0
    12
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
dvander@0
    13
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
dvander@0
    14
 *
dvander@0
    15
 * You should have received a copy of the GNU General Public License along with
dvander@0
    16
 * JITCraft. If not, see http://www.gnu.org/licenses/.
dvander@0
    17
 */
dvander@0
    18
#include "NameBinding.h"
dvander@54
    19
#include "Strings.h"
dvander@47
    20
#include "Zone.h"
dvander@0
    21
dvander@59
    22
using namespace ke;
dvander@0
    23
dvander@54
    24
BoundName::BoundName(Scope *scope, Handle<String> name, const SourcePosition &pos)
dvander@0
    25
  : scope_(scope),
dvander@21
    26
    name_(name),
dvander@25
    27
    type_(NULL),
dvander@25
    28
    pos_(pos)
dvander@0
    29
{
dvander@0
    30
}
dvander@0
    31
dvander@63
    32
NamedFunction::NamedFunction(Scope *scope, Handle<String> name, const SourcePosition &pos,
dvander@63
    33
                             TokenKind token)
dvander@63
    34
  : BoundName(scope, name, pos),
dvander@68
    35
    token_(token),
dvander@68
    36
    isVariadicNative_(false)
dvander@0
    37
{
dvander@0
    38
}
dvander@0
    39
dvander@54
    40
Variable::Variable(Scope *scope, Handle<String> name, const SourcePosition &pos)
dvander@25
    41
  : BoundName(scope, name, pos),
dvander@0
    42
    location_(UNALLOCATED)
dvander@0
    43
{
dvander@0
    44
}