ALib C++ Library
Library Version: 2312 R0
Documentation generated by doxygen
Public Fields | Public Methods | List of all members
CompilerPlugin::CIFunction Struct Reference

#include <compilerplugin.hpp>

Inheritance diagram for CompilerPlugin::CIFunction:
[legend]
Collaboration diagram for CompilerPlugin::CIFunction:
[legend]

Class Description


Info struct for compiling expression identifiers and functions. This struct is used with method TryCompilation(CIFunction&) to provide information to derived compiler plug-ins, as well as to receive information back.

Definition at line 227 of file compilerplugin.hpp.

Public Fields

bool AllArgsAreConst
 
List< String > & FunctionsWithNonMatchingArguments
 
AStringName
 
bool NoParentheses
 
- Public Fields inherited from CompilerPlugin::CompilationInfo
ArgIterator ArgsBegin
 
ArgIterator ArgsEnd
 
CallbackDecl Callback = nullptr
 
MonoAllocatorCompileTimeAllocator
 
ScopeCompileTimeScope
 
const ncharDbgCallbackName = nullptr
 
Box TypeOrValue = nullptr
 

Public Methods

 CIFunction (Scope &scope, MonoAllocator &compileTimeAllocator, AString &name, bool noParentheses, bool argsAreConst, List< String > &hints)
 
void AddFunctionsWithNonMatchingArguments (const String &signature)
 
BoxArg (size_t no)
 
size_t QtyArgs ()
 
- Public Methods inherited from CompilerPlugin::CompilationInfo
 CompilationInfo (Scope &scope, MonoAllocator &allocator)
 

Constructor & Destructor Documentation

◆ CIFunction()

CIFunction ( Scope scope,
MonoAllocator compileTimeAllocator,
AString name,
bool  noParentheses,
bool  argsAreConst,
List< String > &  hints 
)
inline

Constructor.

Parameters
scopePassed to parent.
compileTimeAllocatorPassed to parent.
nameStored in Name.
noParenthesesStored in NoParentheses.
argsAreConstPassed to AllArgsAreConst.
hintsStored in FunctionsWithNonMatchingArguments.

Definition at line 268 of file compilerplugin.hpp.

Member Function Documentation

◆ AddFunctionsWithNonMatchingArguments()

void AddFunctionsWithNonMatchingArguments ( const String signature)
inline

Convenience method that adds creates a monotonically allocated copy of the given string and adds it to list FunctionsWithNonMatchingArguments.

Parameters
signatureThe function signature to add.

Definition at line 307 of file compilerplugin.hpp.

Here is the call graph for this function:

◆ Arg()

Box& Arg ( size_t  no)
inline

Returns the argument number no.

Parameters
noThe number of the argument requested.
Returns
A reference to the requested argument.

Definition at line 296 of file compilerplugin.hpp.

◆ QtyArgs()

size_t QtyArgs ( )
inline

Returns the number of arguments given.

Returns
The number of arguments the function call requested.

Definition at line 286 of file compilerplugin.hpp.

Member Data Documentation

◆ AllArgsAreConst

bool AllArgsAreConst

Input: Denotes if all arguments provided are constant values. Operator callbacks that do not use context information from the scope, should calculate the then constant result and return this value instead of the callback method. (Compile-time optimization.)

Definition at line 247 of file compilerplugin.hpp.

◆ FunctionsWithNonMatchingArguments

List<String>& FunctionsWithNonMatchingArguments

A plug-in may add names of functions that matched, while the arguments did not. This will be stored in the details of a potential exception, if no other plug-in compiles this function and may be displayed to the end-user.

To add entries here, convenience method AddFunctionsWithNonMatchingArguments is provided.

Definition at line 257 of file compilerplugin.hpp.

◆ Name

AString& Name

Input: The identifier name to search.

Definition at line 232 of file compilerplugin.hpp.

◆ NoParentheses

bool NoParentheses

Input: If the function was given as a pure "identifier" this flag is true.

See also
See also flag AllowOmittingParenthesesOfParameterlessFunctions of field
See also aworx::lib::expressions::Compiler::CfgCompilation. "Compiler::CfgCompilation.".

Definition at line 240 of file compilerplugin.hpp.


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