YCode Class Reference

YCode for precompiled ycp code. More...

#include <YCode.h>

Inheritance diagram for YCode:

Rep YBlock YConst YDeclaration YEBinary YEBracket YEBuiltin YECall YECompare YEIs YEList YELocale YEMap YEPropagate YEReference YEReturn YETerm YETriple YEUnary YEVariable YFunction YLocale YStatement List of all members.

Public Types

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
}

Public Member Functions

 YCode (ykind kind)
virtual ~YCode ()
ykind kind () const
bool valid () const
virtual string toString () const
virtual std::ostream & toStream (std::ostream &str) const =0
bool isConstant () const
bool isError () const
bool isStatement () const
bool isBlock () const
bool isReferenceable () const
virtual YCPValue evaluate (bool cse=false)
virtual constTypePtr type () const

Static Public Member Functions

static string toString (ykind kind)

Protected Attributes

ykind m_kind
bool m_valid

Private Member Functions

 REP_BODY (YCode)

Detailed Description

YCode for precompiled ycp code.


Member Enumeration Documentation

enum YCode::ykind
 

Enumerator:
yxError 
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 


Constructor & Destructor Documentation

YCode::YCode ykind  kind  ) 
 

Creates a new YCode element

YCode::~YCode  )  [virtual]
 

Cleans up


Member Function Documentation

YCPValue YCode::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 in YBlock, YConst, YLocale, YDeclaration, YFunction, YEVariable, YEReference, YETerm, YECompare, YELocale, YEList, YEMap, YEPropagate, YEUnary, YEBinary, YETriple, YEIs, YEReturn, YEBracket, YEBuiltin, YEFunction, YEFunctionPointer, YStatement, YSExpression, YSBlock, YSReturn, YSTypedef, YSFunction, YSAssign, YSBracket, YSIf, YSWhile, YSRepeat, YSDo, YSTextdomain, YSInclude, YSImport, YSFilename, and YSSwitch.

bool YCode::isBlock  )  const
 

returns true if the YCode represents a block

bool YCode::isConstant  )  const
 

returns true if the YCode represents a constant

bool YCode::isError  )  const
 

returns true if the YCode represents an error

bool YCode::isReferenceable  )  const
 

returns true if the YCode represents something we can reference to

bool YCode::isStatement  )  const
 

returns true if the YCode represents a statement

Reimplemented in YBlock.

YCode::ykind YCode::kind  )  const
 

Returns the YCode kind

Reimplemented in YBlock.

YCode::REP_BODY YCode   )  [private]
 

std::ostream & YCode::toStream std::ostream &  str  )  const [pure virtual]
 

writes YCode to a stream see Bytecode for read

Implemented in YBlock, YConst, YLocale, YDeclaration, YFunction, YEVariable, YEReference, YETerm, YECompare, YELocale, YEList, YEMap, YEPropagate, YEUnary, YEBinary, YETriple, YEIs, YEReturn, YEBracket, YEBuiltin, YECall, YStatement, YSExpression, YSBlock, YSReturn, YSTypedef, YSFunction, YSAssign, YSBracket, YSIf, YSWhile, YSRepeat, YSDo, YSTextdomain, YSInclude, YSImport, YSFilename, and YSSwitch.

string YCode::toString ykind  kind  )  [static]
 

string YCode::toString  )  const [virtual]
 

Returns an ASCII representation of the YCode.

Reimplemented in YBlock, YConst, YLocale, YDeclaration, YFunction, YEVariable, YEReference, YETerm, YECompare, YELocale, YEList, YEMap, YEPropagate, YEUnary, YEBinary, YETriple, YEIs, YEReturn, YEBracket, YEBuiltin, YECall, YStatement, YSExpression, YSBlock, YSReturn, YSTypedef, YSFunction, YSAssign, YSBracket, YSIf, YSWhile, YSRepeat, YSDo, YSTextdomain, YSInclude, YSImport, YSFilename, and YSSwitch.

constTypePtr YCode::type  )  const [virtual]
 

return type (interesting mostly for function calls)

Reimplemented in YBlock, YConst, YLocale, YDeclaration, YFunction, YEVariable, YEReference, YETerm, YECompare, YELocale, YEList, YEMap, YEPropagate, YEUnary, YEBinary, YETriple, YEIs, YEReturn, YEBracket, YEBuiltin, YECall, YStatement, YSExpression, YSBlock, YSReturn, YSTypedef, YSFunction, YSAssign, YSBracket, YSIf, YSWhile, YSRepeat, YSDo, YSTextdomain, YSInclude, YSImport, YSFilename, and YSSwitch.

bool YCode::valid  )  const
 

Returns true, if this instance is valid.


Member Data Documentation

ykind YCode::m_kind [protected]
 

Reimplemented in YBlock.

bool YCode::m_valid [protected]
 


The documentation for this class was generated from the following files:
Generated on Fri Jun 16 18:07:46 2006 for yast2-core by  doxygen 1.4.6