#include <YExpression.h>
Inheritance diagram for YEPropagate:

Public Member Functions | |
| YEPropagate (YCodePtr value, constTypePtr from, constTypePtr to) | |
| YEPropagate (bytecodeistream &str) | |
| ~YEPropagate () | |
| virtual ykind | kind () const |
| string | toString () const |
| bool | canPropagate (const YCPValue &value, constTypePtr to_type) const |
| YCPValue | evaluate (bool cse=false) |
| std::ostream & | toStream (std::ostream &str) const |
| constTypePtr | type () const |
Private Member Functions | |
| REP_BODY (YEPropagate) | |
Private Attributes | |
| constTypePtr | m_from |
| constTypePtr | m_to |
| YCodePtr | m_value |
| YEPropagate::YEPropagate | ( | YCodePtr | value, | |
| constTypePtr | from, | |||
| constTypePtr | to | |||
| ) |
lookup (map m, any k, any default) -> any Looks up the value matching to given key k. Returns default if the key was not found or has a different type than default.
Example:
lookup ($[1:"a", 2:"bc"], 371, "take this") -> "take this"
Type mismatch, returns default: lookup ($[1:"a", 2:"bc"], 1, true) -> true
| YEPropagate::YEPropagate | ( | bytecodeistream & | str | ) |
| YEPropagate::~YEPropagate | ( | ) |
| YEPropagate::REP_BODY | ( | YEPropagate | ) | [private] |
| virtual ykind YEPropagate::kind | ( | ) | const [inline, virtual] |
| string YEPropagate::toString | ( | ) | const [virtual] |
| bool YEPropagate::canPropagate | ( | const YCPValue & | value, | |
| constTypePtr | to_type | |||
| ) | const |
| YCPValue YEPropagate::evaluate | ( | bool | cse = false |
) | [virtual] |
| std::ostream & YEPropagate::toStream | ( | std::ostream & | str | ) | const [virtual] |
| constTypePtr YEPropagate::type | ( | ) | const [inline, virtual] |
return type (interesting mostly for function calls)
Reimplemented from YCode.
constTypePtr YEPropagate::m_from [private] |
constTypePtr YEPropagate::m_to [private] |
YCodePtr YEPropagate::m_value [private] |
1.5.0