Пример #1
0
// append opens the given file or stream and parses it as a .dc file.  The distributed
//     classes defined in the file are added to the list of classes associated with the File.
//     When appending from a stream, a filename is optional only used to report errors.
bool append(File* f, istream &in, const string &filename)
{
    init_file_parser(in, filename, *f);
    run_parser();
    cleanup_parser();
    return (parser_error_count() == 0);
}
Пример #2
0
string parse_value(const DistributedType* dtype, istream &in, bool &err)
{
	string value;
	try
	{
		init_value_parser(in, "parse_value()", dtype, value);
		run_parser();
		cleanup_parser();
	}
	catch(const exception& e)
	{
		err = true;
		return string("parse_value() error: ") + e.what();
	}

	if(parser_error_count() > 0)
	{
		err = true;
		return string("parse value(): unknown error");
	}

	err = false;
	return value;
}