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