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

#include <IfStatement.hpp>

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

Public Member Functions

 IfStatement (shptr< Expression > condition, shptr< Statement > thenStatement)
 
 IfStatement (shptr< Expression > condition, shptr< Statement > thenStatement, shptr< Statement > elseStatement)
 
virtual void toString (std::ostream &out, unsigned int indent, bool special=false) const
 
virtual Statement::Type getType () 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< StatementgetThenStatement () const
 
virtual shptr< StatementgetElseStatement () const
 

Additional Inherited Members

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

Constructor & Destructor Documentation

ast::stmt::IfStatement::IfStatement ( shptr< Expression condition,
shptr< Statement thenStatement 
)
ast::stmt::IfStatement::IfStatement ( shptr< Expression condition,
shptr< Statement thenStatement,
shptr< Statement elseStatement 
)

Member Function Documentation

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

Reimplemented from ast::stmt::Statement.

bool ast::stmt::IfStatement::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::IfStatement::countVariableDeclarations ( ) const
virtual

Reimplemented from ast::stmt::Statement.

shptr< Expression > ast::stmt::IfStatement::getCondition ( ) const
virtual
shptr< Statement > ast::stmt::IfStatement::getElseStatement ( ) const
virtual
shptr< Statement > ast::stmt::IfStatement::getThenStatement ( ) const
virtual
Statement::Type ast::stmt::IfStatement::getType ( ) const
virtual

Reimplemented from ast::stmt::Statement.

int ast::stmt::IfStatement::setVariablePositions ( int  pos) const
virtual

Reimplemented from ast::stmt::Statement.

void ast::stmt::IfStatement::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.


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