Gyoji Compiler
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
Gyoji::frontend::tree::AccessQualifier Class Reference

This indicates the type of access that may be permitted as UNSPECIFIED, CONST, or VOLATILE. More...

#include <tree.hpp>

Inheritance diagram for Gyoji::frontend::tree::AccessQualifier:
Inheritance graph
[legend]
Collaboration diagram for Gyoji::frontend::tree::AccessQualifier:
Collaboration graph
[legend]

Public Types

enum  AccessQualifierType { UNSPECIFIED , VOLATILE , CONST }
 

Public Member Functions

 AccessQualifier (Gyoji::owned< Terminal > _qualifier)
 
 AccessQualifier (const Gyoji::context::SourceReference &_source_ref)
 
 ~AccessQualifier ()
 
const AccessQualifier::AccessQualifierTypeget_type () const
 
- Public Member Functions inherited from Gyoji::frontend::ast::SyntaxNode
 SyntaxNode (Gyoji::context::TokenID _type, specific_type_t _data, const Gyoji::context::SourceReference &_source_ref)
 
const std::vector< std::reference_wrapper< const SyntaxNode > > & get_children () const
 
const Gyoji::context::TokenID & get_type () const
 
template<class T >
bool has_data () const
 
template<class T >
const T & get_data () const
 
const SyntaxNodeget_syntax_node () const
 
const Gyoji::context::SourceReferenceget_source_ref () const
 

Detailed Description

This indicates the type of access that may be permitted as UNSPECIFIED, CONST, or VOLATILE.

Indicates what type of access is permitted for the value. If it is marked as VOLATILE then read and write will be forced from memory rather than allowing them to be optimized out. If it is marked as CONST then the value is read-only in this context. If it is UNSPECIFIED then read/write access is un-restricted

Member Enumeration Documentation

◆ AccessQualifierType

Enumerator
UNSPECIFIED 

If not specified, the access qualifier is unspecified indicating that the variable has read/write access and the optimizer is free to skip physical memory access in order to resolve the value using registers or other calculation techniques.

VOLATILE 

Indicates that the value should be read and written to memory as specified and that the optimizer must not skip memory access. This is mainly used when memory mapped I/O is used in order to ensure that the physical memory is written to so that devices on the memory bus may observe and interact with the values.

CONST 

Indicates that write access should not be permitted in this context. This is a way to communicate with other programmers what values they may and may not alter.

Constructor & Destructor Documentation

◆ AccessQualifier() [1/2]

AccessQualifier::AccessQualifier ( Gyoji::owned< Terminal _qualifier)

Constructs an access qualifier from a parse token which will be either VOLATILE or CONST.

◆ AccessQualifier() [2/2]

AccessQualifier::AccessQualifier ( const Gyoji::context::SourceReference _source_ref)

Constructs a default access qualifier (UNSPECIFIED) if no qualifier is specified in the source file.

◆ ~AccessQualifier()

AccessQualifier::~AccessQualifier ( )

Destructor, nothing special.

Member Function Documentation

◆ get_type()

const AccessQualifier::AccessQualifierType & AccessQualifier::get_type ( ) const

Returns the access qualification type.


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