yast2-core
Public Member Functions | Static Public Member Functions | Protected Attributes | Private Member Functions | List of all members
YECall Class Reference

#include <YExpression.h>

Inheritance diagram for YECall:
YCode Rep YEFunction YEFunctionPointer

Public Member Functions

 YECall (TableEntry *entry)
 
 YECall (bytecodeistream &str)
 
 ~YECall ()
 
const SymbolEntryPtr entry () const
 
constTypePtr attachParameter (YCodePtr code, constTypePtr type)
 
virtual constTypePtr finalize ()
 
string toString () const
 
std::ostream & toStream (std::ostream &str) const
 
std::ostream & toXml (std::ostream &str, int indent) const
 
constTypePtr type () const
 
string qualifiedName () const
 
- Public Member Functions inherited from YCode
 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 isStatement () const
 
virtual bool isBlock () const
 
virtual bool isReferenceable () const
 
virtual YCPValue evaluate (bool cse=false)
 
void setCommentBefore (const char *comment)
 
void setCommentAfter (const char *comment)
 
- Public Member Functions inherited from Rep
 Rep ()
 
 Rep (const Rep &)
 
Repoperator= (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
 

Static Public Member Functions

static YECallPtr readCall (bytecodeistream &str)
 
- Static Public Member Functions inherited from YCode
static string toString (ykind kind)
 
- Static Public Member Functions inherited from Rep
static void ref (const Rep *obj_r)
 
static void unref (const Rep *obj_r)
 

Protected Attributes

TableEntrym_entry
 
SymbolEntryPtr m_sentry
 
YCodePtr * m_parameters
 
constTypePtr * m_parameter_types
 
Y2Functionm_functioncall
 
uint m_next_param_id
 
- Protected Attributes inherited from YCode
const char * comment_before
 
const char * comment_after
 

Private Member Functions

 REP_BODY (YECall)
 

Additional Inherited Members

- Public Types inherited from YCode
enum  ykind {
  yxError = 0, ycVoid, ycBoolean, ycInteger,
  ycFloat, ycString, ycByteblock, ycPath,
  ycSymbol, ycList, ycMap, ycTerm,
  ycEntry, ycConstant, ycLocale, ycFunction,
  yePropagate, yeUnary, yeBinary, yeTriple,
  yeCompare, yeLocale, yeList, yeMap,
  yeTerm, yeIs, yeBracket, yeBlock,
  yeReturn, yeVariable, yeBuiltin, yeFunction,
  yeReference, yeFunctionPointer, yeExpression, ysTypedef,
  ysVariable, ysFunction, ysAssign, ysBracket,
  ysIf, ysWhile, ysDo, ysRepeat,
  ysExpression, ysReturn, ysBreak, ysContinue,
  ysTextdomain, ysInclude, ysFilename, ysImport,
  ysBlock, ysSwitch, ysStatement, yiBreakpoint
}
 
- Protected Member Functions inherited from Rep
virtual void ref_to (unsigned) const
 
virtual void unref_to (unsigned) const
 

Constructor & Destructor Documentation

YECall::YECall ( TableEntry entry)
YECall::YECall ( bytecodeistream str)
YECall::~YECall ( )

Member Function Documentation

constTypePtr YECall::attachParameter ( YCodePtr  code,
constTypePtr  type 
)

Attach parameter to external function call

Parameters
codeparameter code
typeparameter type
Returns
NULL if success, != NULL (expected type) if wrong parameter type Type::Unspec if bad code (NULL or isError) Type::Error if excessive parameter

Attach parameter to external function call

This function doesn't really check parameter types, this is done in YECall::finalize() below.

Parameters
codeparameter code
typeparameter type
Returns
NULL if success, != NULL (expected type) if wrong parameter type Type::Unspec if bad code (NULL or isError) Type::Error if excessive parameter

References Type::Error, m_entry, m_next_param_id, m_parameter_types, m_parameters, TableEntry::next_overloaded(), TableEntry::sentry(), type(), Type::Unspec, and y2debug.

const SymbolEntryPtr YECall::entry ( ) const

References m_sentry.

Referenced by finalize(), and YECall().

constTypePtr YECall::finalize ( )
virtual

'close' function, perform final parameter check if ok, return 0 if missing parameter, return its type if undefined, return Type::Error (wrong type was already reported in attachParameter()

Reimplemented in YEFunction.

References entry(), Type::Error, YCode::isBlock(), m_entry, m_next_param_id, m_parameter_types, m_parameters, m_sentry, BlockType::match(), TableEntry::next_overloaded(), TableEntry::sentry(), type(), Type::Void, and y2debug.

Referenced by YEFunction::finalize().

string YECall::qualifiedName ( ) const
YECallPtr YECall::readCall ( bytecodeistream str)
static

A static method to read YEFunction for function pointers and convert it to YEFunctionPointer implementation. This is needed for backward compatibility with SLES9/9.1

Parameters
strthe input bytecode stream
Returns
read YCode or 0 on errors

References bytecodeistream::isVersion(), Bytecode::readCode(), Bytecode::readEntry(), Bytecode::readInt32(), and y2error.

Referenced by Xmlcode::readCode(), and Bytecode::readCode().

YECall::REP_BODY ( YECall  )
private
std::ostream & YECall::toStream ( std::ostream &  str) const
virtual

Write YCP code to a byte stream (bytecode implementation). Every class inheriting from YCode must reimplement this method.

Parameters
strbyte stream to store into
Returns
byte stream for chaining writing bytecode (str)

Implements YCode.

References m_next_param_id, m_parameters, m_sentry, str, YCode::toStream(), Bytecode::writeEntry(), and Bytecode::writeInt32().

string YECall::toString ( void  ) const
virtual

Return ASCII represtation of this YCP code.

Returns
ASCII string representation

Reimplemented from YCode.

References m_next_param_id, m_parameters, m_sentry, and y2debug.

Referenced by YEFunction::evaluate(), YEFunctionPointer::evaluate(), and YECall().

std::ostream & YECall::toXml ( std::ostream &  str,
int  indent 
) const
virtual

Write YCP code as XML representation. Every class inheriting from YCode must reimplement this method.

Parameters
strstring stream to store into
indendindentation level for pretty print
Returns
string stream for chaining writing XML (str)

Implements YCode.

References YCode::commentToXml(), m_next_param_id, m_parameters, and m_sentry.

constTypePtr YECall::type ( ) const
virtual

Return type of this YCP code (interesting mostly for function calls).

Returns
type of the value to be returned after calling evaluate

Reimplemented from YCode.

References m_sentry.

Referenced by attachParameter(), finalize(), and switch().

Member Data Documentation

TableEntry* YECall::m_entry
protected

Referenced by attachParameter(), and finalize().

Y2Function* YECall::m_functioncall
protected
uint YECall::m_next_param_id
protected
constTypePtr* YECall::m_parameter_types
protected
YCodePtr* YECall::m_parameters
protected
SymbolEntryPtr YECall::m_sentry
protected

The documentation for this class was generated from the following files:

Generated on a sunny day for yast2-core by doxygen 1.8.8