*.ybc I/O More...
#include <Bytecode.h>
Classes | |
class | Invalid |
struct | namespaceentry_t |
references to namespaces More... | |
Static Public Member Functions | |
static std::ostream & | writeBool (std::ostream &streamref, bool value) |
static bool | readBool (bytecodeistream &streamref) |
static std::ostream & | writeString (std::ostream &streamref, const std::string &stringref) |
static bool | readString (bytecodeistream &streamref, std::string &stringref) |
static std::ostream & | writeUstring (std::ostream &streamref, const Ustring ustringref) |
static Ustring | readUstring (bytecodeistream &streamref) |
static std::ostream & | writeCharp (std::ostream &streamref, const char *charp) |
static char * | readCharp (bytecodeistream &streamref) |
static std::ostream & | writeBytep (std::ostream &streamref, const unsigned char *bytep, unsigned int len) |
static unsigned char * | readBytep (bytecodeistream &streamref) |
static std::ostream & | writeInt32 (std::ostream &str, const u_int32_t value) |
static u_int32_t | readInt32 (bytecodeistream &str) |
static std::ostream & | writeType (std::ostream &str, constTypePtr type) |
static TypePtr | readType (bytecodeistream &str) |
static std::ostream & | writeValue (std::ostream &str, const YCPValue value) |
static YCPValue | readValue (bytecodeistream &str) |
static std::ostream & | writeYCodelist (std::ostream &str, const ycodelist_t *codelist) |
static bool | readYCodelist (bytecodeistream &str, ycodelist_t **anchor) |
static void | namespaceInit () |
static int | namespaceId (const Y2Namespace *name_space) |
static const Y2Namespace * | namespacePtr (int namespace_id) |
static int | pushNamespace (const Y2Namespace *name_space, bool with_xrefs=false) |
static int | popNamespace (const Y2Namespace *name_space) |
static void | popUptoNamespace (const Y2Namespace *name_space) |
static int | tareStack () |
static void | untareStack (int tare_id) |
static std::ostream & | writeEntry (std::ostream &str, const SymbolEntryPtr entry) |
static SymbolEntryPtr | readEntry (bytecodeistream &str) |
static YCodePtr | readCode (bytecodeistream &str) |
static YBlockPtr | readModule (const string &mname) |
static YCodePtr | readFile (const string &filename) |
static bool | writeFile (const YCodePtr code, const string &filename) |
Static Private Attributes | |
static int | m_namespace_nesting_level = -1 |
static int | m_namespace_nesting_array_size = 0 |
static int | m_namespace_tare_level = 0 |
static namespaceentry_t * | m_namespace_nesting_array = 0 |
static map< string, YBlockPtr > * | m_bytecodeCache = NULL |
*.ybc I/O
int Bytecode::namespaceId | ( | const Y2Namespace * | name_space | ) | [static] |
References m_namespace_nesting_array, m_namespace_nesting_level, m_namespace_tare_level, and y2error.
Referenced by writeEntry().
void Bytecode::namespaceInit | ( | ) | [static] |
References m_namespace_nesting_array_size, m_namespace_nesting_level, m_namespace_tare_level, and y2debug.
const Y2Namespace * Bytecode::namespacePtr | ( | int | namespace_id | ) | [static] |
References m_namespace_nesting_array, m_namespace_nesting_level, m_namespace_tare_level, Bytecode::namespaceentry_t::name_space, and y2error.
Referenced by readEntry().
int Bytecode::popNamespace | ( | const Y2Namespace * | name_space | ) | [static] |
References SymbolTable::closeXRefs(), m_namespace_nesting_array, m_namespace_nesting_array_size, m_namespace_nesting_level, m_namespace_tare_level, Y2Namespace::table(), y2debug, and y2error.
Referenced by YFunction::setDefinition(), YEBuiltin::toStream(), YFunction::toStreamDefinition(), and YEBuiltin::YEBuiltin().
void Bytecode::popUptoNamespace | ( | const Y2Namespace * | name_space | ) | [static] |
int Bytecode::pushNamespace | ( | const Y2Namespace * | name_space, | |
bool | with_xrefs = false | |||
) | [static] |
References m_namespace_nesting_array, m_namespace_nesting_array_size, m_namespace_nesting_level, m_namespace_tare_level, Bytecode::namespaceentry_t::name_space, SymbolTable::openXRefs(), Y2Namespace::table(), Bytecode::namespaceentry_t::with_xrefs, y2debug, and y2error.
Referenced by YFunction::setDefinition(), YSImport::toStream(), YEBuiltin::toStream(), YBlock::toStream(), YFunction::toStreamDefinition(), YBlock::YBlock(), YEBuiltin::YEBuiltin(), and YSImport::YSImport().
bool Bytecode::readBool | ( | bytecodeistream & | streamref | ) | [static] |
Referenced by FunctionType::FunctionType(), Point::Point(), YFunction::setDefinition(), YConst::YConst(), YEBuiltin::YEBuiltin(), YFunction::YFunction(), YSDo::YSDo(), YSIf::YSIf(), YSInclude::YSInclude(), YSRepeat::YSRepeat(), YSReturn::YSReturn(), YSWhile::YSWhile(), and YSymbolEntry::YSymbolEntry().
unsigned char * Bytecode::readBytep | ( | bytecodeistream & | streamref | ) | [static] |
References readInt32().
char * Bytecode::readCharp | ( | bytecodeistream & | streamref | ) | [static] |
References readInt32().
Referenced by StaticDeclaration::readDeclaration(), YELocale::YELocale(), YETerm::YETerm(), YLocale::YLocale(), YSImport::YSImport(), and YSymbolEntry::YSymbolEntry().
YCodePtr Bytecode::readCode | ( | bytecodeistream & | str | ) | [static] |
References bytecodeistream::isVersion(), YECall::readCall(), y2error, YCode::ycConstant, YCode::ycFunction, YCode::ycLocale, YCode::yeBinary, YCode::yeBlock, YCode::yeBracket, YCode::yeBuiltin, YCode::yeCompare, YCode::yeExpression, YCode::yeFunction, YCode::yeFunctionPointer, YCode::yeIs, YCode::yeList, YCode::yeLocale, YCode::yeMap, YCode::yePropagate, YCode::yeReference, YCode::yeReturn, YCode::yeTerm, YCode::yeTriple, YCode::yeUnary, YCode::yeVariable, YCode::ysAssign, YCode::ysBlock, YCode::ysBracket, YCode::ysBreak, YCode::ysContinue, YCode::ysDo, YCode::ysExpression, YCode::ysFilename, YCode::ysFunction, YCode::ysIf, YCode::ysImport, YCode::ysInclude, YCode::ysRepeat, YCode::ysReturn, YCode::ysSwitch, YCode::ysTextdomain, YCode::ysTypedef, YCode::ysVariable, and YCode::ysWhile.
Referenced by YECall::readCall(), readFile(), readYCodelist(), YFunction::setDefinition(), TableEntry::TableEntry(), YBlock::YBlock(), YCPCode::YCPCode(), YEBinary::YEBinary(), YEBracket::YEBracket(), YEBuiltin::YEBuiltin(), YECall::YECall(), YECompare::YECompare(), YEIs::YEIs(), YELocale::YELocale(), YEMap::YEMap(), YEPropagate::YEPropagate(), YEReturn::YEReturn(), YETriple::YETriple(), YEUnary::YEUnary(), YFunction::YFunction(), YSAssign::YSAssign(), YSBlock::YSBlock(), YSBracket::YSBracket(), YSDo::YSDo(), YSExpression::YSExpression(), YSFunction::YSFunction(), YSIf::YSIf(), YSRepeat::YSRepeat(), YSReturn::YSReturn(), YSSwitch::YSSwitch(), YSWhile::YSWhile(), and YSymbolEntry::YSymbolEntry().
SymbolEntryPtr Bytecode::readEntry | ( | bytecodeistream & | str | ) | [static] |
References SymbolTable::getXRef(), Y2Namespace::name(), namespacePtr(), readInt32(), Y2Namespace::symbolEntry(), Y2Namespace::table(), y2debug, y2error, and ycp2error.
Referenced by YECall::readCall(), TableEntry::TableEntry(), YConst::YConst(), YEReference::YEReference(), YEVariable::YEVariable(), YSAssign::YSAssign(), and YSBracket::YSBracket().
YCodePtr Bytecode::readFile | ( | const string & | filename | ) | [static] |
u_int32_t Bytecode::readInt32 | ( | bytecodeistream & | str | ) | [static] |
Referenced by fromStream(), readBytep(), YECall::readCall(), readCharp(), readEntry(), readString(), readType(), readUstring(), readYCodelist(), TupleType::TupleType(), YBlock::YBlock(), YCPList::YCPList(), YCPMap::YCPMap(), YCPPath::YCPPath(), YECall::YECall(), YEMap::YEMap(), YSImport::YSImport(), YSSwitch::YSSwitch(), YStatement::YStatement(), and YSymbolEntry::YSymbolEntry().
YBlockPtr Bytecode::readModule | ( | const string & | mname | ) | [static] |
References YCPPathSearch::findModule(), m_bytecodeCache, readFile(), tareStack(), untareStack(), y2error, and ycperror.
Referenced by Y2WFMComponent::import(), and TestY2Component::import().
bool Bytecode::readString | ( | bytecodeistream & | streamref, | |
std::string & | stringref | |||
) | [static] |
References readInt32().
Referenced by fromStream(), YBlock::YBlock(), and YCPTerm::YCPTerm().
TypePtr Bytecode::readType | ( | bytecodeistream & | str | ) | [static] |
References Type::AnyT, Type::BlockT, Type::BooleanT, Type::ByteblockT, Type::Error, Type::ErrorT, Type::FlexT, Type::FloatT, Type::FunctionT, Type::IntegerT, Type::ListT, Type::LocaleT, Type::MapT, Type::NFlexT, Type::NilT, Type::PathT, readInt32(), Type::StringT, Type::SymbolT, Type::TermT, Type::TupleT, Type::UnspecT, Type::VariableT, Type::VoidT, Type::WildcardT, y2debug, and y2error.
Referenced by FunctionType::FunctionType(), StaticDeclaration::readDeclaration(), TupleType::TupleType(), YEBracket::YEBracket(), YEBuiltin::YEBuiltin(), YSImport::YSImport(), YSTypedef::YSTypedef(), and YSymbolEntry::YSymbolEntry().
Ustring Bytecode::readUstring | ( | bytecodeistream & | streamref | ) | [static] |
References SymbolEntry::_nameHash, and readInt32().
Referenced by YCPPathRep::Component::Component().
YCPValue Bytecode::readValue | ( | bytecodeistream & | str | ) | [static] |
References YCode::toString(), y2error, y2warning, YT_BOOLEAN, YT_BYTEBLOCK, YT_CODE, YT_FLOAT, YT_INTEGER, YT_LIST, YT_MAP, YT_PATH, YT_STRING, YT_SYMBOL, YT_TERM, and YT_VOID.
Referenced by YCPList::YCPList(), YCPMap::YCPMap(), and YSSwitch::YSSwitch().
bool Bytecode::readYCodelist | ( | bytecodeistream & | str, | |
ycodelist_t ** | anchor | |||
) | [static] |
References ycodelist::code, ycodelist::next, readCode(), readInt32(), y2debug, and y2error.
Referenced by YEBuiltin::YEBuiltin(), YEList::YEList(), and YETerm::YETerm().
int Bytecode::tareStack | ( | ) | [static] |
References m_namespace_nesting_level, and m_namespace_tare_level.
Referenced by readModule().
void Bytecode::untareStack | ( | int | tare_id | ) | [static] |
References m_namespace_tare_level.
Referenced by readModule().
std::ostream & Bytecode::writeBool | ( | std::ostream & | streamref, | |
bool | value | |||
) | [static] |
Referenced by YSymbolEntry::toStream(), YSInclude::toStream(), YSDo::toStream(), YSRepeat::toStream(), YSWhile::toStream(), YSIf::toStream(), YSReturn::toStream(), YEBuiltin::toStream(), YCPBooleanRep::toStream(), YFunction::toStream(), YConst::toStream(), FunctionType::toStream(), Type::toStream(), Point::toStream(), and YFunction::toStreamDefinition().
std::ostream & Bytecode::writeBytep | ( | std::ostream & | streamref, | |
const unsigned char * | bytep, | |||
unsigned int | len | |||
) | [static] |
References writeInt32().
Referenced by YCPByteblockRep::toStream().
std::ostream & Bytecode::writeCharp | ( | std::ostream & | streamref, | |
const char * | charp | |||
) | [static] |
References writeInt32().
Referenced by YSymbolEntry::toStream(), YELocale::toStream(), YETerm::toStream(), YLocale::toStream(), StaticDeclaration::writeDeclaration(), and SymbolTable::writeUsage().
std::ostream & Bytecode::writeEntry | ( | std::ostream & | str, | |
const SymbolEntryPtr | entry | |||
) | [static] |
References namespaceId(), writeInt32(), and y2error.
Referenced by YSBracket::toStream(), YSAssign::toStream(), YSFunction::toStream(), YECall::toStream(), YEReference::toStream(), YEVariable::toStream(), YCPEntryRep::toStream(), TableEntry::toStream(), and Point::toStream().
bool Bytecode::writeFile | ( | const YCodePtr | code, | |
const string & | filename | |||
) | [static] |
References y2error, YaST_BYTECODE_HEADER, YaST_BYTECODE_MAJOR, YaST_BYTECODE_MINOR, and YaST_BYTECODE_RELEASE.
Referenced by compilefile(), and processfile().
std::ostream & Bytecode::writeInt32 | ( | std::ostream & | str, | |
const u_int32_t | value | |||
) | [static] |
Referenced by YSymbolEntry::toStream(), YSSwitch::toStream(), YStatement::toStream(), YECall::toStream(), YEMap::toStream(), YCPPathRep::toStream(), YCPMapRep::toStream(), YCPListRep::toStream(), YBlock::toStream(), TupleType::toStream(), NFlexType::toStream(), Type::toStream(), Point::toStream(), writeBytep(), writeCharp(), writeEntry(), writeString(), SymbolTable::writeUsage(), writeUstring(), and writeYCodelist().
std::ostream & Bytecode::writeString | ( | std::ostream & | streamref, | |
const std::string & | stringref | |||
) | [static] |
References writeInt32().
Referenced by YCPStringRep::toStream(), YCPPathRep::toStream(), YCPFloatRep::toStream(), and YBlock::toStream().
std::ostream & Bytecode::writeType | ( | std::ostream & | str, | |
constTypePtr | type | |||
) | [static] |
std::ostream & Bytecode::writeUstring | ( | std::ostream & | streamref, | |
const Ustring | ustringref | |||
) | [static] |
std::ostream & Bytecode::writeValue | ( | std::ostream & | str, | |
const YCPValue | value | |||
) | [static] |
References YCPElement::isNull(), and y2error.
Referenced by YSSwitch::toStream(), YCPMapRep::toStream(), and YCPListRep::toStream().
std::ostream & Bytecode::writeYCodelist | ( | std::ostream & | str, | |
const ycodelist_t * | codelist | |||
) | [static] |
References ycodelist::code, ycodelist::next, writeInt32(), y2debug, and y2error.
Referenced by YEBuiltin::toStream(), YEList::toStream(), and YETerm::toStream().
map< string, YBlockPtr > * Bytecode::m_bytecodeCache = NULL [static, private] |
Referenced by readModule().
Bytecode::namespaceentry_t * Bytecode::m_namespace_nesting_array = 0 [static, private] |
Referenced by namespaceId(), namespacePtr(), popNamespace(), popUptoNamespace(), and pushNamespace().
int Bytecode::m_namespace_nesting_array_size = 0 [static, private] |
Referenced by namespaceInit(), popNamespace(), popUptoNamespace(), and pushNamespace().
int Bytecode::m_namespace_nesting_level = -1 [static, private] |
Referenced by namespaceId(), namespaceInit(), namespacePtr(), popNamespace(), popUptoNamespace(), pushNamespace(), and tareStack().
int Bytecode::m_namespace_tare_level = 0 [static, private] |
Referenced by namespaceId(), namespaceInit(), namespacePtr(), popNamespace(), popUptoNamespace(), pushNamespace(), tareStack(), and untareStack().