ALib C++ Library
Library Version: 2402 R1
Documentation generated by doxygen
Loading...
Searching...
No Matches
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 Types::String , the other is converted to string. The expression function returned for (optional) decompilation is "String()".
  2. If one argument is of type Types::Float and the other of type Types::Integer , the integral value is casted to floating point. The expression function returned for (optional) decompilation is "Float()".
  3. If one argument is of type Types::Float and the other of type Types::Boolean , the boolean value is casted to floating point. The expression function returned for (optional) decompilation is "Float()".
  4. If one argument is of type Types::Integer and the other of type Types::Boolean , the boolean value is casted to integer. The expression function returned for (optional) decompilation is "Integer()".
  5. If one argument is of type Types::Boolean , the other is converted to boolean using an internal callback function that simply invokes box-function FIsTrue . The expression function returned for (optional) decompilation is "Boolean()".

Definition at line 42 of file autocast.hpp.

#include <autocast.hpp>

Inheritance diagram for AutoCast:
[legend]
Collaboration diagram for AutoCast:
[legend]

Public Method Index:

ALIB_API AutoCast (Compiler &compiler)
 
virtual ~AutoCast () override
 
virtual ALIB_API bool TryCompilation (CIAutoCast &ciAutoCast) override
 
- Public Method Index: inherited from CompilerPlugin
 CompilerPlugin (const NString &name, Compiler &compiler)
 
virtual ~CompilerPlugin ()
 
virtual bool TryCompilation (CIBinaryOp &ciBinaryOp)
 
virtual bool TryCompilation (CIFunction &ciFunction)
 
virtual bool TryCompilation (CIUnaryOp &ciUnaryOp)
 

Additional Inherited Members

- Public Field Index: inherited from CompilerPlugin
CompilerCmplr
 
const NString Name
 

Constructor(s) / Destructor Details::

◆ AutoCast()

ALIB_API AutoCast ( Compiler & compiler)

Constructor.

Parameters
compilerThe compiler we will get attached to.

◆ ~AutoCast()

virtual ~AutoCast ( )
inlineoverridevirtual

Virtual destructor.

Definition at line 53 of file autocast.hpp.

Method Details:

◆ TryCompilation()

virtual ALIB_API bool 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 CompilerPlugin.


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