Ejemplo n.º 1
0
void Division::ResolveTypes()
{
    Operator* fst = mySubOps[0];
    fst->ResolveTypes();

    Operator* snd = mySubOps[1];
    snd->ResolveTypes();

    GlobalContext* gctx = reinterpret_cast<GlobalContext*>( myContext->GetGlobalContext() );

    Type* fstType = fst->GetType();
    Type* sndType = snd->GetType();

    if( sndType->IsScalar() )
        myType = fstType;
    else
        myType = new ErrorType(
            reinterpret_cast<GlobalContext*>( myContext->GetGlobalContext() ),
            "Unknown multiplication" );
}