Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PL/I or PL1 Grammars #1752

Open
Heidernlee opened this issue Jun 15, 2020 · 7 comments
Open

PL/I or PL1 Grammars #1752

Heidernlee opened this issue Jun 15, 2020 · 7 comments
Labels
new-grammar New grammar issue or pull request

Comments

@Heidernlee
Copy link

Anyone can provide a PL/1 Grammar?
PL/0 seems doesn't work with PL/1.

@KvanTTT KvanTTT added the new-grammar New grammar issue or pull request label Jun 15, 2020
@Heidernlee
Copy link
Author

Thanks for labeling.
I was told that PL/I is also very common used on Mainframe-System (Cobol + PL/I).

@ghost
Copy link

ghost commented Jun 16, 2020

https://www.cs.vu.nl/grammarware/browsable/os-pli-v2r3/ This document might be useful

@Heidernlee
Copy link
Author

@KvanTTT @studentmain
Thanks for providing the following site:
https://www.cs.vu.nl/grammarware/browsable/os-pli-v2r3/

This Grammar is created in 90's and seems Based on EBNF.
Is there any way to Trans EBNF to Antlr4 ? any Tools ?

@teverett
Copy link
Member

I've start to port the grammar from the link here https://github.com/teverett/grammars-v4/tree/pl1

PR's are welcome

@Heidernlee
Copy link
Author

@teverett
Thanks for your response.
I'll continue to test this g4 with my PL/I Source Code.

@teverett
Copy link
Member

@Heidernlee it's hardly in a testable state yet. Lots of work to do before it can even parse "Hello World".

@kaby76
Copy link
Contributor

kaby76 commented Jul 8, 2020

Since PL/1 was the first compiler I worked on out of school, at Intermetrics, 35 years ago, I decided as an exercise today to see if I can use my VS extension for Antlr to import the grammar from http://pl1gcc.sourceforge.net/ then use the transforms to fix the grammar (i.e., remove indirect left recursion, convert string literals for keywords to a sequence of upper and lower case letters). It had some problems, which I'm correcting, but it mostly worked. I now have a parser for PL/1 here: https://github.com/kaby76/AntlrExamples/tree/master/pl1. The grammar at https://www.cs.vu.nl/grammarware/browsable/os-pli-v2r3/ is not in a machine-readable form, and has a warning saying "This grammar is not yet corrected nor completed". For example, it doesn't include lexical considerations, like case and abbreviations for keywords. Further, there's supposed to be a preprocessor for PL/1, which the GNU FE for PL/1 implements. But, it works for several PL/1 files. There's an LSP server for PL/1 for VSCode, but the git repo for it is complete vaporware--no parser--a la IBM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-grammar New grammar issue or pull request
Projects
None yet
Development

No branches or pull requests

4 participants