Falcon::Value Class Reference

#include <syntree.h>

Inheritance diagram for Falcon::Value:

Inheritance graph
[legend]

List of all members.

Public Types


Public Member Functions

ArrayDeclasArray () const
bool asBool () const
DictDeclasDict () const
ExpressionasExpr () const
int64 asInteger () const
StringasLBind () const
numeric asNumeric () const
RangeDeclasRange () const
ValueasReference () const
StringasString () const
SymbolasSymbol () const
StringasSymdef () const
Valueclone () const
 Clone constructor.
void copy (const Value &other)
 Copies the value.
VarDefgenVarDef ()
 Creates a new Falcon::VarDef using the contents of this object.
bool isArray () const
bool isBool () const
bool isDict () const
bool isEqualByValue (const Value &other) const
 Verifies if another Falcon::Value is internally equal to this one.
bool isExpr () const
bool isImmediate () const
bool isInteger () const
bool isLBind () const
bool isNil () const
bool isNumeric () const
bool isRange () const
bool isReference () const
bool isSelf () const
bool isSimple () const
bool isString () const
bool isSymbol () const
bool isSymdef () const
bool isTrue () const
bool less (const Value &val) const
 Verifies if another Falcon::Value is internally greater or equal than this one.
bool operator!= (const Value &other) const
bool operator< (const Value &val) const
bool operator<= (const Value &other) const
Valueoperator= (const Value &other)
bool operator== (const Value &other) const
bool operator> (const Value &other) const
bool operator>= (const Value &other) const
void setArray (ArrayDecl *val)
void setBool (bool val)
void setDict (DictDecl *val)
void setExpr (Expression *val)
void setInteger (int64 val)
void setLBind (String *val)
void setNil ()
void setNumeric (numeric val)
void setRange (RangeDecl *val)
void setReference (Value *val)
void setSelf ()
void setString (String *val)
void setSymbol (Symbol *val)
void setSymdef (String *val)
void transfer (Value &other)
 Transfers the value of the original to this instance.
type_t type () const
 Value (Value *val)
 Value (RangeDecl *val)
 Value (DictDecl *val)
 Value (ArrayDecl *val)
 Value (Expression *val)
 Value (Symbol *val)
 Value (String *val)
 Value (numeric val)
 Value (int64 val)
 Value (bool val)
 Value (const Value &other)
 Value ()
 ~Value ()


Member Enumeration Documentation

Enumerator:
t_nil 
t_imm_bool 
t_imm_integer 
t_imm_string 
t_imm_num 
t_symbol 
t_symdef 
t_self 
t_lbind 
t_byref 
t_array_decl 
t_dict_decl 
t_range_decl 
t_expression 


Constructor & Destructor Documentation

Falcon::Value::Value (  )  [inline]

Falcon::Value::Value ( const Value other  )  [inline]

Falcon::Value::Value ( bool  val  )  [inline, explicit]

Falcon::Value::Value ( int64  val  )  [inline, explicit]

Falcon::Value::Value ( numeric  val  )  [inline, explicit]

Falcon::Value::Value ( String val  )  [inline]

Falcon::Value::Value ( Symbol val  )  [inline]

Falcon::Value::Value ( Expression val  )  [inline]

Falcon::Value::Value ( ArrayDecl val  )  [inline]

Falcon::Value::Value ( DictDecl val  )  [inline]

Falcon::Value::Value ( RangeDecl val  )  [inline]

Falcon::Value::Value ( Value val  )  [inline]

Falcon::Value::~Value (  ) 


Member Function Documentation

ArrayDecl* Falcon::Value::asArray (  )  const [inline]

bool Falcon::Value::asBool (  )  const [inline]

DictDecl* Falcon::Value::asDict (  )  const [inline]

Expression* Falcon::Value::asExpr (  )  const [inline]

int64 Falcon::Value::asInteger (  )  const [inline]

String* Falcon::Value::asLBind (  )  const [inline]

numeric Falcon::Value::asNumeric (  )  const [inline]

RangeDecl* Falcon::Value::asRange (  )  const [inline]

Value* Falcon::Value::asReference (  )  const [inline]

References asRef.

String* Falcon::Value::asString (  )  const [inline]

Symbol* Falcon::Value::asSymbol (  )  const [inline]

