ALib C++ Framework
by
Library Version: 2511 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
alib::expressions::plugins::AutoCast Struct Reference

Description:

This built-in compiler plug-in of ALib Expressions, performs auto-casts only if two different types are given. In this case, the following casts are performed:

  1. If one argument is of type static Box String, the other is converted to string. The expression function returned for (optional) de-compilation is "String()".
  2. If one argument is of type static Box Float and the other of type static Box Integer, the integral value is cast to floating point. The expression function returned for (optional) de-compilation is "Float()".
  3. If one argument is of type static Box Float and the other of type static Box Boolean, the boolean value is cast to floating point. The expression function returned for (optional) de-compilation is "Float()".
  4. If one argument is of type static Box Integer and the other of type static Box Boolean, the boolean value is cast to integer. The expression function returned for (optional) de-compilation is "Integer()".
  5. If one argument is of type static Box Boolean, the other is converted to boolean using an internal callback function that simply invokes box-function FIsTrue. The expression function returned for (optional) de-compilation is "Boolean()".

Definition at line 34 of file autocast.inl.

Inheritance diagram for alib::expressions::plugins::AutoCast:
alib::expressions::CompilerPlugin alib::lang::Plugin< Compiler, CompilePriorities >

Public Method Index:

 AutoCast (Compiler &compiler)
virtual ~AutoCast () override
 Virtual destructor.
virtual bool TryCompilation (CIAutoCast &ciAutoCast) override
Public Method Index: inherited from alib::expressions::CompilerPlugin
 CompilerPlugin (const NString &name, Compiler &compiler, CompilePriorities pPriority)
virtual ~CompilerPlugin ()
 Virtual destructor.
virtual bool TryCompilation (CIBinaryOp &ciBinaryOp)
virtual bool TryCompilation (CIFunction &ciFunction)
virtual bool TryCompilation (CIUnaryOp &ciUnaryOp)
Public Method Index: inherited from alib::lang::Plugin< Compiler, CompilePriorities >
PrioritiesType GetPriority () const

Additional Inherited Members

Public Type Index: inherited from alib::lang::Plugin< Compiler, CompilePriorities >
using PluginType
 This exposes the template parameter TPlugin to the outer world.
using PrioritiesType
 This exposes the template parameter pTPlugin to the outer world.
Public Field Index: inherited from alib::expressions::CompilerPlugin
CompilerCmplr
 The compiler that this plug-in is attached to.
const NString Name
Protected Field Index: inherited from alib::lang::Plugin< Compiler, CompilePriorities >
PrioritiesType priority
 The priority of this plug-in.
Protected Method Index: inherited from alib::lang::Plugin< Compiler, CompilePriorities >
 Plugin (PrioritiesType pPriority)

Constructor(s) / Destructor Details:

◆ AutoCast()

alib::expressions::plugins::AutoCast::AutoCast ( Compiler & compiler)

Constructor.

Parameters
compilerThe compiler we will get attached to.

◆ ~AutoCast()

virtual alib::expressions::plugins::AutoCast::~AutoCast ( )
inlineoverridevirtual

Virtual destructor.

Definition at line 41 of file autocast.inl.

Method Details:

◆ TryCompilation()

virtual bool alib::expressions::plugins::AutoCast::TryCompilation ( CIAutoCast & ciAutoCast)
overridevirtual

Offers auto-cast functions for built-in types.

Parameters
[out]ciAutoCastThe compilation result.
Returns
true if an entry was found. false otherwise.

Reimplemented from alib::expressions::CompilerPlugin.


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