#include <YExpression.h>
Public Member Functions | |
YEList (YCodePtr code) | |
YEList (bytecodeistream &str) | |
~YEList () | |
virtual ykind | kind () const |
void | attach (YCodePtr element) |
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 |
int | count () const |
YCodePtr | value (int index) const |
Private Member Functions | |
REP_BODY (YEList) | |
Private Attributes | |
ycodelist_t * | m_first |
YEList::YEList | ( | YCodePtr | code | ) |
References ycodelist::code, m_first, and ycodelist::next.
YEList::YEList | ( | bytecodeistream & | str | ) |
References m_first, and Bytecode::readYCodelist().
YEList::~YEList | ( | ) |
References m_first, and ycodelist::next.
void YEList::attach | ( | YCodePtr | element | ) |
References ycodelist::code, m_first, and ycodelist::next.
int YEList::count | ( | ) | const |
YCPValue YEList::evaluate | ( | bool | cse = false |
) | [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, YCPElement::isNull(), m_first, ycodelist::next, toString(), value(), and y2debug.
virtual ykind YEList::kind | ( | ) | const [inline, virtual] |
Kind of this YCode. This method must be reimplemented in the inherited classes.
Implements YCode.
References YCode::yeList.
YEList::REP_BODY | ( | YEList | ) | [private] |
std::ostream & YEList::toStream | ( | std::ostream & | str | ) | const [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_first, and Bytecode::writeYCodelist().
string YEList::toString | ( | void | ) | const [virtual] |
Return ASCII represtation of this YCP code.
Reimplemented from YCode.
References ycodelist::code, m_first, and ycodelist::next.
Referenced by evaluate().
std::ostream & YEList::toXml | ( | std::ostream & | str, | |
int | indent | |||
) | const [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 count(), m_first, ycodelist::next, and Xmlcode::writeYCodelist().
constTypePtr YEList::type | ( | ) | const [virtual] |
Return type of this YCP code (interesting mostly for function calls).
Reimplemented from YCode.
References ycodelist::code, m_first, and ycodelist::next.
YCodePtr YEList::value | ( | int | index | ) | const |
ycodelist_t* YEList::m_first [private] |
Referenced by attach(), count(), evaluate(), toStream(), toString(), toXml(), type(), value(), YEList(), and ~YEList().