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::LVDStatement Class Reference

#include <LVDStatement.hpp>

Inheritance diagram for ast::stmt::LVDStatement:
ast::stmt::Statement ast::VariableDeclaration ast::Node

Public Member Functions

 LVDStatement (shptr< TypeIdent > type_ident)
 
 LVDStatement (shptr< TypeIdent > type_ident, shptr< Expression > init_expr)
 
virtual void toString (std::ostream &out, unsigned int indent, bool=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...
 
shptr< IdentgetIdent () const
 
virtual unsigned int countVariableDeclarations () const
 
virtual int setVariablePositions (int) const
 
virtual void accept (ASTVisitor &visitor) const
 
virtual shptr< ast::Type > const & getDeclType () const
 
shptr< ast::Expression > const & getInitialization () const
 
- Public Member Functions inherited from ast::stmt::Statement
virtual Type getType () const
 

Protected Attributes

shptr< TypeIdenttype_ident
 
shptr< Expressioninit_expr
 

Additional Inherited Members

- Public Types inherited from ast::stmt::Statement
enum  Type { TYPE_SINGLE, TYPE_BLOCK, TYPE_IF }
 
- Protected Member Functions inherited from ast::VariableDeclaration
 VariableDeclaration ()
 

Constructor & Destructor Documentation

ast::stmt::LVDStatement::LVDStatement ( shptr< TypeIdent type_ident)
ast::stmt::LVDStatement::LVDStatement ( shptr< TypeIdent type_ident,
shptr< Expression init_expr 
)

Member Function Documentation

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

Reimplemented from ast::stmt::Statement.

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

Reimplemented from ast::stmt::Statement.

shptr< ast::Type > const & ast::stmt::LVDStatement::getDeclType ( ) const
virtual
shptr< ast::Ident > ast::stmt::LVDStatement::getIdent ( ) const
shptr< ast::Expression > const & ast::stmt::LVDStatement::getInitialization ( ) const
int ast::stmt::LVDStatement::setVariablePositions ( int  pos) const
virtual

Reimplemented from ast::stmt::Statement.

void ast::stmt::LVDStatement::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::LVDStatement::init_expr
protected
shptr<TypeIdent> ast::stmt::LVDStatement::type_ident
protected

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