Skip to content

Language Addition: HLASM / IBM Z Assembly (hlasm) #2503

Closed

Description

@squid-protocol

Parent: #2516

Language: High Level Assembler (HLASM) / z/Architecture Assembly
Extensions: .asm, .mac
Lexical Family: positional_anchored (Comments are strictly * in column 1, or .* for macros).

Scoping Situation

HLASM powers CICS User Exits and high-performance mainframe routines.

🚨 Critical Extension Conflict: We currently map .asm to the assembly profile (which targets x86/ARM and expects ; line comments). We must think carefully about resolving this conflict.

  • Action Required: We need to use discriminators in the hlasm profile (e.g., [".cbl", ".jcl", ".bms"]) so the detector routes .asm files to hlasm when in a mainframe repo context.

We need code that covers:

  • x (Topology): func_start targeting CSECT (Control Section) and DSECT (Dummy Section).
  • y (CICS/System Bridges): ipc_rpc_bridges capturing CICS macro calls like DFHEIENT (CICS entry) and DFHEIRET (CICS return).
  • z (Macros): macros capturing MACRO and MEND definitions.

Implementation Requirements

  1. Follow how_to_add_a_language.md using the positional_anchored lexical family.
  2. Implement the extension conflict resolution for .asm.
  3. Write tests/extraction/languages/test_hlasm_strict.py ensuring column-aware parsing doesn't ReDoS on long macros.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementlegacy-modernizationpriority: high

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions