void Why3Translator::error(ASTNode const& _node, string const& _description)
{
	auto err = make_shared<Error>(Error::Type::Why3TranslatorError);
	*err <<
		errinfo_sourceLocation(_node.location()) <<
		errinfo_comment(_description);
	m_errors.push_back(err);
	m_errorOccured = true;
}
Esempio n. 2
0
bool LocationFinder::visitNode(const ASTNode& _node)
{
    if (_node.location().contains(m_location))
    {
        m_bestMatch = &_node;
        return true;
    }
    return false;
}
Esempio n. 3
0
void ASTPrinter::printSourcePart(ASTNode const& _node)
{
	if (m_gasCosts.count(&_node))
		*m_ostream << indentation() << "   Gas costs: " << m_gasCosts.at(&_node) << endl;
	if (!m_source.empty())
	{
		SourceLocation const& location(_node.location());
		*m_ostream << indentation() << "   Source: "
				   << escaped(m_source.substr(location.start, location.end - location.start), false) << endl;
	}
}