yast2-core
|
#include <YStatement.h>
Public Member Functions | |
YStatement (int line=0) | |
YStatement (bytecodeistream &str) | |
~YStatement () | |
virtual string | toString () const |
std::ostream & | toStream (std::ostream &str) const |
std::ostream & | toXml (std::ostream &str, int indent) const |
virtual bool | isStatement () const |
int | line () const |
virtual YCPValue | evaluate (bool cse=false) |
constTypePtr | type () const |
![]() | |
YCode () | |
virtual | ~YCode () |
virtual ykind | kind () const =0 |
std::string | commentToXml () const |
std::ostream & | commentToXml (std::ostream &str) const |
virtual bool | isConstant () const |
bool | isError () 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 (YStatement) | |
Private Attributes | |
int | m_line |
statement (-> statement, next statement)
YStatement::YStatement | ( | int | line = 0 | ) |
YStatement::YStatement | ( | bytecodeistream & | str | ) |
References YCode::kind(), m_line, Bytecode::readInt32(), and y2debug.
|
inline |
References str, toStream(), toString(), and toXml().
|
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.
Reimplemented in YSSwitch, YSFilename, YSImport, YSInclude, YSTextdomain, YSDo, YSRepeat, YSWhile, YSIf, YSBracket, YSAssign, YSFunction, YSTypedef, YSReturn, YSBlock, YSExpression, YSContinue, and YSBreak.
References toString(), and y2debug.
Referenced by YSBreak::kind(), YSContinue::kind(), YSExpression::kind(), YSBlock::kind(), YSReturn::kind(), YSTypedef::kind(), YSFunction::kind(), YSAssign::kind(), YSBracket::kind(), YSIf::kind(), YSWhile::kind(), YSRepeat::kind(), YSDo::kind(), YSTextdomain::kind(), YSInclude::kind(), YSImport::kind(), YSFilename::kind(), YSSwitch::kind(), and line().
|
inlinevirtual |
yes
Reimplemented from YCode.
|
inline |
References evaluate(), and m_line.
Referenced by YSExpression::evaluate(), and YSBlock::evaluate().
|
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.
Reimplemented in YSSwitch, YSFilename, YSImport, YSInclude, YSTextdomain, YSDo, YSRepeat, YSWhile, YSIf, YSBracket, YSAssign, YSFunction, YSTypedef, YSReturn, YSBlock, YSExpression, YSContinue, and YSBreak.
References YCode::kind(), m_line, YCode::toStream(), Bytecode::writeInt32(), and y2debug.
Referenced by YSBreak::kind(), YSContinue::kind(), YSExpression::kind(), YSBlock::kind(), YSReturn::kind(), YSTypedef::kind(), YSFunction::kind(), YSAssign::kind(), YSBracket::kind(), YSIf::kind(), YSWhile::kind(), YSRepeat::kind(), YSDo::kind(), YSTextdomain::kind(), YSInclude::kind(), YSImport::kind(), YSFilename::kind(), YSSwitch::kind(), YSBreak::toStream(), YSContinue::toStream(), YSExpression::toStream(), YSBlock::toStream(), YSReturn::toStream(), YSTypedef::toStream(), YSFunction::toStream(), YSAssign::toStream(), YSBracket::toStream(), YSIf::toStream(), YSWhile::toStream(), YSRepeat::toStream(), YSDo::toStream(), YSTextdomain::toStream(), YSInclude::toStream(), YSImport::toStream(), YSFilename::toStream(), YSSwitch::toStream(), and ~YStatement().
|
virtual |
Return ASCII represtation of this YCP code.
Reimplemented from YCode.
Reimplemented in YSSwitch, YSFilename, YSImport, YSInclude, YSTextdomain, YSDo, YSRepeat, YSWhile, YSIf, YSBracket, YSVariable, YSAssign, YSFunction, YSTypedef, YSReturn, YSBlock, YSExpression, YSContinue, and YSBreak.
Referenced by evaluate(), YSBreak::kind(), YSContinue::kind(), YSExpression::kind(), YSBlock::kind(), YSReturn::kind(), YSTypedef::kind(), YSFunction::kind(), YSAssign::kind(), YSVariable::kind(), YSBracket::kind(), YSIf::kind(), YSWhile::kind(), YSRepeat::kind(), YSDo::kind(), YSTextdomain::kind(), YSInclude::kind(), YSImport::kind(), YSFilename::kind(), YSSwitch::kind(), and ~YStatement().
|
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.
Reimplemented in YSSwitch, YSFilename, YSImport, YSInclude, YSTextdomain, YSDo, YSRepeat, YSWhile, YSIf, YSBracket, YSAssign, YSFunction, YSTypedef, YSReturn, YSBlock, YSExpression, YSContinue, and YSBreak.
References YCode::commentToXml(), and m_line.
Referenced by YSBreak::kind(), YSContinue::kind(), YSExpression::kind(), YSBlock::kind(), YSReturn::kind(), YSTypedef::kind(), YSFunction::kind(), YSAssign::kind(), YSBracket::kind(), YSIf::kind(), YSWhile::kind(), YSRepeat::kind(), YSDo::kind(), YSTextdomain::kind(), YSInclude::kind(), YSImport::kind(), YSFilename::kind(), YSSwitch::kind(), and ~YStatement().
|
inlinevirtual |
Return type of this YCP code (interesting mostly for function calls).
Reimplemented from YCode.
Reimplemented in YSSwitch, YSFilename, YSImport, YSInclude, YSTextdomain, YSDo, YSRepeat, YSWhile, YSIf, YSBracket, YSFunction, YSTypedef, YSReturn, YSBlock, and YSExpression.
References Type::Void.
|
private |
Referenced by line(), toStream(), toXml(), and YStatement().