Loading...
Searching...
No Matches
operators.f90

Go to the source code of this file.

Data Types

interface  evaluate_expression

Functions/Subroutines

logical function evaluate_expression_default (expr, macros, val)
 Evaluates a preprocessor-style expression with macro substitution. Tokenizes the input expression, expands macros where appropriate, parses it according to operator precedence, and computes the integer result. Returns .true. if evaluation succeeded and the result is non-zero.
logical function evaluate_expression_with_context (expr, macros, ctx, val)
 Evaluates a preprocessor-style expression with macro substitution. Tokenizes the input expression, expands macros where appropriate, parses it according to operator precedence, and computes the integer result. Returns .true. if evaluation succeeded and the result is non-zero.
recursive integer function parse_expression (expr, tokens, ntokens, pos, macros, ctx)
 Parses a sequence of tokens starting at position pos as a full expression. Entry point for the recursive descent parser. Delegates to parse_or().
recursive integer function parse_conditional (expr, tokens, ntokens, pos, macros, ctx)
 Parses conditional expressions (?:). Right-associative.
recursive integer function parse_or (expr, tokens, ntokens, pos, macros, ctx)
 Parses logical OR expressions (||).
recursive integer function parse_and (expr, tokens, ntokens, pos, macros, ctx)
 Parses logical AND expressions (&&).
recursive integer function parse_bitwise_or (expr, tokens, ntokens, pos, macros, ctx)
 Parses bitwise OR expressions (|).
recursive integer function parse_bitwise_xor (expr, tokens, ntokens, pos, macros, ctx)
 Parses bitwise XOR expressions (^).
recursive integer function parse_bitwise_and (expr, tokens, ntokens, pos, macros, ctx)
 Parses bitwise AND expressions (&).
recursive integer function parse_equality (expr, tokens, ntokens, pos, macros, ctx)
 Parses equality/inequality expressions (==, @param[in] expr Expression to be processed @param[in] tokens Array of tokens to parse @param[in] ntokens Number of valid tokens in the array @param[inout] pos Current parsing position (updated as tokens are consumed) @param[in] macros Defined macros for expansion and defined()` checks.
recursive integer function parse_relational (expr, tokens, ntokens, pos, macros, ctx)
 Parses relational expressions (<, >, <=, >=).
recursive integer function parse_shifting (expr, tokens, ntokens, pos, macros, ctx)
 Parses shift expressions (<<, >>).
recursive integer function parse_additive (expr, tokens, ntokens, pos, macros, ctx)
 Parses additive expressions (+, -).
recursive integer function parse_multiplicative (expr, tokens, ntokens, pos, macros, ctx)
 Parses multiplicative expressions (*, /, %).
recursive integer function parse_power (expr, tokens, ntokens, pos, macros, ctx)
 Parses exponentiation (**). Right-associative.
recursive integer function parse_unary (expr, tokens, ntokens, pos, macros, ctx)
 Parses unary operators ( @param[in] expr Expression to be processed @param[in] tokens Array of tokens to parse @param[in] ntokens Number of valid tokens in the array @param[inout] pos Current parsing position (updated as tokens are consumed) @param[in] macros Defined macros for expansion and defined()` checks.
recursive integer function parse_atom (expr, tokens, ntokens, pos, macros, ctx)
 Parses primary expressions: numbers, identifiers, defined(...), parentheses.