Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Examples

YEFunction Class Reference

#include <YExpression.h>

Inheritance diagram for YEFunction:

YCode Y2Function Rep List of all members.

Public Member Functions

 YEFunction (const SymbolEntryPtr entry)
 YEFunction (std::istream &str)
 ~YEFunction ()
const SymbolEntryPtr entry () const
constTypePtr attachParameter (YCodePtr code, constTypePtr type)
constTypePtr finalize ()
string toString () const
virtual YCPValue evaluate (bool cse=false)
std::ostream & toStream (std::ostream &str) const
constTypePtr type () const
string qualifiedName () const
virtual bool attachParameter (const YCPValue &arg, const int pos)
virtual constTypePtr wantedParameterType () const
virtual bool appendParameter (const YCPValue &arg)
virtual bool finishParameters ()
virtual YCPValue evaluateCall ()

Private Member Functions

 REP_BODY (YEFunction)

Private Attributes

const SymbolEntryPtr m_entry
ycodelist_tm_parameters

Constructor & Destructor Documentation

YEFunction::YEFunction const SymbolEntryPtr  entry  ) 
 

YEFunction::YEFunction std::istream &  str  ) 
 

YEFunction::~YEFunction  ) 
 


Member Function Documentation

bool YEFunction::appendParameter const YCPValue arg  )  [virtual]
 

Appends a parameter to the call.

Returns:
false if there was a type mismatch

Implements Y2Function.

bool YEFunction::attachParameter const YCPValue arg,
const int  pos
[virtual]
 

Attaches a parameter to a given position to the call.

Returns:
false if there was a type mismatch

Implements Y2Function.

constTypePtr YEFunction::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

const SymbolEntryPtr YEFunction::entry  )  const
 

YCPValue YEFunction::evaluate bool  cse = false  )  [virtual]
 

evaluate YCode to YCPValue if debugger == 0 called for parse time evaluation (i.e. constant subexpression elimination) else called for runtime evaluation

Reimplemented from YCode.

virtual YCPValue YEFunction::evaluateCall  )  [inline, virtual]
 

Executes the call

Implements Y2Function.

constTypePtr YEFunction::finalize  ) 
 

'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()

bool YEFunction::finishParameters  )  [virtual]
 

Signal that we're done adding parameters.

Returns:
false if there was a parameter missing

Implements Y2Function.

string YEFunction::qualifiedName  )  const
 

YEFunction::REP_BODY YEFunction   )  [private]
 

std::ostream & YEFunction::toStream std::ostream &  str  )  const [virtual]
 

writes YCode to a stream see Bytecode for read

Implements YCode.

string YEFunction::toString  )  const [virtual]
 

Returns an ASCII representation of the YCode.

Reimplemented from YCode.

constTypePtr YEFunction::type  )  const [virtual]
 

return type (interesting mostly for function calls)

Reimplemented from YCode.

constTypePtr YEFunction::wantedParameterType  )  const [virtual]
 

What type is expected for the next appendParameter (val) ? (Used when calling from Perl, to be able to convert from the simple type system of Perl to the elaborate type system of YCP)

Returns:
Type::Any if number of parameters exceeded

Implements Y2Function.


Member Data Documentation

const SymbolEntryPtr YEFunction::m_entry [private]
 

ycodelist_t* YEFunction::m_parameters [private]
 


The documentation for this class was generated from the following files:
Generated on Fri Nov 9 18:15:25 2007 for yast2-core by doxygen 1.3.6