src/compiler/NameBinding.h
author Asher Baker <asherkin@gmail.com>
Mon Jun 10 15:52:44 2013 +0100 (2013-06-10)
changeset 265 3a903b89a514
parent 263 ba85a47ee414
permissions -rw-r--r--
Fixed type checking for multidimensional arrays.
asherkin@263
     1
/* vim: set ts=4 sw=4 tw=99 et:
asherkin@263
     2
 *
asherkin@263
     3
 * Copyright (C) 2012 David Anderson
asherkin@263
     4
 *
asherkin@263
     5
 * This file is part of SourcePawn.
asherkin@263
     6
 *
asherkin@263
     7
 * SourcePawn is free software: you can redistribute it and/or modify it under
asherkin@263
     8
 * the terms of the GNU General Public License as published by the Free
asherkin@263
     9
 * Software Foundation, either version 3 of the License, or (at your option)
asherkin@263
    10
 * any later version.
asherkin@263
    11
 * 
asherkin@263
    12
 * SourcePawn is distributed in the hope that it will be useful, but WITHOUT ANY
asherkin@263
    13
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
asherkin@263
    14
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
asherkin@263
    15
 *
asherkin@263
    16
 * You should have received a copy of the GNU General Public License along with
asherkin@263
    17
 * SourcePawn. If not, see http://www.gnu.org/licenses/.
asherkin@263
    18
 */
asherkin@263
    19
#ifndef _include_name_binding_h_
asherkin@263
    20
#define _include_name_binding_h_
asherkin@263
    21
asherkin@263
    22
#include "../PoolAllocator.h"
asherkin@263
    23
#include "../Types.h"
asherkin@263
    24
#include "Scanner.h"
asherkin@263
    25
asherkin@263
    26
namespace ke {
asherkin@263
    27
asherkin@263
    28
class Zone;
asherkin@263
    29
class CompileContext;
asherkin@263
    30
struct TranslationUnit;
asherkin@263
    31
asherkin@263
    32
// Creates symbols and types for names that are global or can be derived from
asherkin@263
    33
// a global. This phase also populates global scopes with lists of exported
asherkin@263
    34
// symbols.
asherkin@263
    35
void PopulateNamesAndTypes(Zone *zone, CompileContext &cc, TranslationUnit *unit);
asherkin@263
    36
asherkin@263
    37
// Because of the way globals work in Pawn, we need a precursor step to
asherkin@263
    38
// actually enter global symbols into the global struct. They're already in
asherkin@263
    39
// the global symbol table, so we know they won't clash. This process also
asherkin@263
    40
// binds any remaining types on global variables.
asherkin@263
    41
void BindGlobals(Zone *zone, CompileContext &cc, TranslationUnit *unit);
asherkin@263
    42
asherkin@263
    43
// Bind all outstanding names and finalize all unfinished types.
asherkin@263
    44
void BindNamesAndTypes(Zone *zone, CompileContext &cc, TranslationUnit *unit);
asherkin@263
    45
asherkin@263
    46
}
asherkin@263
    47
asherkin@263
    48
#endif // _include_name_binding_h_