Skip to content

Repository Structure

Zeibura Kathau edited this page Mar 7, 2023 · 3 revisions

The COBOL Language Support VS Code Extension implements the LSP protocol to provide language support functionality. The COBOL LS Extension therefore contains 2 parts: "Client" and "Server". The "Client" is the part that is visible in VS Code and acts as a VS Code Extension, but most of the logic is situated in the "Server" part, which does the actual code analysis and provides results to the "Client" side of the Extension via the LSP protocol.

Repository
|--.github (GitHub properties)
|--clients (Client part)
|--docs/images (Images)
|--release (Release process properties)
|--server (Server part)
|--tests (Integration tests)

Server Part

The server part is written in Java using the maven project structure:

server
|--common
|--dialect-daco
|--dialect-idms
|--engine
|--test

Let's move deeper into java modules for the server side

common Module

Common module contains interfaces, data models, utility classes, and other structures needed for engine and dialects modules such as:

  • Copybook infrastructure models and interfaces
  • Dialects processing models and interfaces
  • Error models
  • Mapping infrastructure
  • Abstract Syntax Tree (AST) nodes models
  • AST Processors infrastructure (performing checks, changing AST, etc.)
  • Symbolic Table classes and models
  • Utility classes

dialect-daco Module

This module contains all the necessary implementations for DaCo dialect processing:

  • Antlr4 files for lexer and parser
  • Dialect-specific AST nodes
  • Dialect-specific AST processors
  • Implementation of the CobolDialect interface

dialect-idms Module

This module contains all the necessary implementations for IDMS dialect processing:

  • Antlr4 files for lexer and parser
  • Dialect-specific AST nodes
  • Dialect-specific AST processors
  • Implementation of the CobolDialect interface

engine Module

The engine module contains the main logic for COBOL language processing such as:

  • Infrastructure for client-server communications
  • Copybook storage and cache
  • Preprocessor analysis
  • Dialect analysis
  • Copybook resolving infrastructure
  • Building AST
  • Apply checks for AST and collect errors
  • Adjusting, filtering, and prioritizing errors
  • Prepare analysis results

test Module

The test module contains an engine for testing called the Use Case Engine.

This test engine is only for testing purposes and does not contain any analysis logic.
For more information, see How-to-Create-Tests-Using-Use-Case-Engine.

Client Part

The client part contains 3 VS Code Extension Surfaces (clients):

clients
|--cobol-lsp-vscode-extension (COBOL LS Support Extension Surface)
|--daco-dialect-support (DaCo Dialect Support Extension Surface)
|--idms-dialect-support (Idms Dialect Support Extension Surface)

COBOL LS Support Surface

This module contains the main COBOL LS extension logic:

  • Client-server communication from a client perspective
  • Infrastructure for registering dialects
  • Copybook infrastructure for the client part
  • Settings and configurations providers
  • Integration with other Broadcom extensions

DaCo Dialect Support Surface

This module provides DaCo Dialect registration logic and a surface for the DaCo Dialect Support VS Code Extension

IDMS Dialect Support Surface

This module provides IDMS Dialect registration logic and a surface for the IDMS Dialect Support VS Code Extension