26#pragma push_macro("None")
174 return (
a.isString() &&
b.isString()) ||
175 (
a._type ==
tFP &&
b._type ==
tFP && (
a._n == 1 ||
b._n == 1 ||
a._n ==
b._n));
192 std::stringstream
ss;
201 ss <<
"lifetime_error ";
203 ss <<
"Invalid_Lifetime ";
210 ss <<
"Float[" <<
dim() <<
"]";
216 ss <<
"Invalid_Type";
234#pragma pop_macro("None")
ExprType(const ExprType &other)
Copy constructor.
static bool valuesCompatible(const ExprType &a, const ExprType &b)
Checks if value types are compatible.
ExprType(Type type, int n, Lifetime lifetime)
Fully specified type.
bool operator==(const ExprType &other) const
Returns true if this and other match type and dimension.
Lifetime
Lifetimes that are possible for type, note the order is from highest to lowest priority for promotion...
@ ltERROR
Error in lifetime (uniform data depending on varying etc.)
@ ltVARYING
Varying data (i.e. changes per evaluation point)
@ ltCONSTANT
Constant data (i.e. sub parts of the tree that need only be computed once)
@ ltUNIFORM
Uniform data (i.e. changes only on grids or pixel tiles, depending on how expr used)
ExprType & None()
Mutate this into a none type.
ExprType & FP(int d)
Mutate this into a floating point type of dimension d.
ExprType & Uniform()
Mutate this into a uniform lifetime.
bool operator!=(const ExprType &other) const
Returns true if this and other do not match on type and dimension.
std::string toString() const
Stringify the type into a printable string.
ExprType & LifeError()
Mutate this into a lifetime error.
Lifetime lifetime() const
bool isFP() const
Direct is predicate checks.
ExprType & setLifetime(const ExprType &a, const ExprType &b, const ExprType &c)
Combine the lifetimes (min wins) of a and b and then assign them to this.
ExprType & String()
Mutate this into a string type.
ExprType & setLifetime(const ExprType &a)
Assign the lifetime from type a to be my type.
bool isLifeCompatible(const ExprType &o) const
@ tERROR
Error type (bad things happened here or upstream in tree)
@ tFP
Floating point type (this combines with _d member to make vectors)
ExprType & Error()
Mutate this into an error type.
bool isLifetimeUniform() const
ExprType & Varying()
Mutate this into a varying lifetime.
ExprType & setLifetime(const ExprType &a, const ExprType &b)
Combine the lifetimes (min wins) of a and b and then assign them to this.
int _n
Dimension of type _n==1 ignored if _type != FP.
bool isLifetimeVarying() const
ExprType & Constant()
Mutate this into a constant lifetime.
ExprType()
Default constructor for a type (error and lifetime error)
bool isLifetimeConstant() const
validity check: type is not an error
Lifetime _lifetime
lifetime of type
bool isLifetimeError() const
ExprType TypeVec(int n)
Quick way to get a vector type i.e. 3 vec is TypeVec(3)
Defined as a *alpha b *alpha< br ></div >< br > float< b > float a