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

#include <Type.hpp>

Inheritance diagram for ast::Type:
ast::Node

Public Types

enum  Primitive_type {
  NONE, INT, BOOLEAN, VOID,
  INT_NEG_ONLY, NULL_TYPE
}
 

Public Member Functions

 Type (Type::Primitive_type primitive_type)
 
 Type (shptr< Ident > class_name)
 
 Type (Type::Primitive_type primitive_type, int dimension)
 
 Type (shptr< Ident > class_name, int dimension)
 
virtual void toString (std::ostream &out, unsigned int indent, shptr< Expression > const &expression, bool=false) const
 
virtual void toString (std::ostream &out, unsigned int indent, bool=false) const
 
bool operator== (Type const &other) const
 
bool operator!= (Type const &other) const
 
bool operator< (Type const &other) const
 
bool isRefType (bool checkNullType=false)
 
bool isClassType ()
 
bool isInteger ()
 
bool isAnyInteger ()
 
bool isBool ()
 
bool isVoid ()
 
bool isArray ()
 
shptr< Typede_array ()
 
void setDimension (int dimension)
 
Primitive_type getPrimitiveType () const
 
std::string const & getClassName () const
 
shptr< ast::Ident > const & getClassNameIdent () const
 
std::string getName () const
 
int getDimension () const
 
virtual void accept (ASTVisitor &visitor) const
 
bool isSpecialType () const
 

Friends

struct std::hash< shptr< Type > >
 

Member Enumeration Documentation

Enumerator
NONE 
INT 
BOOLEAN 
VOID 
INT_NEG_ONLY 
NULL_TYPE 

Constructor & Destructor Documentation

ast::Type::Type ( Type::Primitive_type  primitive_type)
ast::Type::Type ( shptr< Ident class_name)
ast::Type::Type ( Type::Primitive_type  primitive_type,
int  dimension 
)
ast::Type::Type ( shptr< Ident class_name,
int  dimension 
)

Member Function Documentation

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

Reimplemented from ast::Node.

shptr< ast::Type > ast::Type::de_array ( )
std::string const & ast::Type::getClassName ( ) const
shptr< ast::Ident > const & ast::Type::getClassNameIdent ( ) const
int ast::Type::getDimension ( ) const
std::string ast::Type::getName ( ) const
ast::Type::Primitive_type ast::Type::getPrimitiveType ( ) const
bool ast::Type::isAnyInteger ( )
bool ast::Type::isArray ( )
bool ast::Type::isBool ( )
bool ast::Type::isClassType ( )
bool ast::Type::isInteger ( )
bool ast::Type::isRefType ( bool  checkNullType = false)
bool ast::Type::isSpecialType ( ) const

returns whether this type is $System or $out

bool ast::Type::isVoid ( )
bool ast::Type::operator!= ( Type const &  other) const
bool ast::Type::operator< ( Type const &  other) const
bool ast::Type::operator== ( Type const &  other) const
void ast::Type::setDimension ( int  dimension)
void ast::Type::toString ( std::ostream &  out,
unsigned int  indent,
shptr< Expression > const &  expression,
bool  = false 
) const
virtual
void ast::Type::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.

Friends And Related Function Documentation

friend struct std::hash< shptr< Type > >
friend

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