Compile-time constants used throughout the fpx preprocessor.
This module centralizes all numerical limits and fixed configuration values required by the implementation. These parameters define the maximum sizes of internal buffers and the allowed nesting depth of various preprocessing constructs.
The chosen values aim to balance flexibility and robustness:
The constants are used across multiple modules, including macro expansion, conditional compilation, tokenization, and the extended for directive implementation.
Limiting nested conditional directives:
Nesting is permitted up to MAX_COND_DEPTH levels.
Nested for loops:
Loop nesting is limited by MAX_FOR_DEPTH .
Long macro expansions:
Intermediate buffers are sized according to MAX_LINE_LEN .
| integer, parameter, public chksize = 72 |
Default chunk size used for internal buffering operations.
This value is primarily used when processing data incrementally to avoid frequent reallocations.
Definition at line 133 of file constants.f90.
| integer, parameter, public max_cond_depth = 50 |
Maximum nesting depth of conditional compilation directives.
Applies to constructs such as:
Excessive nesting beyond this limit results in diagnostics.
Definition at line 89 of file constants.f90.
| integer, parameter, public max_depth = 50 |
Maximum nesting depth of generic parser structures.
Used internally whenever recursive parser constructs require bounded stack-like storage.
Definition at line 75 of file constants.f90.
| integer, parameter, public max_for_depth = 50 |
Maximum nesting depth of #for loops.
Applies to the fpx extension:
Nested loops exceeding this limit generate an error.
Definition at line 104 of file constants.f90.
| integer, parameter, public max_line_len = 4096 |
Maximum permitted length of an input or generated line.
This limit applies to raw source lines, continued lines, and intermediate results produced during macro expansion.
The value should be sufficiently large for practically all modern Fortran source files while preventing unbounded memory use.
Definition at line 67 of file constants.f90.
| integer, parameter, public max_params = 10 |
Maximum number of parameters accepted by a macro definition.
Applies to function-like macros:
Variadic arguments count toward this limit.
Definition at line 125 of file constants.f90.
| integer, parameter, public max_tokens = 100 |
Maximum number of tokens generated during tokenization.
This value bounds the temporary token buffers used by expression parsing and macro processing.
Definition at line 112 of file constants.f90.