78 Type (tkind
kind,
bool as_const =
false,
bool as_reference =
false) : m_kind (kind), m_const (as_const), m_reference(as_reference) { };
97 static int nextToken (
const char **signature);
114 static constTypePtr
determineFlexType (constFunctionTypePtr actual, constFunctionTypePtr declared);
120 static const constTypePtr
Any;
122 static const constTypePtr
Void;
128 static const constTypePtr
Path;
131 static const constTypePtr
Term;
149 static const constTypePtr
Flex;
161 static const constTypePtr
List;
163 static const constTypePtr
Map;
167 static FunctionTypePtr
Function(constTypePtr return_type);
169 static const constTypePtr
Nil;
191 virtual std::ostream &
toStream (std::ostream & str)
const;
196 virtual std::ostream &
toXml (std::ostream & str,
int indent )
const;
206 virtual constTypePtr
matchFlex (constTypePtr ,
unsigned int = 0)
const {
return 0; }
214 virtual int match (constTypePtr expected)
const;
226 virtual bool canCast (constTypePtr to)
const;
231 virtual TypePtr
clone ()
const;
236 virtual constTypePtr
unflex (constTypePtr type,
unsigned int number = 0)
const;
272 int basematch (constTypePtr expected)
const;
277 virtual bool equals (constTypePtr expected)
const;
318 virtual constTypePtr
commontype (constTypePtr type)
const;
324 virtual constTypePtr
detailedtype (constTypePtr type)
const;
334 std::ostream &
toStream (std::ostream &
str)
const;
336 constTypePtr
matchFlex (constTypePtr type,
unsigned int number = 0)
const;
337 int match (constTypePtr expected)
const;
338 TypePtr
clone ()
const;
339 constTypePtr
unflex (constTypePtr type,
unsigned int number = 0)
const;
354 std::ostream &
toStream (std::ostream &
str)
const;
356 constTypePtr
matchFlex (constTypePtr type,
unsigned int number = 0)
const;
357 int match (constTypePtr expected)
const;
358 TypePtr
clone ()
const;
359 constTypePtr
unflex (constTypePtr type,
unsigned int number = 0)
const;
360 unsigned int number ()
const;
361 NFlexType (
unsigned int number,
bool as_const =
false);
376 std::ostream &
toStream (std::ostream &
str)
const;
378 constTypePtr
matchFlex (constTypePtr type,
unsigned int number = 0)
const;
379 int match (constTypePtr expected)
const;
380 bool equals (constTypePtr expected)
const;
381 TypePtr
clone ()
const;
382 constTypePtr
unflex (constTypePtr type,
unsigned int number = 0)
const;
383 constTypePtr
type ()
const {
return m_type; }
400 constTypePtr
matchFlex (constTypePtr type,
unsigned int number = 0)
const;
401 int match (constTypePtr expected)
const;
402 bool equals (constTypePtr expected)
const;
403 constTypePtr
commontype (constTypePtr type)
const;
405 bool canCast (constTypePtr to)
const;
406 TypePtr
clone ()
const;
407 constTypePtr
unflex (constTypePtr type,
unsigned int number = 0)
const;
408 constTypePtr
type ()
const {
return m_type; }
409 std::ostream &
toStream (std::ostream &
str)
const;
427 constTypePtr
matchFlex (constTypePtr type,
unsigned int number = 0)
const;
428 int match (constTypePtr expected)
const;
429 bool equals (constTypePtr expected)
const;
430 constTypePtr
commontype (constTypePtr type)
const;
432 bool canCast (constTypePtr to)
const;
433 TypePtr
clone ()
const;
434 constTypePtr
unflex (constTypePtr type,
unsigned int number = 0)
const;
435 constTypePtr
keytype ()
const {
return m_keytype; }
437 std::ostream &
toStream (std::ostream &
str)
const;
453 constTypePtr
matchFlex (constTypePtr type,
unsigned int number = 0)
const;
454 int match (constTypePtr expected)
const;
455 bool equals (constTypePtr expected)
const;
456 bool canCast (constTypePtr to)
const;
457 TypePtr
clone ()
const;
458 constTypePtr
unflex (constTypePtr type,
unsigned int number = 0)
const;
460 std::ostream &
toStream (std::ostream &
str)
const;
461 BlockType (constTypePtr type,
bool as_const =
false);
477 constTypePtr
matchFlex (constTypePtr type,
unsigned int number = 0)
const;
478 int match (constTypePtr expected)
const;
479 bool equals (constTypePtr expected)
const;
480 bool canCast (constTypePtr to)
const;
481 TypePtr
clone ()
const;
482 constTypePtr
unflex (constTypePtr type,
unsigned int number = 0)
const;
483 std::ostream &
toStream (std::ostream &
str)
const;
484 TupleType (constTypePtr type,
bool as_const =
false);
486 void concat (constTypePtr t);
488 constTypePtr parameterType (
unsigned int parameter_number)
const;
502 FunctionType (constTypePtr return_type, constFunctionTypePtr arguments);
505 constTypePtr
matchFlex (constTypePtr type,
unsigned int number = 0)
const;
506 int match (constTypePtr expected)
const;
507 bool equals (constTypePtr expected)
const;
508 bool canCast (constTypePtr )
const {
return false; }
509 TypePtr
clone ()
const;
510 constTypePtr
unflex (constTypePtr type,
unsigned int number = 0)
const;
511 std::ostream &
toStream (std::ostream &
str)
const;
516 void concat (constTypePtr t);
517 int parameterCount ()
const;
518 constTypePtr parameterType (
unsigned int parameter_number)
const;
519 constTupleTypePtr parameters ()
const;
bool isBasetype() const
Definition: Type.h:426
static const constTypePtr Wildcard
Definition: Type.h:132
bool isBasetype() const
Definition: Type.h:377
const constTypePtr m_type
Definition: Type.h:373
static const constTypePtr ConstLocale
Definition: Type.h:140
bool isBasetype() const
Definition: Type.h:355
bool isFlex() const
Definition: Type.h:297
static const constTypePtr Term
Definition: Type.h:131
bool m_const
Definition: Type.h:75
bool isWildcard() const
Definition: Type.h:296
static constTypePtr vt2type(enum YCPValueType vt)
Definition: TypeStatics.cc:30
std::vector< constTypePtr > m_types
Definition: Type.h:473
static const constTypePtr MapUnspec
Definition: Type.h:162
static const constTypePtr NFlex1
Definition: Type.h:151
bool isPath() const
Definition: Type.h:291
bool isTerm() const
Definition: Type.h:294
bool isSymbol() const
Definition: Type.h:293
#define str
Definition: scanner.cc:1003
static const constTypePtr Nil
Definition: Type.h:169
static const constTypePtr Map
Definition: Type.h:163
virtual std::ostream & toStream(std::ostream &str) const
Definition: Type.cc:145
constTypePtr type() const
Definition: Type.h:408
static const constTypePtr ConstTerm
Definition: Type.h:144
static const constTypePtr Locale
Definition: Type.h:127
Type(tkind kind, bool as_const=false, bool as_reference=false)
Definition: Type.h:78
bool isReference() const
Definition: Type.h:261
void asReference()
Definition: Type.h:266
static const constTypePtr ConstVoid
Definition: Type.h:135
static const constTypePtr Symbol
Definition: Type.h:130
virtual constTypePtr detailedtype(constTypePtr type) const
Definition: Type.cc:1923
tkind m_kind
Definition: Type.h:74
static void setNocheck(bool nocheck)
const constTypePtr m_valuetype
Definition: Type.h:423
static const constTypePtr ConstInteger
Definition: Type.h:139
bool isMap() const
Definition: Type.h:302
const constTypePtr m_returntype
Definition: Type.h:499
bool isBasetype() const
Definition: Type.h:504
static const constTypePtr ConstNFlex1
Definition: Type.h:152
static const constTypePtr ConstFlex
Definition: Type.h:150
bool isList() const
Definition: Type.h:301
static constTypePtr determineFlexType(constFunctionTypePtr actual, constFunctionTypePtr declared)
Definition: TypeStatics.cc:525
virtual string toXmlString() const
Definition: Type.cc:208
YCP type Block <type>
Definition: Type.h:445
const constTypePtr m_type
Definition: Type.h:396
bool isVariable() const
Definition: Type.h:300
static const constTypePtr Flex
Definition: Type.h:149
Tuple <type, type, ...> (function arguments)
Definition: Type.h:469
bool isBoolean() const
Definition: Type.h:286
YCPValueType
Value Type Defines constants for the Value types. The Value type specifies the class the YCPValueRep ...
Definition: YCPValue.h:36
static const constTypePtr ConstNFlex2
Definition: Type.h:154
const constTypePtr m_keytype
Definition: Type.h:422
enum Type::type_kind tkind
const constTypePtr m_type
Definition: Type.h:449
static int nextToken(const char **signature)
Definition: TypeStatics.cc:69
static const constTypePtr ConstNFlex3
Definition: Type.h:156
YCP type <flexN>
Definition: Type.h:348
Type()
Definition: Type.cc:111
tkind kind() const
Definition: Type.h:175
static const constTypePtr Error
Definition: Type.h:119
static const constTypePtr Block
Definition: Type.h:165
static const constTypePtr Unspec
Definition: Type.h:118
bool isVoid() const
Definition: Type.h:295
bool isError() const
Definition: Type.h:284
static const constTypePtr Float
Definition: Type.h:125
static const constTypePtr Any
Definition: Type.h:120
static const constTypePtr NFlex3
Definition: Type.h:155
static const constTypePtr ConstPath
Definition: Type.h:141
constTypePtr valuetype() const
Definition: Type.h:436
constTypePtr returnType() const
Definition: Type.h:459
virtual TypePtr clone() const
Definition: Type.cc:497
bool isBasetype() const
Definition: Type.h:399
bool isByteblock() const
Definition: Type.h:287
bool isNil() const
Definition: Type.h:307
static const constTypePtr ConstSymbol
Definition: Type.h:143
int basematch(constTypePtr expected) const
Definition: Type.cc:221
unsigned int parameterCount() const
Definition: Type.h:487
YCP type List <type>
Definition: Type.h:392
bool isLocale() const
Definition: Type.h:290
static const constTypePtr ConstNFlex4
Definition: Type.h:158
bool isUnspec() const
Definition: Type.h:283
bool isAny() const
Definition: Type.h:285
bool isTuple() const
Definition: Type.h:304
static const constTypePtr Path
Definition: Type.h:128
static const constTypePtr String
Definition: Type.h:129
bool isBasetype() const
Definition: Type.h:476
static const constTypePtr Byteblock
Definition: Type.h:124
virtual bool isBasetype() const
Definition: Type.h:201
TupleTypePtr m_arguments
Definition: Type.h:500
void asConst()
Definition: Type.h:256
static const constTypePtr NFlex2
Definition: Type.h:153
static const constTypePtr ListUnspec
Definition: Type.h:160
bool isFunction() const
Definition: Type.h:305
constTypePtr returnType() const
Definition: Type.h:515
bool isBlock() const
Definition: Type.h:303
static const constTypePtr NFlex4
Definition: Type.h:157
YCP type Variable <type> for iterator builtins.
Definition: Type.h:369
static constTypePtr fromSignature(const string &signature)
Definition: Type.h:108
virtual int matchvalue(YCPValue value) const
Definition: Type.cc:334
virtual constTypePtr unflex(constTypePtr type, unsigned int number=0) const
Definition: Type.cc:505
static const constTypePtr ConstString
Definition: Type.h:142
static const constTypePtr ConstFloat
Definition: Type.h:138
bool canCast(constTypePtr) const
Definition: Type.h:508
bool isInteger() const
Definition: Type.h:289
YCP type Map <keytype, valuetype>
Definition: Type.h:418
virtual bool canCast(constTypePtr to) const
Definition: Type.cc:472
bool isNFlex() const
Definition: Type.h:298
type_kind
Definition: Type.h:45
virtual std::ostream & toXml(std::ostream &str, int indent) const
Definition: Type.cc:158
YCP type Function <returntype, arg1type, arg2type, ...>
Definition: Type.h:495
bool isBasetype() const
Definition: Type.h:335
static const constTypePtr ConstBoolean
Definition: Type.h:136
constTypePtr type() const
Definition: Type.h:383
YCP type.
Definition: Type.h:36
static const constTypePtr Variable
Definition: Type.h:164
Wrapper for YCPValueRep This class realizes an automatic memory management via YCPElement. Access the functionality of YCPValueRep with the arrow operator. See YCPValueRep.
Definition: YCPValue.h:275
virtual constTypePtr commontype(constTypePtr type) const
Definition: Type.cc:1888
static const constTypePtr Integer
Definition: Type.h:126
unsigned int m_number
Definition: Type.h:351
YCPValueType valueType() const
Definition: Type.cc:1847
virtual string toString() const
Definition: Type.cc:170
Base class for reference counted objects.
Definition: Rep.h:46
static const constTypePtr List
Definition: Type.h:161
YCP type <flex>
Definition: Type.h:329
static FunctionTypePtr Function(constTypePtr return_type)
Definition: Type.cc:103
static const constTypePtr ConstAny
Definition: Type.h:134
static const constTypePtr ConstMap
Definition: Type.h:147
static const constTypePtr Boolean
Definition: Type.h:123
An istream that remembers some data about the xmlcode.
Definition: Xmlcode.h:42
An istream that remembers some data about the bytecode.
Definition: Bytecode.h:42
bool m_reference
Definition: Type.h:76
static const constTypePtr Void
Definition: Type.h:122
bool isFloat() const
Definition: Type.h:288
string postToString() const
Definition: Type.h:246
bool isConst() const
Definition: Type.h:251
virtual ~Type()
Definition: Type.cc:122
virtual constTypePtr matchFlex(constTypePtr, unsigned int=0) const
Definition: Type.h:206
constTypePtr keytype() const
Definition: Type.h:435
string preToString() const
Definition: Type.h:241
bool isBasetype() const
Definition: Type.h:452
virtual int match(constTypePtr expected) const
Definition: Type.cc:275
static const constTypePtr ConstByteblock
Definition: Type.h:137
static constTypePtr fromSignature(const char **signature)
Definition: TypeStatics.cc:281
Definition: MemUsage.h:37
virtual bool equals(constTypePtr expected) const
Definition: Type.cc:486
static const constTypePtr ConstList
Definition: Type.h:146
bool isString() const
Definition: Type.h:292