/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * typehints.h
 *
 * Author: pgess <v.melnychenko@xreate.org>
 */

/**
 * \file    typehints.h
 * \brief   Type inference hints
 */
#ifndef XREATE_TYPEHINTS_H
#define XREATE_TYPEHINTS_H

#include "ast.h"

namespace xreate{namespace typehints{

struct IntBits{
  unsigned int size;
};

struct ArrayHint{
  size_t size;
};

struct FlyHint{
  Expression hintSrc;
};

template<class Typ>
Typ find(const Expression& e, const Typ& def);

template<>
IntBits find(const Expression& e, const IntBits& def);

template<>
ArrayHint find(const Expression& e, const ArrayHint& def);

template<>
FlyHint find(const Expression& e, const FlyHint& def);

template<class Typ>
Typ parse(const Expression& e);

template<> IntBits parse(const Expression& e);
template<> ArrayHint parse(const Expression& e);

}}

#endif //XREATE_TYPEHINTS_H
