BenchGen
BenchGen is a tool for generating benchmarks to stress-test a computing system.
Loading...
Searching...
No Matches
ast.h File Reference
#include <cmath>
#include "../generator/generator.h"
#include "../shared/enums.h"
#include "../shared/globalStructs.h"
Include dependency graph for ast.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Node
 Base class for all nodes in the abstract syntax tree (AST). More...
 
class  StatementCode
 Represents a block of statements in the AST. More...
 
class  LambdaCode
 Represents a lambda expression in the AST. More...
 
class  Id
 Represents an identifier in the AST. More...
 
class  Insert
 Represents an insert operation in the AST. More...
 
class  Remove
 Represents a remove operation in the AST. More...
 
class  New
 Represents a new variable creation in the AST. More...
 
class  Contains
 Represents a contains operation in the AST. More...
 
class  Loop
 Represents a loop in the AST. More...
 
class  Call
 Represents a function call in the AST. More...
 
class  Seq
 Represents a sequence of operations in the AST. More...
 
class  If
 Represents an if statement in the AST. More...
 
class  IfParam
 Represents the parameters of an if statement in the AST. More...
 
class  CodeElse
 Represents an else clause with a code block in the AST. More...
 

Functions

void printIndentationSpaces (int indent)
 Prints a specified number of indentation spaces.
 
std::string generateIfCondition (Generator &generator)
 Generates a condition string for an if statement.
 

Function Documentation

◆ generateIfCondition()

std::string generateIfCondition ( Generator & generator)

Generates a condition string for an if statement.

Generates a condition based on the generator's current context, either returning a random condition or a condition based on PATH variables.

Parameters
generatorThe generator object used to track the current state of code generation.
Returns
A string representing the generated condition.

◆ printIndentationSpaces()

void printIndentationSpaces ( int indent)

Prints a specified number of indentation spaces.

Used for formatting output to visualize the structure of the AST.

Parameters
indentThe number of spaces to print.