Esempio n. 1
0
// Reads tag byte, then reads long or short atom as string and attempts to
// create it in atom table.
Term ExtTerm::read_tagged_atom_string(tool::Reader& r) {
  Tag tag = static_cast<Tag>(r.read_byte());
  if (tag == Tag::AtomExt) {
    return read_atom_string_i16(r);
  } else if (tag == Tag::SmallAtomExt) {
    return read_atom_string_i8(r);
  }
  E4FAIL(e4err::etf_atom_expected);
}
Esempio n. 2
0
// Reads tag byte, then reads long or short atom as string and attempts to
// create it in atom table.
Term read_tagged_atom_string(VM& vm, tool::Reader& r) {
  Tag tag = (Tag)r.read_byte();
  if (tag == Tag::AtomExt) {
    return read_atom_string_i16(vm, r);
  } else if (tag == Tag::SmallAtomExt) {
    return read_atom_string_i8(vm, r);
  }
  throw err::ExternalTerm("atom expected");
}
Esempio n. 3
0
// Reads short atom as string and attempts to create it in atom table.
Term ExtTerm::read_atom_string_i8(tool::Reader& r) {
  Word sz = r.read_byte();
  String atom_str = r.read_string(sz);
  return vm()->add_atom(atom_str.c_str());
}