AALanguage
The best language for those who have nothing to do
Loading...
Searching...
No Matches
Type Struct Reference

A class to represent an expression type. More...

#include <TableIdentifiers.h>

Public Member Functions

 Type (ExprType expr_type_, bool is_const_, bool is_array_, int array_size_=-1)
 A constructor that specifies the public fields of the type.
 
 Type ()
 Default Constructor.
 
bool operator== (const Type &other) const
 Type comparison operator.
 
bool operator!= (const Type &other) const
 Type comparison operator (not equality).
 

Public Attributes

ExprType expr_type
 Standard expression type.
 
bool is_const
 Whether the expression is constant (in case it is a variable)
 
bool is_array
 Whether the expression is an array.
 
int array_size
 The size of the array or -1 if the type is not an array.
 

Detailed Description

A class to represent an expression type.

Definition at line 28 of file TableIdentifiers.h.

Constructor & Destructor Documentation

◆ Type() [1/2]

Type::Type ( ExprType expr_type_,
bool is_const_,
bool is_array_,
int array_size_ = -1 )
inline

A constructor that specifies the public fields of the type.

Definition at line 40 of file TableIdentifiers.h.

References array_size, expr_type, is_array, and is_const.

◆ Type() [2/2]

Type::Type ( )
inline

Default Constructor.

Sets:

  • expr_type = Unknown
  • is_const = is_array = false
  • array_size = -1.

Definition at line 54 of file TableIdentifiers.h.

References array_size, expr_type, is_array, is_const, and Unknown.

Member Function Documentation

◆ operator!=()

bool Type::operator!= ( const Type & other) const
inline

Type comparison operator (not equality).

Compares all public attributes.

Parameters
otherAnother type to compare.

Definition at line 76 of file TableIdentifiers.h.

◆ operator==()

bool Type::operator== ( const Type & other) const
inline

Type comparison operator.

Compares all public attributes.

Parameters
otherAnother type to compare.

Definition at line 66 of file TableIdentifiers.h.

References array_size, expr_type, is_array, and is_const.

Member Data Documentation

◆ array_size

int Type::array_size

The size of the array or -1 if the type is not an array.

Definition at line 36 of file TableIdentifiers.h.

Referenced by Analyzer::function(), Semantic::is_convertible(), operator==(), Type(), Type(), and Semantic::type_to_string().

◆ expr_type

◆ is_array

bool Type::is_array

Whether the expression is an array.

Definition at line 34 of file TableIdentifiers.h.

Referenced by Analyzer::field(), Analyzer::function(), Semantic::is_convertible(), operator==(), Type(), Type(), and Semantic::type_to_string().

◆ is_const

bool Type::is_const

Whether the expression is constant (in case it is a variable)

Definition at line 32 of file TableIdentifiers.h.

Referenced by operator==(), Type(), and Type().


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