Skip to content

RepeatBody

INCLUDE FILE
#include "Body/RepeatBody.h"

class RepeatBody

Abstract base class for a body that repeats a block of code a specified number of times.

DEFINITION
class RepeatBody;

class RepeatRange

DEFINITION
class RepeatRange;

constructor RepeatRange

DEFINITION
RepeatRange ( Expression  start,
Expression  end );
PARAMETERDESCRIPTION
start
end

method cloneconst

DEFINITION
RepeatRange  clone ( const CloneContext & context ) const;
PARAMETERDESCRIPTION
context
RETURNSDESCRIPTION
RepeatRange

method countconst

DEFINITION
std::optional< uint64_t >  count ( ) const;
RETURNSDESCRIPTION
std::optional< uint64_t >

method count_rangeconst

DEFINITION
SizeRange  count_range ( ) const;
RETURNSDESCRIPTION
SizeRange

member end

DEFINITION
Expression  end;

member location

DEFINITION
Location  location;

member start

DEFINITION
Expression  start;

constructor RepeatBody

DEFINITION
RepeatBody ( RepeatRange  range,
Body  body );
PARAMETERDESCRIPTION
range
body

method traversevirtual protected

Traverse the BodyElement.

This function is used by the default implementations of resolve() and expand_calls(). Unless a subclass overrides both of these methods, it should override traverse().

DEFINITION
virtual void  traverse ( std::function< void(Body &)>  body_callable,
std::function< void(Expression &)>  expression_callable );
PARAMETERDESCRIPTION
body_callable

A callable to apply to each sub-body-element.

expression_callable

A callable to apply to each sub-expression.

member bodyprotected

DEFINITION
Body  body;

member rangeprotected

DEFINITION
RepeatRange  range;

class RepeatRange

DEFINITION
class RepeatRange;

constructor RepeatRange

DEFINITION
RepeatRange ( Expression  start,
Expression  end );
PARAMETERDESCRIPTION
start
end

method cloneconst

DEFINITION
RepeatRange  clone ( const CloneContext & context ) const;
PARAMETERDESCRIPTION
context
RETURNSDESCRIPTION
RepeatRange

method countconst

DEFINITION
std::optional< uint64_t >  count ( ) const;
RETURNSDESCRIPTION
std::optional< uint64_t >

method count_rangeconst

DEFINITION
SizeRange  count_range ( ) const;
RETURNSDESCRIPTION
SizeRange

member end

DEFINITION
Expression  end;

member location

DEFINITION
Location  location;

member start

DEFINITION
Expression  start;