YECall Class Reference

#include <YExpression.h>

Inheritance diagram for YECall:
YCode Rep YEFunction YEFunctionPointer

List of all members.

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

Static Public Member Functions

static YECallPtr readCall (bytecodeistream &str)

Protected Attributes

TableEntrym_entry
SymbolEntryPtr m_sentry
YCodePtr * m_parameters
constTypePtr * m_parameter_types
Y2Functionm_functioncall
uint m_next_param_id

Private Member Functions

 REP_BODY (YECall)

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:
code,: parameter code
type,: parameter 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:
code,: parameter code
type,: parameter 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::Unspec, and y2debug.

const SymbolEntryPtr YECall::entry (  )  const

References m_sentry.

Referenced by finalize().

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, TableEntry::next_overloaded(), TableEntry::sentry(), type(), Type::Void, and y2debug.

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:
str the 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:
str byte stream to store into
Returns:
byte stream for chaining writing bytecode (str)

Implements YCode.

References m_next_param_id, m_parameters, m_sentry, 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 YEFunctionPointer::evaluate(), YEFunction::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:
str string stream to store into
indend indentation level for pretty print
Returns:
string stream for chaining writing XML (str)

Implements YCode.

References 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 finalize().


Member Data Documentation

Referenced by attachParameter(), and finalize().

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.6.3