Inferno  0.2
CPPTree::Instance Struct Reference

Declaration of a variable, object or function. More...

#include <cpptree.hpp>

Inheritance diagram for CPPTree::Instance:
[legend]
Collaboration diagram for CPPTree::Instance:
[legend]

List of all members.

Public Attributes

NODE_FUNCTIONS TreePtr
< InstanceIdentifier
identifier
 acts as a handle for the instance, and holds its name only as a hint
TreePtr< Typetype
 the Type of the instance, can be data or Callable type
TreePtr< Initialiserinitialiser
 init value for data, body for Callable type

Detailed Description

Declaration of a variable, object or function.

Instance represents a variable/object or a function. In case of function, type is a type under Callable and initialiser is a Statement (or Uninitialised for a function declaration). For a variable/object, type is basically anything else, and if there is an initialiser, it is an Expression. We allow init here for various reasons including

  • it can be hard to know where to put stand-alone init for statics
  • C++ constructors tie init to declaration
  • Fits in with single-static-assignment style The instance node can go into a Declaration Collection or a Statement Sequence. The latter case is used where initialisaiton/construction demands ordering. It points to an InstanceIdentifier, and all usages of the instance actually point to the InstanceIdentifier.

Definition at line 332 of file cpptree.hpp.


Member Data Documentation

acts as a handle for the instance, and holds its name only as a hint

Definition at line 336 of file cpptree.hpp.

init value for data, body for Callable type

Definition at line 338 of file cpptree.hpp.

the Type of the instance, can be data or Callable type

Definition at line 337 of file cpptree.hpp.


The documentation for this struct was generated from the following file: