mjplusplus  v0.4.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | List of all members
ast::stmt::WhileStatement Class Reference

#include <WhileStatement.hpp>

Inheritance diagram for ast::stmt::WhileStatement:
ast::stmt::Statement ast::Node

Public Member Functions

 WhileStatement (shptr< Expression > condition, shptr< Statement > statement)
 
virtual void toString (std::ostream &out, unsigned int indent, bool special=false) const
 
virtual bool analyze (semantic::SemanticAnalysis &sa, shptr< semantic::symbol::SymbolTable > symboltable) const
 analyze a statement for semantic correctness, and recursivly analyze its children More...
 
virtual unsigned int countVariableDeclarations () const
 
virtual int setVariablePositions (int) const
 
virtual void accept (ASTVisitor &visitor) const
 
virtual shptr< ExpressiongetCondition () const
 
virtual shptr< StatementgetLoopStatement () const
 
- Public Member Functions inherited from ast::stmt::Statement
virtual Type getType () const
 

Protected Attributes

shptr< Expressioncondition
 
shptr< Statementstatement
 

Additional Inherited Members

- Public Types inherited from ast::stmt::Statement
enum  Type { TYPE_SINGLE, TYPE_BLOCK, TYPE_IF }
 

Constructor & Destructor Documentation

ast::stmt::WhileStatement::WhileStatement ( shptr< Expression condition,
shptr< Statement statement 
)

Member Function Documentation

void ast::stmt::WhileStatement::accept ( ASTVisitor visitor) const
virtual

Reimplemented from ast::stmt::Statement.

bool ast::stmt::WhileStatement::analyze ( semantic::SemanticAnalysis sa,
shptr< semantic::symbol::SymbolTable symboltable 
) const
virtual

analyze a statement for semantic correctness, and recursivly analyze its children

Returns
true iff all paths of this statement contsin a return statement

Implements ast::stmt::Statement.

unsigned int ast::stmt::WhileStatement::countVariableDeclarations ( ) const
virtual

Reimplemented from ast::stmt::Statement.

shptr< ast::Expression > ast::stmt::WhileStatement::getCondition ( ) const
virtual
shptr< ast::stmt::Statement > ast::stmt::WhileStatement::getLoopStatement ( ) const
virtual
int ast::stmt::WhileStatement::setVariablePositions ( int  pos) const
virtual

Reimplemented from ast::stmt::Statement.

void ast::stmt::WhileStatement::toString ( std::ostream &  out,
unsigned int  indent,
bool  special = false 
) const
virtual

writes a representation of the Node to out, including all children. special invokes "special" behavior for certain nodes MethodDeclaration: print static keyword Block & If: skip indentation Expression: don't print surrounding parens in addition Block doesn't print newline after trailing } if ~indent is passed instead of indent

Implements ast::Node.

Member Data Documentation

shptr<Expression> ast::stmt::WhileStatement::condition
protected
shptr<Statement> ast::stmt::WhileStatement::statement
protected

The documentation for this class was generated from the following files: