docc 0.8.3 (0d44999b)
C++ API Reference
Loading...
Searching...
No Matches
sdfg::codegen::LanguageExtension Class Referenceabstract

#include <sdfg/codegen/language_extension.h>

Inheritance diagram for sdfg::codegen::LanguageExtension:
[legend]

Public Member Functions

 LanguageExtension (sdfg::Function &function, const std::string &external_prefix)
virtual ~LanguageExtension ()=default
const std::string & external_prefix () const
virtual const std::string language () const =0
virtual std::string primitive_type (const types::PrimitiveType prim_type)=0
virtual std::string declaration (const std::string &name, const types::IType &type, bool use_initializer=false, bool use_alignment=false)=0
virtual std::string type_cast (const std::string &name, const types::IType &type)=0
virtual std::string subset (const types::IType &type, const data_flow::Subset &subset)=0
virtual std::string expression (const symbolic::Expression expr)=0
virtual std::string access_node (const data_flow::AccessNode &node)=0
virtual std::string tasklet (const data_flow::Tasklet &tasklet)=0
virtual std::string zero (const types::PrimitiveType prim_type)=0
virtual std::string comment (const std::string &text)=0
virtual std::string assignment (const std::string &lhs, const std::string &rhs)=0
virtual std::string local_declaration (const std::string &name, const types::IType &type, const std::string &init="")=0
 Declares a local, initialized if init is non-empty. Empty if the language needs no declaration.
virtual std::string copy_bytes (const std::string &dst, const std::string &src, const std::string &size)=0
virtual std::string break_statement ()=0
virtual std::string continue_statement ()=0
virtual std::string return_statement (const std::string &value)=0
virtual void deallocation (PrettyPrinter &stream, const std::string &container, const types::IType &type)=0
 Emits the release of a container the function owns, if its storage requires one.
virtual std::string null_literal ()=0
virtual std::string address_of (const std::string &expr)=0
virtual std::string dereference (const std::string &expr)=0
virtual std::string size_of (const std::string &expr)=0
virtual std::string reinterpret_cast_expr (const std::string &expr, const std::string &type)=0
virtual Body begin_for (PrettyPrinter &stream, const structured_control_flow::StructuredLoop &loop, const LoopHints &hints)=0
virtual Body begin_while (PrettyPrinter &stream)=0
 An unconditional loop, left only through break or return.
virtual Body begin_branch (PrettyPrinter &stream, size_t index, size_t count, const symbolic::Condition &condition)=0
 Branch index of count branches of a conditional, guarded by condition.
virtual Body begin_scope (PrettyPrinter &stream)=0
virtual void end (PrettyPrinter &stream, const Body &body)=0

Protected Attributes

sdfg::Function & function_
std::string external_prefix_

Constructor & Destructor Documentation

◆ LanguageExtension()

sdfg::codegen::LanguageExtension::LanguageExtension ( sdfg::Function & function,
const std::string & external_prefix )
inline

◆ ~LanguageExtension()

virtual sdfg::codegen::LanguageExtension::~LanguageExtension ( )
virtualdefault

Member Function Documentation

◆ access_node()

virtual std::string sdfg::codegen::LanguageExtension::access_node ( const data_flow::AccessNode & node)
pure virtual

◆ address_of()

virtual std::string sdfg::codegen::LanguageExtension::address_of ( const std::string & expr)
pure virtual

◆ assignment()

virtual std::string sdfg::codegen::LanguageExtension::assignment ( const std::string & lhs,
const std::string & rhs )
pure virtual

◆ begin_branch()

virtual Body sdfg::codegen::LanguageExtension::begin_branch ( PrettyPrinter & stream,
size_t index,
size_t count,
const symbolic::Condition & condition )
pure virtual

Branch index of count branches of a conditional, guarded by condition.

Implemented in sdfg::codegen::CStyleLanguageExtension.

◆ begin_for()

virtual Body sdfg::codegen::LanguageExtension::begin_for ( PrettyPrinter & stream,
const structured_control_flow::StructuredLoop & loop,
const LoopHints & hints )
pure virtual

