Skip to content

Commit

Permalink
Prototype implementation of PL/I
Browse files Browse the repository at this point in the history
Co-authored-by: Benjamin Wilson <[email protected]>
Co-authored-by: Markus Rudolph <[email protected]>
Signed-off-by: Mark Sujew <[email protected]>
  • Loading branch information
3 people committed Nov 18, 2024
1 parent 769e52c commit a6e1b12
Show file tree
Hide file tree
Showing 66 changed files with 13,611 additions and 3 deletions.
13 changes: 13 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
}
}
41 changes: 41 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
name: CI (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'pnpm'
- name: Build
shell: bash
run: |
pnpm install
pnpm build
- name: Test
if: success() || failure()
shell: bash
run: |
pnpm test
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.vscode/*
!.vscode/extensions.json
!.vscode/launch.json
!.vscode/tasks.json
node_modules/
dist/
out/
**/src/generated
**/syntaxes/pli.merged.json
*.tsbuildinfo
*.vsix
3 changes: 3 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
auto-install-peers = true
lockfile = true
link-workspace-packages = true
6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"langium.langium-vscode",
"vitest.explorer"
]
}
88 changes: 88 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
// A launch configuration that launches the extension inside a new window
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}/packages/extension",
"${workspaceFolder}/code_samples"
],
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/packages/language/out/**/*.js",
"${workspaceFolder}/packages/extension/out/**/*.js"
]
},
{
"name": "Run Web Extension",
"type": "extensionHost",
"debugWebWorkerHost": true,
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}/packages/extension",
"--extensionDevelopmentKind=web",
"${workspaceFolder}/code_samples"
],
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/packages/language/out/**/*.js",
"${workspaceFolder}/packages/extension/out/**/*.js"
]
}
{
"name": "Attach to Language Server",
"type": "node",
"port": 6009,
"request": "attach",
"skipFiles": [
"<node_internals>/**"
],
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/packages/language/out/**/*.js",
"${workspaceFolder}/packages/extension/out/**/*.js",
"${workspaceFolder}/node_modules/langium"
]
},
{
"name": "Vitest: Run All",
"type": "node",
"request": "launch",
"skipFiles": [
"<node_internals>/**",
],
"cwd": "${workspaceFolder}",
"runtimeExecutable": "pnpm",
"args": [
"vitest",
"run",
"--no-watch"
],
"smartStep": true,
"console": "integratedTerminal"
},
{
"name": "Vitest: Run Selected File",
"type": "node",
"request": "launch",
"autoAttachChildProcesses": true,
"skipFiles": [
"<node_internals>/**"
],
"runtimeExecutable": "pnpm",
"args": [
"vitest",
"run",
"${relativeFile}"
],
"smartStep": true,
"console": "integratedTerminal"
}
]
}
2 changes: 1 addition & 1 deletion code_samples/CHART.pli
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*PROCESS X(S),A(S),LINECOUNT(60);
/*PROCESS X(S),A(S),LINECOUNT(60); */
/* %M% %I% %D% %T%
PUNCH ' IDENTIFY **%M%1(''%M%/%I% %D% %T%'')'
PUNCH ' ENTRY PLISTART '
Expand Down
2 changes: 1 addition & 1 deletion code_samples/MACROS.pli
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*PROCESS MI(':'),NEST,X,AG,A,MAR(2,72,1),GN,NUM,STG;
/*PROCESS MI(':'),NEST,X,AG,A,MAR(2,72,1),GN,NUM,STG; */

/*** (CHECK): ***/

Expand Down
2 changes: 1 addition & 1 deletion code_samples/PLI0002.pli
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

/* DECLARE HOST-VARIABLE */
DCL TIMESTAMP CHAR(26);
DCL BUF1_CLOB SQL TYPE IS CLOB_FILE;
DCL BUF1_CLOB; // SQL TYPE IS CLOB_FILE;
EXEC SQL DECLARE :BUF1_CLOB VARIABLE CCSID EBCDIC;

DCL I FIXED BIN(31);
Expand Down
3 changes: 3 additions & 0 deletions code_samples/messages/IBM1295IE.pli
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
TEST: PROCEDURE OPTIONS(MAIN) REORDER;
dcl x(-2) fixed bin; //error: IBM1295IE Sole bound specified is less than 1. An upper bound of 1 is assumed.
END TEST;
2 changes: 2 additions & 0 deletions code_samples/messages/IBM1324IE.pli
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0PACK: PACKAGE EXPORTS(TEST, TEST, TEST); //error: TEST has 3 occurences, needed 1
0END;
3 changes: 3 additions & 0 deletions code_samples/messages/IBM1388IE.pli
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
0a: proc( x ) options(nodescriptor); //error: The NODESCRIPTOR attribute is invalid when any parameters have the NONCONNECTED attribute.
dcl x(20) fixed bin nonconnected;
0end a;
31 changes: 31 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "pl-one-workspace",
"description": "Base workspace package",
"version": "0.0.1",
"type": "module",
"private": true,
"scripts": {
"watch": "tsc -b tsconfig.build.json --watch",
"build": "pnpm langium:generate && tsc -b tsconfig.build.json && pnpm --dir packages/extension build && node ./scripts/merge-tmlanguage.mjs",
"build:clean": "pnpm clean && pnpm build",
"lint": "eslint src --ext ts",
"langium:generate": "pnpm --dir packages/language langium:generate",
"langium:watch": "pnpm --dir packages/language langium:watch",
"test": "vitest"
},
"devDependencies": {
"@types/node": "^18.0.0",
"@typescript-eslint/parser": "~7.13.0",
"@typescript-eslint/eslint-plugin": "~7.13.0",
"eslint": "~8.57.0",
"deepmerge": "^1.5.0",
"langium": "~3.2.0",
"shx": "~0.3.4",
"typescript": "~5.4.5",
"vitest": "^1.6.0"
},
"volta": {
"node": "18.20.3",
"npm": "10.7.0"
}
}
3 changes: 3 additions & 0 deletions packages/extension/.vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.vscode/**
.vscode-test/**
src/**
Loading

0 comments on commit a6e1b12

Please sign in to comment.