yast2-core
|
#include <YExpression.h>
Public Member Functions | |
YEBuiltin (declaration_t *decl, YBlockPtr parameterblock=0, constTypePtr type=0) | |
YEBuiltin (bytecodeistream &str) | |
~YEBuiltin () | |
virtual ykind | kind () const |
declaration_t * | decl () const |
constTypePtr | finalize (Logger *problem_logger) |
void | closeParameters () |
constTypePtr | attachParameter (YCodePtr code, constTypePtr type=Type::Unspec) |
constTypePtr | attachSymVariable (const char *name, constTypePtr type, unsigned int line, TableEntry *&tentry) |
string | toString () const |
YCPValue | evaluate (bool cse=false) |
std::ostream & | toStream (std::ostream &str) const |
std::ostream & | toXml (std::ostream &str, int indent) const |
constTypePtr | type () const |
constTypePtr | completeType () const |
YBlockPtr | parameterBlock () const |
![]() | |
YCode () | |
virtual | ~YCode () |
std::string | commentToXml () const |
std::ostream & | commentToXml (std::ostream &str) const |
virtual bool | isConstant () 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 (YEBuiltin) | |
Private Attributes | |
declaration_t * | m_decl |
constFunctionTypePtr | m_type |
YBlockPtr | m_parameterblock |
ycodelist_t * | m_parameters |
YEBuiltin::YEBuiltin | ( | declaration_t * | decl, |
YBlockPtr | parameterblock = 0 , |
||
constTypePtr | type = 0 |
||
) |
YEBuiltin::YEBuiltin | ( | bytecodeistream & | str | ) |
References m_decl, m_parameterblock, m_parameters, m_type, declaration::name, Bytecode::popNamespace(), Bytecode::pushNamespace(), Bytecode::readBool(), Bytecode::readCode(), StaticDeclaration::readDeclaration(), Bytecode::readType(), Bytecode::readYCodelist(), static_declarations, declaration::type, Type::Void, and y2debug.
YEBuiltin::~YEBuiltin | ( | ) |
References m_parameters, and ycodelist::next.
constTypePtr YEBuiltin::attachParameter | ( | YCodePtr | code, |
constTypePtr | type = Type::Unspec |
||
) |
Attach parameter to external function call
code | parameter code |
type | parameter type |
References ycodelist::code, m_parameters, m_type, ycodelist::next, Type::Unspec, and y2debug.
Referenced by attachSymVariable().
constTypePtr YEBuiltin::attachSymVariable | ( | const char * | name, |
constTypePtr | type, | ||
unsigned int | line, | ||
TableEntry *& | tentry | ||
) |
void YEBuiltin::closeParameters | ( | ) |
References m_parameterblock, and y2debug.
constTypePtr YEBuiltin::completeType | ( | ) | const |
References m_type.
declaration_t * YEBuiltin::decl | ( | ) | const |
References m_decl.
Referenced by attachSymVariable(), and finalize().
|
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 YCPList::add(), ycodelist::code, StaticDeclaration::Decl2String(), DECL_CALL_HANDLER, DECL_NIL, DECL_NOEVAL, declaration::flags, if(), YCPElement::isNull(), kind(), m_decl, m_parameterblock, m_parameters, declaration::name, declaration::name_space, ycodelist::next, declaration::ptr, YCode::toString(), toString(), declaration::type, type(), y2debug, YCode::ycEntry, and ycp2error.
constTypePtr YEBuiltin::finalize | ( | Logger * | problem_logger | ) |
'close' function, perform final parameter check if ok, return 0 if wrong signature (wrong parameter count, template mismatch) return expected signature if undefined, return Type::Error (wrong type was already reported in attachParameter())
'close' function, perform final parameter check if ok, return 0 if bad signature, return expected signature (i.e. if non-matching template) if undefined, return Type::Error (wrong type was already reported in attachParameter())
References ycodelist::code, decl(), StaticDeclaration::Decl2String(), DECL_FLEX, DECL_FORMATTED, Type::determineFlexType(), Logger::error(), Type::Error, StaticDeclaration::errorNoMatch(), StaticDeclaration::findDeclaration(), declaration::flags, m_decl, m_parameters, m_type, ycodelist::next, static_declarations, declaration::type, Logger::warning(), y2debug, YCode::ycLocale, and YCode::ycString.
|
inlinevirtual |
Kind of this YCode. This method must be reimplemented in the inherited classes.
Implements YCode.
References YCode::yeBuiltin.
Referenced by evaluate().
YBlockPtr YEBuiltin::parameterBlock | ( | ) | const |
References m_parameterblock.
|
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 m_decl, m_parameterblock, m_parameters, m_type, Bytecode::popNamespace(), Bytecode::pushNamespace(), static_declarations, str, YCode::toStream(), Bytecode::writeBool(), StaticDeclaration::writeDeclaration(), Bytecode::writeType(), and Bytecode::writeYCodelist().
|
virtual |
Return ASCII represtation of this YCP code.
Reimplemented from YCode.
References ycodelist::code, StaticDeclaration::Decl2String(), m_decl, m_parameters, and ycodelist::next.
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 ycodelist::code, YCode::commentToXml(), DECL_SYMBOL, declaration::flags, m_decl, m_parameterblock, m_parameters, declaration::name, declaration::name_space, ycodelist::next, Xmlcode::popNamespace(), Xmlcode::pushNamespace(), Xmlcode::writeYCodelist(), Xmlcode::xmlify(), and YCode::ycEntry.
|
virtual |
Return type of this YCP code (interesting mostly for function calls).
Reimplemented from YCode.
References Type::Error, m_decl, m_type, declaration::type, and y2debug.
Referenced by evaluate().
|
private |
Referenced by attachSymVariable(), decl(), evaluate(), finalize(), toStream(), toString(), toXml(), type(), and YEBuiltin().
|
private |
Referenced by attachSymVariable(), closeParameters(), evaluate(), parameterBlock(), toStream(), toXml(), and YEBuiltin().
|
private |
Referenced by attachParameter(), evaluate(), finalize(), toStream(), toString(), toXml(), YEBuiltin(), and ~YEBuiltin().
|
private |
Referenced by attachParameter(), attachSymVariable(), completeType(), finalize(), toStream(), type(), and YEBuiltin().