MXVM 1.8.1
Virtual Machine, Compiler, and Pascal Frontend
Loading...
Searching...
No Matches
pascal::StringFunctionHandler Class Reference

Built-in handler for string library functions (length, copy, concat, etc.). More...

#include <icode.hpp>

Inheritance diagram for pascal::StringFunctionHandler:

Private Member Functions

bool canHandle (const std::string &funcName) const override
 Return true if this handler implements funcName.
void generate (CodeGenVisitor &visitor, const std::string &funcName, const std::vector< std::unique_ptr< ASTNode > > &arguments) override
 Emit code for a procedure-style call (no return value used).
bool generateWithResult (CodeGenVisitor &visitor, const std::string &funcName, const std::vector< std::unique_ptr< ASTNode > > &arguments) override
 Emit code for a function-style call (result pushed on eval stack); return true if handled.
VarType getReturnType (const std::string &funcName) const override
 Return the VarType produced by funcName.

Additional Inherited Members

Public Member Functions inherited from pascal::BuiltinFunctionHandler
virtual ~BuiltinFunctionHandler ()=default

Detailed Description

Built-in handler for string library functions (length, copy, concat, etc.).

Definition at line 147 of file icode.hpp.

Member Function Documentation

◆ canHandle()

bool pascal::StringFunctionHandler::canHandle ( const std::string & funcName) const
overrideprivatevirtual

Return true if this handler implements funcName.

Implements pascal::BuiltinFunctionHandler.

Definition at line 897 of file icode_imp.cpp.

References pascal::toLower().

◆ generate()

void pascal::StringFunctionHandler::generate ( CodeGenVisitor & visitor,
const std::string & funcName,
const std::vector< std::unique_ptr< ASTNode > > & arguments )
overrideprivatevirtual

Emit code for a procedure-style call (no return value used).

Implements pascal::BuiltinFunctionHandler.

Definition at line 912 of file icode_imp.cpp.

References generateWithResult().

◆ generateWithResult()

bool pascal::StringFunctionHandler::generateWithResult ( CodeGenVisitor & visitor,
const std::string & funcName,
const std::vector< std::unique_ptr< ASTNode > > & arguments )
overrideprivatevirtual

◆ getReturnType()

VarType pascal::StringFunctionHandler::getReturnType ( const std::string & funcName) const
overrideprivatevirtual

Return the VarType produced by funcName.

Reimplemented from pascal::BuiltinFunctionHandler.

Definition at line 903 of file icode_imp.cpp.

References pascal::INT, pascal::PTR, pascal::toLower(), and pascal::UNKNOWN.


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