Copyright (c) 2023
https://www.risc.jku.at/research/formal/software/SLANG
Authors
- Wolfgang Schreiner Wolfgang.Schreiner@risc.jku.at
- William Steingartner william.steingartner@tuke.sk
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 3 or later.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see
https://www.gnu.org/licenses/.
SLANG is a software system for generating rapid prototype implementations of programming languages from their formal specifications.
From a single textual specification, SLANG can generate:
- A parser (using ANTLR4) that converts concrete syntax into an AST
- A pretty printer that converts the AST back to concrete syntax
- A type checker, generated from formal inference rules
- An interpreter, generated from
- denotational semantics (function equations), and/or
- big-step operational semantics (transition rules)
SLANG is implemented in Java and generates Java source code, but is designed to be extensible to other target languages.
Project page:
https://www.risc.jku.at/research/formal/software/SLANG
README This file
COPYING GNU General Public License v3
CHANGES Version history
bin/
SLANG Execution script
lib/
antlr4.jar ANTLR4 library (complete version)
SLANG.jar SLANG library
doc/
main.pdf Manual
languages/
<L>.txt Sample language definition
<L>Main.java Main program for executing the language
<L>Make Script to generate the executable
<L> Script to run the executable
lang/*/* Java and .g4 files generated by SLANG
src/
slang/*.java SLANG source code
- Java Development Kit (JDK) 21 or newer
Older Java versions will not work, as SLANG uses:
- record patterns
- pattern matching for
switch
- Copy
bin/SLANGinto a directory listed in yourPATH - Edit
bin/SLANG:- Set
JAVAto the path of thejavaexecutable - Set
SLANGto point to thelibdirectory of the distribution
- Set
- Verify the installation:
SLANG -h- See the examples in the
languages/directory
(start with the<L>Makescripts)
Oracle JDK 21 is recommended.
Download:
https://www.oracle.com/java/technologies/downloads/
Debian 13 (trixie):
apt-get install openjdk-21-jdkDebian 12 (bookworm): Available via backports: https://backports.debian.org
Website:
https://www.antlr.org
ANTLR is used for:
- processing the SLANG language
- processing ANTLR grammars generated by SLANG
apt-get install antlr4