view dmd/WhileStatement.d @ 32:81796b717a39

A few bad cast fixed. TODO: either get rid of dyncast(), or derive all objects from intermediate supertype.
author korDen
date Tue, 18 May 2010 17:51:46 +0400
parents 10317f0c89a5
children 51605de93870
line wrap: on
line source

module dmd.WhileStatement;

import dmd.Statement;
import dmd.Expression;
import dmd.Scope;
import dmd.InterState;
import dmd.HdrGenState;
import dmd.OutBuffer;
import dmd.InlineScanState;
import dmd.IRState;
import dmd.Loc;
import dmd.BE;
import dmd.ForStatement;

class WhileStatement : Statement
{
    Expression condition;
    Statement body_;

    this(Loc loc, Expression c, Statement b)
	{
		super(loc);
		condition = c;
		body_ = b;
	}
	
    Statement syntaxCopy()
	{
		assert(false);
	}
	
    Statement semantic(Scope sc)
	{
		/* Rewrite as a for(;condition;) loop
		 */

		Statement s = new ForStatement(loc, null, condition, null, body_);
		s = s.semantic(sc);
		return s;
	}
	
    bool hasBreak()
	{
		assert(false);
	}
	
    bool hasContinue()
	{
		assert(false);
	}
	
    bool usesEH()
	{
		assert(false);
	}
	
    BE blockExit()
	{
		assert(false);
	}
	
    bool comeFrom()
	{
		assert(false);
	}
	
    Expression interpret(InterState* istate)
	{
		assert(false);
	}
	
    void toCBuffer(OutBuffer buf, HdrGenState* hgs)
	{
		assert(false);
	}

    Statement inlineScan(InlineScanState* iss)
	{
		assert(false);
	}
	
    void toIR(IRState* irs)
	{
		assert(false);
	}
}