void
ExpressionVariable::Output(std::ostream &out) const
{
	output_cast(out);
	Reducer* reducer = CGOptions::get_reducer();
	if (reducer && reducer->output_expr(this, out)) {
		return;
	}
	int i;
    int indirect_level = get_indirect_level(); 
    if (indirect_level > 0) {
        out << "(";
		for (i=0; i<indirect_level; i++) {
			out << "*";
		}
	}
	else if (indirect_level < 0) {
		assert(indirect_level == -1);
		out << "&";
    }
	var.Output(out);
    if (indirect_level > 0) {
        out << ")";
    }
}
Exemplo n.º 2
0
void
ExpressionFuncall::Output(std::ostream &out) const
{
    output_cast(out);
    Reducer* reducer = CGOptions::get_reducer();
    if (reducer && reducer->output_expr(this, out)) {
        return;
    }
    invoke.Output(out);
}
void
ExpressionComma::Output(std::ostream &out) const
{
	output_cast(out);
	Reducer* reducer = CGOptions::get_reducer();
	if (reducer && reducer->output_expr(this, out)) {
		return;
	}
	out << "(";
	lhs.Output(out);
	out << " , ";
	rhs.Output(out);
	out << ")";
}