String* Falcon::Value::asSymdef (  )  const [inline]

Value* Falcon::Value::clone (  )  const

Clone constructor.

void Falcon::Value::copy ( const Value other  ) 

Copies the value.

VarDef* Falcon::Value::genVarDef (  ) 

Creates a new Falcon::VarDef using the contents of this object.

The Value() object is specific for the compiler; the VM and the module system does not know it. At times, it is needed to save in the module some data that are stored in the Falcon::Value; this is an utility function that does the job.

If the value is not simple, i.e. it's an expression or a statement, it cannot be converted and the function won't create a VarDef. Also, this version won't create a VarDef for symbols; use genVarDefSym() if this is required.

Returns:
a newly allocated prodef that has the same contents a the value, or 0 for complex values.

bool Falcon::Value::isArray (  )  const [inline]

bool Falcon::Value::isBool (  )  const [inline]

bool Falcon::Value::isDict (  )  const [inline]

bool Falcon::Value::isEqualByValue ( const Value other  )  const

Verifies if another Falcon::Value is internally equal to this one.

Works for nil, immediates and symbols. If the contents of the parameter are the same as those of this obeject, returns true, else false.

Parameters:
other the other value to be compared to this one.
Returns:
true if the type and content of the other element are the same as this.

bool Falcon::Value::isExpr (  )  const [inline]

bool Falcon::Value::isImmediate (  )  const [inline]

bool Falcon::Value::isInteger (  )  const [inline]

bool Falcon::Value::isLBind (  )  const [inline]

bool Falcon::Value::isNil (  )  const [inline]

bool Falcon::Value::isNumeric (  )  const [inline]

bool Falcon::Value::isRange (  )  const [inline]

bool Falcon::Value::isReference (  )  const [inline]

bool Falcon::Value::isSelf (  )  const [inline]

bool Falcon::Value::isSimple (  )  const [inline]

bool Falcon::Value::isString (  )  const [inline]

bool Falcon::Value::isSymbol (  )  const [inline]

bool Falcon::Value::isSymdef (  )  const [inline]

bool Falcon::Value::isTrue (  )  const [inline]

bool Falcon::Value::less ( const Value val  )  const

Verifies if another Falcon::Value is internally greater or equal than this one.

Works for nil, immediates, ranges and symbols. The ordering between type is nil less than interger less than range less than string less than symbol.

Parameters:
val the other value to be compared to this one.
Returns:
true if the type of the element is the same, and this item is less than val.

bool Falcon::Value::operator!= ( const Value other  )  const [inline]

bool Falcon::Value::operator< ( const Value val  )  const [inline]

bool Falcon::Value::operator<= ( const Value other  )  const [inline]

Value& Falcon::Value::operator= ( const Value other  )  [inline]

bool Falcon::Value::operator== ( const Value other  )  const [inline]

bool Falcon::Value::operator> ( const Value other  )  const [inline]

bool Falcon::Value::operator>= ( const Value other  )  const [inline]

void Falcon::Value::setArray ( ArrayDecl val  )  [inline]

void Falcon::Value::setBool ( bool  val  )  [inline]

void Falcon::Value::setDict ( DictDecl val  )  [inline]

void Falcon::Value::setExpr ( Expression val  )  [inline]

void Falcon::Value::setInteger ( int64  val  )  [inline]

void Falcon::Value::setLBind ( String val  )  [inline]

void Falcon::Value::setNil (  )  [inline]

void Falcon::Value::setNumeric ( numeric  val  )  [inline]

void Falcon::Value::setRange ( RangeDecl val  )  [inline]

void Falcon::Value::setReference ( Value val  )  [inline]

void Falcon::Value::setSelf (  )  [inline]

void Falcon::Value::setString ( String val  )  [inline]

void Falcon::Value::setSymbol ( Symbol val  )  [inline]

void Falcon::Value::setSymdef ( String val  )  [inline]

void Falcon::Value::transfer ( Value other  )  [inline]

Transfers the value of the original to this instance.

The original type is set to nil, so that this instance remains the sole owner of the deep value data.

References m_content, and m_type.

type_t Falcon::Value::type (  )  const [inline]


Member Data Documentation

Referenced by asReference().


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

Generated on Mon Oct 19 10:11:49 2009 for Falcon_Core by  doxygen 1.5.8