◆ begin_scope()

virtual Body sdfg::codegen::LanguageExtension::begin_scope ( PrettyPrinter & stream)
pure virtual

◆ begin_while()

virtual Body sdfg::codegen::LanguageExtension::begin_while ( PrettyPrinter & stream)
pure virtual

An unconditional loop, left only through break or return.

Implemented in sdfg::codegen::CStyleLanguageExtension.

◆ break_statement()

virtual std::string sdfg::codegen::LanguageExtension::break_statement ( )
pure virtual

◆ comment()

virtual std::string sdfg::codegen::LanguageExtension::comment ( const std::string & text)
pure virtual

◆ continue_statement()

virtual std::string sdfg::codegen::LanguageExtension::continue_statement ( )
pure virtual

◆ copy_bytes()

virtual std::string sdfg::codegen::LanguageExtension::copy_bytes ( const std::string & dst,
const std::string & src,
const std::string & size )
pure virtual

◆ deallocation()

virtual void sdfg::codegen::LanguageExtension::deallocation ( PrettyPrinter & stream,
const std::string & container,
const types::IType & type )
pure virtual

Emits the release of a container the function owns, if its storage requires one.

Implemented in sdfg::codegen::CStyleLanguageExtension.

◆ declaration()

virtual std::string sdfg::codegen::LanguageExtension::declaration ( const std::string & name,
const types::IType & type,
bool use_initializer = false,
bool use_alignment = false )
pure virtual

◆ dereference()

virtual std::string sdfg::codegen::LanguageExtension::dereference ( const std::string & expr)
pure virtual

◆ end()

virtual void sdfg::codegen::LanguageExtension::end ( PrettyPrinter & stream,
const Body & body )
pure virtual

◆ expression()

virtual std::string sdfg::codegen::LanguageExtension::expression ( const symbolic::Expression expr)
pure virtual

◆ external_prefix()

const std::string & sdfg::codegen::LanguageExtension::external_prefix ( ) const
inline

◆ language()

virtual const std::string sdfg::codegen::LanguageExtension::language ( ) const
pure virtual

◆ local_declaration()

virtual std::string sdfg::codegen::LanguageExtension::local_declaration ( const std::string & name,
const types::IType & type,
const std::string & init = "" )
pure virtual

Declares a local, initialized if init is non-empty. Empty if the language needs no declaration.

Implemented in sdfg::codegen::CStyleLanguageExtension.

◆ null_literal()

virtual std::string sdfg::codegen::LanguageExtension::null_literal ( )
pure virtual

◆ primitive_type()

virtual std::string sdfg::codegen::LanguageExtension::primitive_type ( const types::PrimitiveType prim_type)
pure virtual

◆ reinterpret_cast_expr()

virtual std::string sdfg::codegen::LanguageExtension::reinterpret_cast_expr ( const std::string & expr,
const std::string & type )
pure virtual

◆ return_statement()

virtual std::string sdfg::codegen::LanguageExtension::return_statement ( const std::string & value)
pure virtual

◆ size_of()

virtual std::string sdfg::codegen::LanguageExtension::size_of ( const std::string & expr)
pure virtual

◆ subset()

virtual std::string sdfg::codegen::LanguageExtension::subset ( const types::IType & type,
const data_flow::Subset & subset )
pure virtual

◆ tasklet()

virtual std::string sdfg::codegen::LanguageExtension::tasklet ( const data_flow::Tasklet & tasklet)
pure virtual

◆ type_cast()

virtual std::string sdfg::codegen::LanguageExtension::type_cast ( const std::string & name,
const types::IType & type )
pure virtual

◆ zero()

virtual std::string sdfg::codegen::LanguageExtension::zero ( const types::PrimitiveType prim_type)
pure virtual

Member Data Documentation

◆ external_prefix_

std::string sdfg::codegen::LanguageExtension::external_prefix_
protected

◆ function_

sdfg::Function& sdfg::codegen::LanguageExtension::function_
protected

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