#include <Type.h>
Public Member Functions | |
FunctionType (constTypePtr return_type, constFunctionTypePtr arguments) | |
string | toString () const |
bool | isBasetype () const |
constTypePtr | matchFlex (constTypePtr type, unsigned int number=0) const |
int | match (constTypePtr expected) const |
bool | equals (constTypePtr expected) const |
bool | canCast (constTypePtr) const |
TypePtr | clone () const |
constTypePtr | unflex (constTypePtr type, unsigned int number=0) const |
std::ostream & | toStream (std::ostream &str) const |
FunctionType (constTypePtr returntype=Type::Unspec, bool as_const=false) | |
FunctionType (bytecodeistream &str) | |
~FunctionType () | |
constTypePtr | returnType () const |
void | concat (constTypePtr t) |
int | parameterCount () const |
constTypePtr | parameterType (unsigned int parameter_number) const |
constTupleTypePtr | parameters () const |
Private Member Functions | |
REP_BODY (FunctionType) | |
Private Attributes | |
const constTypePtr | m_returntype |
TupleTypePtr | m_arguments |
FunctionType::FunctionType | ( | constTypePtr | return_type, | |
constFunctionTypePtr | arguments | |||
) |
References concat().
FunctionType::FunctionType | ( | constTypePtr | returntype = Type::Unspec , |
|
bool | as_const = false | |||
) |
FunctionType::FunctionType | ( | bytecodeistream & | str | ) |
References m_arguments, m_returntype, Bytecode::readBool(), Bytecode::readType(), and y2debug.
FunctionType::~FunctionType | ( | ) |
bool FunctionType::canCast | ( | constTypePtr | to | ) | const [inline, virtual] |
check, if the type can be casted (at runtime considered to be - similar to dynamic_cast) to another type
Reimplemented from Type.
TypePtr FunctionType::clone | ( | ) | const [virtual] |
void FunctionType::concat | ( | constTypePtr | t | ) |
bool FunctionType::equals | ( | constTypePtr | expected | ) | const [virtual] |
check equality of the types, without any assumptions like any == unspec
Reimplemented from Type.
References m_arguments, and m_returntype.
bool FunctionType::isBasetype | ( | ) | const [inline, virtual] |
Reimplemented from Type.
int FunctionType::match | ( | constTypePtr | expected | ) | const [virtual] |
check match with expected type <0: no match, ==0: full match, >0: propagated match
Reimplemented from Type.
References Type::basematch(), m_arguments, m_returntype, toString(), and y2debug.
constTypePtr FunctionType::matchFlex | ( | constTypePtr | type, | |
unsigned int | number = 0 | |||
) | const [virtual] |
int FunctionType::parameterCount | ( | ) | const |
References m_arguments.
constTupleTypePtr FunctionType::parameters | ( | ) | const |
References m_arguments.
constTypePtr FunctionType::parameterType | ( | unsigned int | parameter_number | ) | const |
References m_arguments.
FunctionType::REP_BODY | ( | FunctionType | ) | [private] |
constTypePtr FunctionType::returnType | ( | ) | const [inline] |
References m_returntype.
std::ostream & FunctionType::toStream | ( | std::ostream & | str | ) | const [virtual] |
write bytecode out to stream
write out to bytecode stream
Reimplemented from Type.
References m_arguments, m_returntype, Bytecode::writeBool(), Bytecode::writeType(), and y2debug.
string FunctionType::toString | ( | void | ) | const [virtual] |
Converts a type code to its YCP notation.
Reimplemented from Type.
References m_arguments, m_returntype, Type::postToString(), and Type::preToString().
Referenced by match(), matchFlex(), and unflex().
constTypePtr FunctionType::unflex | ( | constTypePtr | type, | |
unsigned int | number = 0 | |||
) | const [virtual] |
replace any 'FlexT' (number == 0) or 'NFlexT' (number != 0) with 'type'
Reimplemented from Type.
References m_arguments, m_returntype, toString(), and y2debug.
TupleTypePtr FunctionType::m_arguments [private] |
Referenced by clone(), concat(), equals(), FunctionType(), match(), matchFlex(), parameterCount(), parameters(), parameterType(), toStream(), toString(), and unflex().
const constTypePtr FunctionType::m_returntype [private] |
Referenced by clone(), equals(), FunctionType(), match(), returnType(), toStream(), toString(), and unflex().