-
Notifications
You must be signed in to change notification settings - Fork 53
Repository Structure
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)
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 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, changingAST
, etc.) -
Symbolic Table
classes and models - Utility classes
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
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
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 collecterrors
- Adjusting, filtering, and prioritizing
errors
- Prepare analysis results
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.
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)
This module contains the main COBOL LS extension logic:
-
Client-server
communication from aclient
perspective - Infrastructure for registering
dialects
-
Copybook
infrastructure for the client part -
Settings
andconfigurations
providers - Integration with other Broadcom extensions
This module provides DaCo Dialect registration logic and a surface for the DaCo Dialect Support VS Code Extension
This module provides IDMS Dialect registration logic and a surface for the IDMS Dialect Support VS Code Extension
COBOL Language Support, part of Code4z