Exemplo n.º 1
0
void AnalysisVisitor::visit(ast::SimpleVar & e)
{
    logger.log(L"SimpleVar", e.getSymbol().getName(), e.getLocation());
    symbol::Symbol & sym = e.getSymbol();
    Info & info = dm.read(sym, &e);
    Result & res = e.getDecorator().setResult(info.type);
    res.setConstant(info.getConstant());
    res.setRange(info.getRange());
    res.setMaxIndex(info.getMaxIndex());
    setResult(res);
}
Exemplo n.º 2
0
    void GlobalsCollector::visit(ast::SimpleVar & e)
    {
	if (!e.getParent()->isFieldExp() || static_cast<ast::FieldExp *>(e.getParent())->getTail() != &e)
	{
	    const symbol::Symbol & sym = e.getSymbol();
	    if (locals.find(sym) == locals.end())
	    {
		globals.emplace(sym);
	    }
	}
    }