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

#include <MethodDeclaration.hpp>

Inheritance diagram for ast::MethodDeclaration:
ast::ClassMember ast::Node ast::MainMethodDeclaration

Public Member Functions

 MethodDeclaration (shptr< TypeIdent > return_type_and_name, shptr< vec< shptr< TypeIdent >>> parameters, shptr< stmt::Block > block)
 
virtual void toString (std::ostream &out, unsigned int indent, bool special=false) const
 
virtual std::string getName () const
 
virtual std::string getNameForSort () const
 
shptr< vec< shptr< TypeIdent > > > getParameters () const
 
shptr< TypegetReturnType () const
 
virtual void collectDefinition (semantic::SemanticAnalysis &sa, shptr< semantic::symbol::SymbolTable > symbolTable, std::string const &class_name) const
 
virtual shptr< vec< shptr
< Type > > > 
collectParameters (semantic::SemanticAnalysis &sa, shptr< semantic::symbol::SymbolTable > symbolTable) const
 
virtual void analyze (semantic::SemanticAnalysis &sa, shptr< semantic::symbol::SymbolTable > symbolTable) const
 
shptr< stmt::BlockgetBlock () const
 
virtual unsigned int countVariableDeclarations () const
 
virtual void createVariablePositions () const
 
virtual std::string mangle () const
 
virtual void accept (ASTVisitor &visitor) const
 
- Public Member Functions inherited from ast::ClassMember
void setDeclaration (shptr< ClassDeclaration const > decl)
 
shptr< ClassDeclaration const > getDeclaration () const
 

Protected Attributes

shptr< TypeIdentreturn_type_and_name
 
shptr< vec< shptr< TypeIdent > > > parameters
 
shptr< stmt::Blockblock
 
- Protected Attributes inherited from ast::ClassMember
shptr< ClassDeclaration const > declaration
 

Constructor & Destructor Documentation

ast::MethodDeclaration::MethodDeclaration ( shptr< TypeIdent return_type_and_name,
shptr< vec< shptr< TypeIdent >>>  parameters,
shptr< stmt::Block block 
)

Member Function Documentation

void ast::MethodDeclaration::accept ( ASTVisitor visitor) const
virtual

Reimplemented from ast::Node.

Reimplemented in ast::MainMethodDeclaration.

void ast::MethodDeclaration::analyze ( semantic::SemanticAnalysis sa,
shptr< semantic::symbol::SymbolTable symbolTable 
) const
virtual

Implements ast::ClassMember.

Reimplemented in ast::MainMethodDeclaration.

void ast::MethodDeclaration::collectDefinition ( semantic::SemanticAnalysis sa,
shptr< semantic::symbol::SymbolTable symbolTable,
std::string const &  class_name 
) const
virtual

Implements ast::ClassMember.

Reimplemented in ast::MainMethodDeclaration.

shptr< vec< shptr< ast::Type > > > ast::MethodDeclaration::collectParameters ( semantic::SemanticAnalysis sa,
shptr< semantic::symbol::SymbolTable symbolTable 
) const
virtual

Reimplemented in ast::MainMethodDeclaration.

unsigned int ast::MethodDeclaration::countVariableDeclarations ( ) const
virtual

Reimplemented in ast::MainMethodDeclaration.

void ast::MethodDeclaration::createVariablePositions ( ) const
virtual

Reimplemented in ast::MainMethodDeclaration.

shptr< ast::stmt::Block > ast::MethodDeclaration::getBlock ( ) const
std::string ast::MethodDeclaration::getName ( ) const
virtual

Implements ast::ClassMember.

std::string ast::MethodDeclaration::getNameForSort ( ) const
virtual

Implements ast::ClassMember.

shptr< vec< shptr< ast::TypeIdent > > > ast::MethodDeclaration::getParameters ( ) const
shptr< ast::Type > ast::MethodDeclaration::getReturnType ( ) const
std::string ast::MethodDeclaration::mangle ( ) const
virtual

Mangles this methods's name using ClassMember::mangle() and appends _Mmethodname

Reimplemented from ast::ClassMember.

Reimplemented in ast::MainMethodDeclaration.

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

Reimplemented in ast::MainMethodDeclaration.

Member Data Documentation

shptr<stmt::Block> ast::MethodDeclaration::block
protected
shptr<vec<shptr<TypeIdent> > > ast::MethodDeclaration::parameters
protected
shptr<TypeIdent> ast::MethodDeclaration::return_type_and_name
protected

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