TypeEqInfer.cxx File Reference

#include <stdint.h>
#include <stdlib.h>
#include <iostream>
#include <string>
#include <sstream>
#include <libsherpa/UExcept.hxx>
#include <libsherpa/CVector.hxx>
#include <assert.h>
#include "UocInfo.hxx"
#include "Options.hxx"
#include "AST.hxx"
#include "Type.hxx"
#include "TypeScheme.hxx"
#include "Typeclass.hxx"
#include "inter-pass.hxx"
#include <libsherpa/BigNum.hxx>
#include "TypeInfer.hxx"
#include "TypeEqInfer.hxx"
#include "TypeInferCommon.hxx"

Go to the source code of this file.

Defines

#define TYPEEQINFER(ast, gamma, instEnv, impTypes, isVP, tcc, uflags, trail, mode, flags)
#define PRINT(out, ast, ct)

Functions

std::string ctypeAsString (GCPtr< Type > t, GCPtr< Constraints > cset, bool showAllCts=false)
static GCPtr< TypebuildFnFromApp (GCPtr< AST > ast, unsigned long uflags)
static GCPtr< TypeSchemebindIdentDef (GCPtr< AST > ast, GCPtr< Environment< TypeScheme > > gamma, unsigned long bindFlags, unsigned long flags)
static GCPtr< TypeSchemeInstantiate (GCPtr< AST > ast, GCPtr< TypeScheme > sigma)
void addSubCst (GCPtr< AST > errAst, GCPtr< Type > t1, GCPtr< Type > t2, GCPtr< Constraints > tcc)
void addEqCst (GCPtr< AST > errAst, GCPtr< Type > t1, GCPtr< Type > t2, GCPtr< Constraints > tcc)
void addCcCst (GCPtr< AST > errAst, GCPtr< Type > t1, GCPtr< Type > t2, GCPtr< Constraints > tcc)
void addPcst (GCPtr< AST > errAst, GCPtr< Type > t, GCPtr< Constraints > tcc)
bool typeEqInfer (std::ostream &errStream, GCPtr< AST > ast, GCPtr< Environment< TypeScheme > > gamma, GCPtr< Environment< CVector< GCPtr< Instance > > > > instEnv, GCPtr< CVector< GCPtr< Type > > >impTypes, bool isVP, GCPtr< Constraints > tcc, unsigned long uflags, GCPtr< Trail > trail, int mode, unsigned flags)


Define Documentation

#define PRINT ( out,
ast,
ct   ) 

Value:

do {                                                    \
    out << "[" << ast->atKwd() << "]"                   \
        << ast->asString() << " : "                     \
        << ctypeAsString(ast->symType, ct, true)        \
        << std::endl;                                   \
  } while(0)

Definition at line 69 of file TypeEqInfer.cxx.

Referenced by typeEqInfer().

#define TYPEEQINFER ( ast,
gamma,
instEnv,
impTypes,
isVP,
tcc,
uflags,
trail,
mode,
flags   ) 

Value:

do {                                                            \
    CHKERR((errFree),                                           \
           (typeEqInfer(errStream, (ast), (gamma), (instEnv),   \
                        (impTypes), (isVP), (tcc), (uflags),    \
                        (trail), (mode), (flags))));            \
  }while(0)

Definition at line 61 of file TypeEqInfer.cxx.

Referenced by typeEqInfer().


Function Documentation

void addCcCst ( GCPtr< AST errAst,
GCPtr< Type t1,
GCPtr< Type t2,
GCPtr< Constraints tcc 
)

Definition at line 172 of file TypeEqInfer.cxx.

References addSubCst().

Referenced by typeEqInfer().

void addEqCst ( GCPtr< AST errAst,
GCPtr< Type t1,
GCPtr< Type t2,
GCPtr< Constraints tcc 
)

Definition at line 164 of file TypeEqInfer.cxx.

References addSubCst().

Referenced by EqUnify(), and typeEqInfer().

void addPcst ( GCPtr< AST errAst,
GCPtr< Type t,
GCPtr< Constraints tcc 
)

Definition at line 181 of file TypeEqInfer.cxx.

Referenced by typeEqInfer().

void addSubCst ( GCPtr< AST errAst,
GCPtr< Type t1,
GCPtr< Type t2,
GCPtr< Constraints tcc 
)

Definition at line 155 of file TypeEqInfer.cxx.

References sub().

Referenced by addCcCst(), addEqCst(), EqUnify(), TransClose(), and typeEqInfer().

static GCPtr<TypeScheme> bindIdentDef ( GCPtr< AST ast,
GCPtr< Environment< TypeScheme > >  gamma,
unsigned long  bindFlags,
unsigned long  flags 
) [static]

Definition at line 109 of file TypeEqInfer.cxx.

References assert(), BF_NO_MERGE, ID_IS_MUTATED, and TI_TYP_EXP.

Referenced by resolve(), typeEqInfer(), and typeInfer().

static GCPtr<Type> buildFnFromApp ( GCPtr< AST ast,
unsigned long  uflags 
) [static]

Definition at line 90 of file TypeEqInfer.cxx.

References assert(), and at_apply.

Referenced by typeEqInfer(), and typeInfer().

std::string ctypeAsString ( GCPtr< Type t,
GCPtr< Constraints cset,
bool  showAllCts = false 
)

static GCPtr<TypeScheme> Instantiate ( GCPtr< AST ast,
GCPtr< TypeScheme sigma 
) [static]

Definition at line 139 of file TypeEqInfer.cxx.

Referenced by typeEqInfer(), and typeInfer().

bool typeEqInfer ( std::ostream &  errStream,
GCPtr< AST ast,
GCPtr< Environment< TypeScheme > >  gamma,
GCPtr< Environment< CVector< GCPtr< Instance > > > >  instEnv,
GCPtr< CVector< GCPtr< Type > > >  impTypes,
bool  isVP,
GCPtr< Constraints tcc,
unsigned long  uflags,
GCPtr< Trail trail,
int  mode,
unsigned  flags 
)

Definition at line 198 of file TypeEqInfer.cxx.

References addCcCst(), addEqCst(), addPcst(), addSubCst(), argVec, assert(), at_apply, at_argVec, at_boolLiteral, at_charLiteral, at_constraints, at_define, at_deref, at_dummyType, at_dup, at_exceptionType, at_floatLiteral, at_fn, at_fnargVec, at_ident, at_identPattern, at_if, at_interface, at_intLiteral, at_lambda, at_module, at_mutableType, at_primaryType, at_select, at_setbang, at_stringLiteral, at_struct_apply, at_ucon_apply, at_unit, BF_REBIND, bindIdentDef(), buildFnFromApp(), COMP_BYREF, ctr, ctypeAsString(), DEF_MODE, EqUnify(), Instantiate(), PRINT, TI_TCC_SUB, TI_TYP_APP, TI_TYP_EXP, TY_CT_SUBSUMED, TYPEEQINFER, and USE_MODE.


Generated on Thu May 17 23:59:16 2012 for BitC Compiler by  doxygen 1.4.7