//1// semacheck1.h2// gravity3//4// Created by Marco Bambini on 08/10/14.5// Copyright (c) 2014 CreoLabs. All rights reserved.6//78#ifndef __GRAVITY_SEMACHECK1__9#define __GRAVITY_SEMACHECK1__1011// Semantic check step 1 does not have the notion of context and scope.12// It just gathers non-local names into a symbol table and check for uniqueness.13//14// Only declarations (non-locals) are visited and a symbol table is created.15//16//17// In order to debug symbol table just enable the GRAVITY_SYMTABLE_DEBUG macro18// in debug_macros.h1920// Semantic Check Step 1 enables to resolve cases like:21/*22function foo() {23return bar();24}2526function bar() {27...28}2930or3132class foo:bar {33...34}3536class bar {37...38}3940and4142class foo {43var a;4445function bar() {46return a + b;47}4849var b;50}51*/5253// It's a mandatory step in order to account for forward references54// allowed in any non-local declaration5556#include "gravity_ast.h"57#include "gravity_delegate.h"5859bool gravity_semacheck1(gnode_t *node, gravity_delegate_t *delegate);6061#endif626364