Commit ca17fe16 authored by Simon Morlat's avatar Simon Morlat

don't serialize recognizer'ids. There are re-constructed at load time.

parent 43333c36
......@@ -93,11 +93,7 @@ void Recognizer::serialize(BinaryOutputStream& fstr, bool topLevel){
if (topLevel || mName.empty()) {
//write the type
fstr<<type_byte;
//write the id followed by name if mId>0
fstr<<mId;
if (mId > 0) {
fstr<<mName;
}
fstr<<mName;
//then invoked derived class serialization
_serialize(fstr);
}else{
......@@ -110,12 +106,10 @@ void Recognizer::serialize(BinaryOutputStream& fstr, bool topLevel){
}
Recognizer::Recognizer(BinaryGrammarBuilder& istr){
//read the id
istr >> mId;
//if the id is > 0, read the recognizer name:
if (mId > 0){
istr >> mName;
}
// read the recognizer name:
string name;
istr >> name;
if (!name.empty()) setName(name);
}
......@@ -774,7 +768,6 @@ int Grammar::load(const std::string &filename){
/*extract the magic string*/
string magic;
ifs>>magic;
cout <<magic<<endl;
if (magic != "#!belr"){
ifs.close();
BCTBX_SLOGE<<filename<< " is not a belr grammar binary file.";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment