Skip to content

Address

INCLUDE FILE
#include "Address.h"

class Address

Represents an address, consisting of a bank and an address within that bank. The bank defaults to 0.

DEFINITION
class Address;

class Componentprivate

DEFINITION
class Component;

constructor Component

DEFINITION
Component ( Symbol  name,
Expression  expression );
PARAMETERDESCRIPTION
name
expression

constructor Component

DEFINITION
Component ( Symbol  name,
uint64_t  value );
PARAMETERDESCRIPTION
name
value

method evaluate

DEFINITION
void  evaluate ( const EvaluationContext & context );
PARAMETERDESCRIPTION
context

method evaluate_process

DEFINITION
void  evaluate_process ( );

method has_valueconst

DEFINITION
bool  has_value ( ) const;
RETURNSDESCRIPTION
bool

method is_equalconst

DEFINITION
std::optional< bool >  is_equal ( const Component & other ) const;
PARAMETERDESCRIPTION
other
RETURNSDESCRIPTION
std::optional< bool >

method is_less_thanconst

DEFINITION
std::optional< bool >  is_less_than ( const Component & other ) const;
PARAMETERDESCRIPTION
other
RETURNSDESCRIPTION
std::optional< bool >

method is_not_equalconst

DEFINITION
std::optional< bool >  is_not_equal ( const Component & other ) const;
PARAMETERDESCRIPTION
other
RETURNSDESCRIPTION
std::optional< bool >

method maximumconst

DEFINITION
std::optional< uint64_t >  maximum ( ) const;
RETURNSDESCRIPTION
std::optional< uint64_t >

method minimumconst

DEFINITION
std::optional< uint64_t >  minimum ( ) const;
RETURNSDESCRIPTION
std::optional< uint64_t >

method resolve

DEFINITION
void  resolve ( Scope * scope,
Entity * containing_entity );
PARAMETERDESCRIPTION
scope
containing_entity

method serializeconst

DEFINITION
void  serialize ( std::ostream & stream,
bool  output_if_zero = true ) const;
PARAMETERDESCRIPTION
stream
output_if_zero

method traverse

DEFINITION
void  traverse ( std::function< void(Expression &)>  expression_callback );
PARAMETERDESCRIPTION
expression_callback

method valueconst

DEFINITION
std::optional< uint64_t >  value ( ) const;
RETURNSDESCRIPTION
std::optional< uint64_t >

member component_valueprivate

DEFINITION
std::variant< Expression, uint64_t >  component_value;

member nameprivate

DEFINITION
Symbol  name;

constructor Address

Constructs an address with the given address and a default bank of 0.

DEFINITION
Address ( uint64_t  address );
PARAMETERDESCRIPTION
address

The address within the bank.

constructor Address

Constructs an address with the given address.

DEFINITION
Address ( Expression  address );
PARAMETERDESCRIPTION
address

The expression representing the address within the bank.

constructor Address

Constructs an address with the given bank and address.

DEFINITION
Address ( uint64_t  bank,
uint64_t  address );
PARAMETERDESCRIPTION
bank

The bank of the address.

address

The address within the bank.

constructor Address

Constructs an address with the given bank and address.

DEFINITION
Address ( Expression  bank,
Expression  address );
PARAMETERDESCRIPTION
bank

The expression representing the bank of the address.

address

The expression representing the address within the bank.

constructor Address

Constructs an address by parsing an expression from a tokenizer.

DEFINITION
Address ( Tokenizer & tokenizer );
PARAMETERDESCRIPTION
tokenizer

The tokenizer to parse the expression from.

method addressconst

Get the address within the bank.

DEFINITION
std::optional< uint64_t >  address ( ) const;
RETURNSDESCRIPTION
std::optional< uint64_t >

The address within the bank, if known.

method address_maximumconst

Get the maximum possible value of the address within the bank.

DEFINITION
std::optional< uint64_t >  address_maximum ( ) const;
RETURNSDESCRIPTION
std::optional< uint64_t >

The maximum possible value of the address within the bank, if known.

method address_minimumconst

Get the minimum possible value of the address within the bank.

DEFINITION
std::optional< uint64_t >  address_minimum ( ) const;
RETURNSDESCRIPTION
std::optional< uint64_t >

The minimum possible value of the address within the bank, if known.

method bankconst

Get the bank of the address.

DEFINITION
std::optional< uint64_t >  bank ( ) const;
RETURNSDESCRIPTION
std::optional< uint64_t >

The bank of the address, if known.

method bank_maximumconst

Get the maximum possible value of the bank.

DEFINITION
std::optional< uint64_t >  bank_maximum ( ) const;
RETURNSDESCRIPTION
std::optional< uint64_t >

The maximum possible value of the bank, if known.

method bank_minimumconst

Get the minimum possible value of the bank.

DEFINITION
std::optional< uint64_t >  bank_minimum ( ) const;
RETURNSDESCRIPTION
std::optional< uint64_t >

The minimum possible value of the bank, if known.

method evaluate

Evaluate the expressions.

DEFINITION
void  evaluate ( const EvaluationContext & context );
PARAMETERDESCRIPTION
context

The evaluation context.

method evaluate_processprivate

Set values from expressions.

DEFINITION
void  evaluate_process ( );

method has_addressconst

Check if the address within the bank is known.

DEFINITION
bool  has_address ( ) const;
RETURNSDESCRIPTION
bool

true if the address within the bank is known, false otherwise.

method has_bankconst

Check if the bank is known.

DEFINITION
bool  has_bank ( ) const;
RETURNSDESCRIPTION
bool

true if the bank is known, false otherwise.

method has_valueconst

Check if both the bank and the address within the bank are known.

DEFINITION
bool  has_value ( ) const;
RETURNSDESCRIPTION
bool

true if both the bank and the address within the bank are known, false otherwise.

method operator<const

DEFINITION
bool  operator< ( const Address & other ) const;
PARAMETERDESCRIPTION
other
RETURNSDESCRIPTION
bool

method operator==const

DEFINITION
bool  operator== ( const Address & other ) const;
PARAMETERDESCRIPTION
other
RETURNSDESCRIPTION
bool

method resolve

Resolve names in the expressions.

DEFINITION
void  resolve ( Scope * scope,
Entity * containing_entity );
PARAMETERDESCRIPTION
scope

The scope to resolve names in.

containing_entity

The entity containing the address.

method serializeconst

Serializes the address to a stream. The format is address if the bank is 0, and bank:address otherwise.

DEFINITION
void  serialize ( std::ostream & stream ) const;
PARAMETERDESCRIPTION
stream

method traverse

DEFINITION
void  traverse ( std::function< void(Expression &)>  expression_callback );
PARAMETERDESCRIPTION
expression_callback

member address_componentprivate

The address within the bank.

DEFINITION
Component  address_component;

member address_namestatic private

DEFINITION
static Symbol  address_name;

member bank_componentprivate

The bank of the address.

DEFINITION
Component  bank_component;

member bank_namestatic private

DEFINITION
static Symbol  bank_name;

class Componentprivate

DEFINITION
class Component;

constructor Component

DEFINITION
Component ( Symbol  name,
Expression  expression );
PARAMETERDESCRIPTION
name
expression

constructor Component

DEFINITION
Component ( Symbol  name,
uint64_t  value );
PARAMETERDESCRIPTION
name
value

method evaluate

DEFINITION
void  evaluate ( const EvaluationContext & context );
PARAMETERDESCRIPTION
context

method evaluate_process

DEFINITION
void  evaluate_process ( );

method has_valueconst

DEFINITION
bool  has_value ( ) const;
RETURNSDESCRIPTION
bool

method is_equalconst

DEFINITION
std::optional< bool >  is_equal ( const Component & other ) const;
PARAMETERDESCRIPTION
other
RETURNSDESCRIPTION
std::optional< bool >

method is_less_thanconst

DEFINITION
std::optional< bool >  is_less_than ( const Component & other ) const;
PARAMETERDESCRIPTION
other
RETURNSDESCRIPTION
std::optional< bool >

method is_not_equalconst

DEFINITION
std::optional< bool >  is_not_equal ( const Component & other ) const;
PARAMETERDESCRIPTION
other
RETURNSDESCRIPTION
std::optional< bool >

method maximumconst

DEFINITION
std::optional< uint64_t >  maximum ( ) const;
RETURNSDESCRIPTION
std::optional< uint64_t >

method minimumconst

DEFINITION
std::optional< uint64_t >  minimum ( ) const;
RETURNSDESCRIPTION
std::optional< uint64_t >

method resolve

DEFINITION
void  resolve ( Scope * scope,
Entity * containing_entity );
PARAMETERDESCRIPTION
scope
containing_entity

method serializeconst

DEFINITION
void  serialize ( std::ostream & stream,
bool  output_if_zero = true ) const;
PARAMETERDESCRIPTION
stream
output_if_zero

method traverse

DEFINITION
void  traverse ( std::function< void(Expression &)>  expression_callback );
PARAMETERDESCRIPTION
expression_callback

method valueconst

DEFINITION
std::optional< uint64_t >  value ( ) const;
RETURNSDESCRIPTION
std::optional< uint64_t >

member component_valueprivate

DEFINITION
std::variant< Expression, uint64_t >  component_value;

member nameprivate

DEFINITION
Symbol  name;

class formatter< Address >

DEFINITION
class formatter< Address >;

method formatconst

DEFINITION
auto  format ( const Address & address,
std::format_context & ctx ) const;
PARAMETERDESCRIPTION
address
ctx
RETURNSDESCRIPTION
auto