39 return function_name_;
49 [[nodiscard]]
const std::vector<std::vector<Token>> &
arguments()
const
59 return arguments_.size();
67 [[nodiscard]]
const std::vector<Token> &
argument_at(std::size_t index)
const
69 return arguments_.at(index);
89 std::string result = function_name_ +
"(";
90 for (std::size_t arg_idx = 0; arg_idx < arguments_.size(); ++arg_idx) {
94 const auto &arg_tokens = arguments_[arg_idx];
95 for (std::size_t tok_idx = 0; tok_idx < arg_tokens.size(); ++tok_idx) {
100 if (!suppress_space) {
104 result += arg_tokens[tok_idx].text();
112 std::string function_name_;
113 std::vector<std::vector<Token>> arguments_;
114 std::size_t start_index_;
130[[nodiscard]] std::vector<FunctionCallInfo>
131find_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.