45 return function_name_;
57 [[nodiscard]]
const std::vector<std::vector<Token>> &
arguments()
const
69 return arguments_.size();
79 [[nodiscard]]
const std::vector<Token> &
argument_at(std::size_t index)
const
81 return arguments_.at(index);
105 std::string result = function_name_ +
"(";
106 for (std::size_t arg_idx = 0; arg_idx < arguments_.size(); ++arg_idx) {
110 const auto &arg_tokens = arguments_[arg_idx];
111 for (std::size_t tok_idx = 0; tok_idx < arg_tokens.size(); ++tok_idx) {
113 bool suppress_space =
116 if (!suppress_space) {
120 result += arg_tokens[tok_idx].text();
128 std::string function_name_;
129 std::vector<std::vector<Token>> arguments_;
130 std::size_t start_index_;
148[[nodiscard]] std::vector<FunctionCallInfo>
149find_function_calls(
const std::vector<Token> &tokens,
const std::string &target_function_name);
Represents a parsed function call expression within a token stream.
const std::vector< Token > & argument_at(std::size_t index) const
Returns the argument at the specified index.
std::string reconstruct_call_text() const
Reconstructs a human-readable call expression from this function call.
std::size_t start_index() const
Returns the token index where this call begins.
const std::vector< std::vector< Token > > & arguments() const
Returns the arguments as token sequences.
FunctionCallInfo(std::string function_name, std::vector< std::vector< Token > > arguments, std::size_t start_index)
Constructs a FunctionCallInfo.
std::size_t argument_count() const
Returns the number of arguments.
const std::string & function_name() const
Returns the function name.
std::vector< FunctionCallInfo > find_all_function_calls(const std::vector< Token > &tokens)
Finds all function call expressions within a token stream.
std::vector< FunctionCallInfo > find_function_calls(const std::vector< Token > &tokens, const std::string &target_function_name)
Finds all calls to a specific function within a token stream.