Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
ASTNode Struct Reference

#include <ored/scripting/ast.hpp>

+ Inheritance diagram for ASTNode:
+ Collaboration diagram for ASTNode:

Public Member Functions

 ASTNode ()
 
virtual ~ASTNode ()
 
 ASTNode (const std::vector< ASTNodePtr > &args, const Size minArgs, const Size maxArgs=Null< Size >())
 
virtual void accept (AcyclicVisitor &)
 

Public Attributes

LocationInfo locationInfo
 
std::vector< ASTNodePtrargs
 

Detailed Description

Definition at line 58 of file ast.hpp.

Constructor & Destructor Documentation

◆ ASTNode() [1/2]

ASTNode ( )

Definition at line 59 of file ast.hpp.

59{};

◆ ~ASTNode()

virtual ~ASTNode ( )
virtual

Definition at line 60 of file ast.hpp.

60{}

◆ ASTNode() [2/2]

ASTNode ( const std::vector< ASTNodePtr > &  args,
const Size  minArgs,
const Size  maxArgs = Null<Size>() 
)

Definition at line 40 of file ast.cpp.

40 : args(args) {
41 QL_REQUIRE(minArgs <= args.size() && (maxArgs == Null<Size>() || args.size() <= maxArgs),
42 "ASTNode construction failed, got " << args.size() << " arguments, expected " << minArgs << "..."
43 << (maxArgs == Null<Size>() ? "inf" : std::to_string(maxArgs)));
44 if (maxArgs != Null<Size>())
45 this->args.resize(maxArgs, ASTNodePtr());
46}
QuantLib::ext::shared_ptr< ASTNode > ASTNodePtr
Definition: ast.hpp:46
std::vector< ASTNodePtr > args
Definition: ast.hpp:64

Member Function Documentation

◆ accept()

void accept ( AcyclicVisitor &  v)
virtual

Member Data Documentation

◆ locationInfo

LocationInfo locationInfo

Definition at line 63 of file ast.hpp.

◆ args

std::vector<ASTNodePtr> args

Definition at line 64 of file ast.hpp.