yast2-core
|
#include <YCode.h>
Public Member Functions | |
YFunction (YBlockPtr parameterblock, const SymbolEntryPtr entry=0) | |
YFunction (bytecodeistream &str) | |
~YFunction () | |
virtual ykind | kind () const |
unsigned int | parameterCount () const |
YBlockPtr | declaration () const |
SymbolEntryPtr | parameter (unsigned int position) const |
YCodePtr | definition () const |
void | setDefinition (YBlockPtr body) |
void | setDefinition (YBreakpointPtr body) |
void | setDefinition (bytecodeistream &str) |
string | toStringDeclaration () const |
string | toString () const |
std::ostream & | toStreamDefinition (std::ostream &str) const |
std::ostream & | toXmlDefinition (std::ostream &str, int indent) const |
std::ostream & | toStream (std::ostream &str) const |
std::ostream & | toXml (std::ostream &str, int indent) const |
virtual YCPValue | evaluate (bool cse=false) |
constTypePtr | type () 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 (YFunction) | |
Private Attributes | |
YBlockPtr | m_declaration |
YCodePtr | m_definition |
bool | m_is_global |
function declaration (m_body == 0) or definition (m_body != 0) it's anonymouse here ! The code() member of the corresponding SymbolEntry points to YFunction.
YFunction::YFunction | ( | YBlockPtr | parameterblock, |
const SymbolEntryPtr | entry = 0 |
||
) |
YFunction::YFunction | ( | bytecodeistream & | str | ) |
References m_declaration, Bytecode::readBool(), Bytecode::readCode(), y2debug, and y2error.
YFunction::~YFunction | ( | ) |
YBlockPtr YFunction::declaration | ( | ) | const |
References m_declaration.
YCodePtr YFunction::definition | ( | ) | const |
References m_definition.
Referenced by setDefinition().
|
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 toString(), and y2debug.
|
inlinevirtual |
Kind of this YCode. This method must be reimplemented in the inherited classes.
Implements YCode.
References YCode::ycFunction.
SymbolEntryPtr YFunction::parameter | ( | unsigned int | position | ) | const |
References m_declaration.
Referenced by toStringDeclaration(), and type().
unsigned int YFunction::parameterCount | ( | void | ) | const |
References m_declaration.
Referenced by toStringDeclaration(), and type().
|
private |
void YFunction::setDefinition | ( | YBlockPtr | body | ) |
References YBlock::b_definition, definition(), and m_definition.
void YFunction::setDefinition | ( | YBreakpointPtr | body | ) |
References definition(), and m_definition.
void YFunction::setDefinition | ( | bytecodeistream & | str | ) |
|
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_declaration, str, YCode::toStream(), Bytecode::writeBool(), and y2debug.
std::ostream & YFunction::toStreamDefinition | ( | std::ostream & | str | ) | const |
References m_declaration, m_definition, Bytecode::popNamespace(), Bytecode::pushNamespace(), str, Bytecode::writeBool(), and y2debug.
|
virtual |
Return ASCII represtation of this YCP code.
Reimplemented from YCode.
References m_definition, and toStringDeclaration().
Referenced by evaluate().
string YFunction::toStringDeclaration | ( | ) | const |
References parameter(), and parameterCount().
Referenced by toString().
|
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 m_declaration, m_definition, Xmlcode::popNamespace(), Xmlcode::pushNamespace(), Xmlcode::spaces(), and str.
std::ostream & YFunction::toXmlDefinition | ( | std::ostream & | str, |
int | indent | ||
) | const |
References str.
|
virtual |
Return type of this YCP code (interesting mostly for function calls).
Reimplemented from YCode.
References parameter(), parameterCount(), and Type::Unspec.
|
private |
Referenced by declaration(), parameter(), parameterCount(), setDefinition(), toStream(), toStreamDefinition(), toXml(), and YFunction().
|
private |
Referenced by definition(), setDefinition(), toStreamDefinition(), toString(), and toXml().
|
private |