Skip to content

Added IBM RPG lexer #1078

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

Merged
merged 16 commits into from
May 12, 2025
Merged

Added IBM RPG lexer #1078

merged 16 commits into from
May 12, 2025

Conversation

Chi-Iroh
Copy link
Contributor

@Chi-Iroh Chi-Iroh commented May 11, 2025

Hi !

Here's a lexer for IBM RPG !
You can learn about this language here :

For legacy purposes, the language can be written in two different forms, the fixed format (looks like a punched card, expects specific characters to be at certain columns in source code) and the free format (gets rid of fixed format, and looks like modern languages as Python).
This lexer only handles the free format, I may open a pull request later to implement the fixed format syntax.

There are some RPG repositories available on GitHub, you can search using "language:RPGLE" to see them.

The language is old but still maintained and even continues to evolve nowadays.
The lexer is based on the latest version at this day, RPG 7.6.

Are the MIME types in the XML files important ? I don't think this language has one (and I didn't know there were MIME types for programming languages), so I made one which looks like what I saw in other lexers XML files.

And the language can have embedded SQL statements in the source code, so I reused the SQL lexer. Please tell me if there's a better way to do it.

The language is rather tied to IBM environment, so if you're interested, here's how to try it :

@alecthomas
Copy link
Owner

Thanks!

@alecthomas alecthomas merged commit 79dde77 into alecthomas:master May 12, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants