All files / transpiler/output/codegen/types IParameterInput.ts

0% Statements 0/0
0% Branches 0/0
0% Functions 0/0
0% Lines 0/0

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72                                                                                                                                               
/**
 * Normalized parameter input for signature generation
 *
 * This interface serves as the contract between ParameterInputAdapter
 * (which normalizes AST or symbol data) and ParameterSignatureBuilder
 * (which generates the final C/C++ parameter string).
 *
 * All decisions are pre-computed before reaching the builder:
 * - Type classification (callback, string, array, etc.)
 * - Const qualifiers (explicit and auto-inferred)
 * - Pass-by-value vs pass-by-reference
 * - Array dimensions
 */
interface IParameterInput {
  /** Parameter name */
  name: string;
 
  /** Original C-Next type: 'u32', 'string<32>', 'Point', etc. */
  baseType: string;
 
  /** Mapped C type: 'uint32_t', 'char', 'Point', etc. */
  mappedType: string;
 
  /** Explicit const modifier from source code */
  isConst: boolean;
 
  /** Inferred const for unmodified parameters (computed from CodeGenState.modifiedParameters) */
  isAutoConst: boolean;
 
  /** Whether this is an array type */
  isArray: boolean;
 
  /** Array dimensions as strings: ['10', '20'] or ['33'] for string capacity */
  arrayDimensions?: string[];
 
  /** Whether this is a callback type (from CodeGenState.callbackTypes) */
  isCallback: boolean;
 
  /** The typedef name for callback types (e.g., 'HandleClickCallback') */
  callbackTypedefName?: string;
 
  /** Whether this is a string type (bounded or unbounded) */
  isString: boolean;
 
  /** Whether this is an unbounded string (no capacity) */
  isUnboundedString?: boolean;
 
  /** String capacity for non-array strings (used for tracking, not output) */
  stringCapacity?: number;
 
  /** Whether to use pass-by-value semantics (ISR, float, enum, small primitive) */
  isPassByValue: boolean;
 
  /** Whether to use pass-by-reference semantics (known struct or known primitive) */
  isPassByReference: boolean;
 
  /**
   * Issue #895: Force pointer syntax even in C++ mode.
   * Required for callback-compatible functions because C callback typedefs
   * expect pointers, not C++ references.
   */
  forcePointerSyntax?: boolean;
 
  /**
   * Issue #895: Force const qualifier from callback typedef signature.
   * When the C typedef has `const T*`, this preserves const on the generated param.
   */
  forceConst?: boolean;
}
 
export default IParameterInput;