yast2-core
|
YCP Constant. More...
#include <YCode.h>
Public Member Functions | |
YConst (ykind kind, YCPValue value) | |
YConst (ykind kind, bytecodeistream &str) | |
~YConst () | |
YCPValue | value () const |
virtual ykind | kind () const |
string | toString () const |
std::ostream & | toStream (std::ostream &str) const |
std::ostream & | toXml (std::ostream &str, int indent) const |
virtual bool | isConstant () const |
YCPValue | evaluate (bool cse=false) |
constTypePtr | type () const |
![]() | |
YCode () | |
virtual | ~YCode () |
std::string | commentToXml () const |
std::ostream & | commentToXml (std::ostream &str) const |
bool | isError () const |
virtual bool | isStatement () const |
virtual bool | isBlock () const |
virtual bool | isReferenceable () const |
void | setCommentBefore (const char *comment) |
void | setCommentAfter (const char *comment) |
![]() | |
Rep () | |
Rep (const Rep &) | |
Rep & | operator= (const Rep &) |
virtual | ~Rep () |
void | ref () const |
void | unref () const |
unsigned | refCount () const |
virtual const char * | repName () const |
virtual std::ostream & | dumpOn (std::ostream &str) const |
Private Member Functions | |
REP_BODY (YConst) | |
Private Attributes | |
ykind | m_kind |
YCPValue | m_value |
YCP Constant.
The base class for YCP constants (YCPValue).
YConst::YConst | ( | ykind | kind, |
bytecodeistream & | str | ||
) |
References YCPElement::isNull(), m_value, Bytecode::readBool(), Bytecode::readEntry(), YCode::toString(), y2debug, y2error, y2warning, YCode::ycBoolean, YCode::ycByteblock, YCode::ycEntry, YCode::ycFloat, YCode::ycInteger, YCode::ycList, YCode::ycMap, YCode::ycPath, YCode::ycString, YCode::ycSymbol, YCode::ycTerm, and YCode::ycVoid.
|
inline |
|
virtual |
Execute YCP code to get the resulting YCPValue. Every inherited class of YCode should reimplement this method.
cse | should the evaluation be done for parse time evaluation (i.e. constant subexpression elimination) |
Reimplemented from YCode.
References YCPElement::isNull(), m_value, toString(), and y2debug.
|
inlinevirtual |
yes
Reimplemented from YCode.
|
virtual |
|
private |
|
virtual |
Write YCP code to a byte stream (bytecode implementation). Every class inheriting from YCode must reimplement this method.
str | byte stream to store into |
Implements YCode.
References YCPElement::isNull(), m_kind, m_value, YCode::toStream(), Bytecode::writeBool(), y2error, and YCode::ycConstant.
|
virtual |
Return ASCII represtation of this YCP code.
Reimplemented from YCode.
References YCPElement::isNull(), m_kind, m_value, YCode::ycBoolean, YCode::ycByteblock, YCode::ycFloat, YCode::ycInteger, YCode::ycList, YCode::ycLocale, YCode::ycMap, YCode::ycPath, YCode::ycString, YCode::ycSymbol, YCode::ycTerm, YCode::ycVoid, YCode::yeBlock, and YCode::yeLocale.
Referenced by evaluate().
|
virtual |
Write YCP code as XML representation. Every class inheriting from YCode must reimplement this method.
str | string stream to store into |
indend | indentation level for pretty print |
Implements YCode.
References YCode::commentToXml(), YCPElement::isNull(), m_kind, m_value, str, y2error, and YCode::ycConstant.
|
virtual |
Return type of this YCP code (interesting mostly for function calls).
Reimplemented from YCode.
References Type::ConstAny, Type::ConstBoolean, Type::ConstByteblock, Type::ConstFloat, Type::ConstInteger, Type::ConstLocale, Type::ConstPath, Type::ConstString, Type::ConstSymbol, Type::ConstTerm, Type::ConstVoid, Type::ListUnspec, m_kind, Type::MapUnspec, Type::Unspec, YCode::ycBoolean, YCode::ycByteblock, YCode::ycFloat, YCode::ycInteger, YCode::ycList, YCode::ycLocale, YCode::ycMap, YCode::ycPath, YCode::ycString, YCode::ycSymbol, YCode::ycTerm, YCode::ycVoid, and YCode::yeBlock.
|
private |
Referenced by kind(), toStream(), toString(), toXml(), and type().
|
private |
Referenced by evaluate(), toStream(), toString(), toXml(), value(), and YConst().