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

Program execution starter. More...

#include <starter.hpp>

Inheritance diagram for by::starter:
by::tworker< str, node >

Public Types

enum  logFlag3 { LOG_STRUCTURE = 1 << 7 , LOG_GRAPH_ON_EX = 1 << 8 }
 
- Public Types inherited from by::tworker< str, node >
enum  logFlag
 

Public Member Functions

void setArgs (const args &a)
 
void setArgs (const args *it) BY_SIDE_FUNC(setArgs)
 
argsgetArgs ()
 
const args &getArgs() const BY_CONST_FUNC(getArgs()) protected void _prepare () override
 Protected virtual method for preparation before starting the work.
 
- Public Member Functions inherited from by::tworker< str, node >
 tworker (const errReport &rpt)
 
errReportgetReport ()
 
const errReportgetReport () const BY_CONST_FUNC(getReport()) me &setReport(errReport &rpt)
 
me & setFlag (nint newFlag)
 
me & addFlag (nint flag)
 
me & delFlag (nint clear)
 
nbool isFlag (nint flag) const
 
nint getFlag () const
 
me & setTask (const node &root)
 
me & setTask (const node *it) BY_SIDE_FUNC(it
 
nodegetTask ()
 
const nodegetTask () const BY_CONST_FUNC(getTask()) virtual void rel()
 
str work ()
 
const areagetArea () const BY_CONST_FUNC(_getArea()) nbool isOk() const
 

Static Public Attributes

static const std::string MAIN = "main"
 

Additional Inherited Members

- Public Attributes inherited from by::tworker< str, node >
me setTask it
 
me setTask * this
 
- Protected Member Functions inherited from by::tworker< str, node >
void _report (baseErr *e)
 
virtual void _onEndWork ()
 Protected virtual method called after the work is completed.
 
virtual str _onWork ()=0
 
area_getArea ()
 
void _onEndErrReport (const errReport &rpt) const
 

Detailed Description

Program execution starter.

A kind of worker that executes AST verified by verifier. If an exception occurs in is required to run an autopod during execution, it dumps logs and returns the exception. See worker for more details if unfamiliar with the worker concept.

Main Function Look Up

The main function must meet the following conditions:

  1. Found directly under root (pod)
  2. Name must be main
  3. Return type must be void or int
  4. Main function must have 1 or more statements

Usage Example

Can be used with interpreter to parse and execute byeol code.

ip.work();
if(!ip.isVerified()) return -1;
str res = starter().setTask(ip.getSubPod()).work();
if(res)
if(res->isSub<nInt>()) return *res->cast<nInt>();
return -1;
High-level interpreter for byeol language.
Definition interpreter.hpp:35
Integer primitive type in byeol language.
Definition nInt.hpp:13
Program execution starter.
Definition starter.hpp:39
Definition tnarr.hpp:9

Member Function Documentation

◆ _prepare()

const args &getArgs() const BY_CONST_FUNC(getArgs()) protected void by::starter::_prepare ( )
overridevirtual

Protected virtual method for preparation before starting the work.

This hook allows derived classes to perform any necessary setup or initialization before _onWork() is invoked.

Reimplemented from by::tworker< str, node >.


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