Loading...
Searching...
No Matches
by::exprMaker Class Reference

Factory for creating expressions with source location information. More...

#include <exprMaker.hpp>

Inheritance diagram for by::exprMaker:

Public Member Functions

 exprMaker (const srcFile &s, ncnt row, ncnt col)
 
me & addRow ()
 
me & addRow (ncnt step)
 
me & addCol ()
 
me & addCol (ncnt step)
 
me & setRow (ncnt row)
 
me & setCol (ncnt col)
 
me & setSrcFile (const srcFile &s)
 
void rel ()
 
const pointgetPos () const
 
const srcFilegetSrcFile () const
 
tstr< srcmakeSrc (const std::string &name) const
 
template<typename T , typename... Args>
T * birth (const std::string &name, const Args &... args) const
 
template<typename T , typename... Args>
T * make (const Args &... args) const
 Creates a new expression object without a specific name and sets its source location.
 
funcmakeExpandFunc (const defBlock &blk) const
 Creates a function specifically for handling "expand" logic within definition blocks.
 
assignExprmakeAssignExprFrom (const defVarExpr &e) const
 Creates an assignment expression from a variable definition expression.
 
funcmakeCommonFunc (const defBlock &blk) const
 Creates a "common" function associated with a definition block.
 

Detailed Description

Factory for creating expressions with source location information.

Creates expression objects with proper source file and position metadata. Used by parser to track source locations for debugging and error reporting.

Member Function Documentation

◆ birth()

template<typename T , typename... Args>
T * by::exprMaker::birth ( const std::string & name,
const Args &... args ) const
inline
Note
when you birth your child, you must name it.

◆ make()

template<typename T , typename... Args>
T * by::exprMaker::make ( const Args &... args) const
inline

Creates a new expression object without a specific name and sets its source location.

Template Parameters
TThe type of the expression to create.
ArgsThe types of the constructor arguments for T.
Parameters
argsThe constructor arguments for T.
Returns
A pointer to the newly created expression object.

◆ makeAssignExprFrom()

assignExpr * by::exprMaker::makeAssignExprFrom ( const defVarExpr & e) const

Creates an assignment expression from a variable definition expression.

Parameters
eThe variable definition expression (defVarExpr) to derive the assignment from.
Returns
A pointer to the newly created assignExpr object.

◆ makeCommonFunc()

func * by::exprMaker::makeCommonFunc ( const defBlock & blk) const

Creates a "common" function associated with a definition block.

Parameters
blkThe definition block for which the common function is being created.
Returns
A pointer to the newly created func object.

◆ makeExpandFunc()

func * by::exprMaker::makeExpandFunc ( const defBlock & blk) const

Creates a function specifically for handling "expand" logic within definition blocks.

Parameters
blkThe definition block associated with the expand function.
Returns
A pointer to the newly created func object.

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