parse_and_validate_formula: Extract Symbols and Validate Formula AST

View source: R/formula_engine.R

parse_and_validate_formulaR Documentation

Extract Symbols and Validate Formula AST

Description

Recursively traverses the parsed formula AST to verify that only permitted mathematical operators, whitelisted mathematical functions, known spectral bands, and user-supplied parameters are present.

Usage

parse_and_validate_formula(
  formula_str,
  available_bands = character(0),
  param_names = character(0)
)

Arguments

formula_str

Character string containing the mathematical formula.

available_bands

Character vector of valid spectral band identifiers.

param_names

Character vector of valid parameter names.

Value

A list containing:

parsed_expr

The parsed R expression object.

used_bands

Character vector of band names referenced in the formula.

used_params

Character vector of parameter names referenced in the formula.


GeoIndexR documentation built on Oct. 10, 2026, 5:08 p.m.