22 releases (10 breaking)

0.12.0 Mar 29, 2024
0.10.1 Jan 29, 2024
0.8.0 Dec 31, 2023

#131 in Programming languages

Download history 5/week @ 2023-12-29 18/week @ 2024-01-05 17/week @ 2024-01-12 24/week @ 2024-01-26 2/week @ 2024-02-09 6/week @ 2024-02-16 13/week @ 2024-02-23 11/week @ 2024-03-01 12/week @ 2024-03-08 4/week @ 2024-03-15 129/week @ 2024-03-29 8/week @ 2024-04-05

137 downloads per month
Used in lmntal-language-server

MIT license

315KB
7.5K SLoC

LMNtalc

LMNtal compiler written in Rust (WIP).

Installation

Install from crates.io

cargo install lmntalc

Install from source

git clone https://github.com/lmntal/lmntalc.git
cd lmntalc
cargo install --path .

Usage

lmntalc <input-file>

or

lmntalc -t <target-language> <input-file>

Then, the compiled code will be written to the file with the same name as the input file, but with the extension of the target language. To specify the output file, use -o option.

lmntalc -t <target-language> -o <output-file> <input-file>

For more information, use lmntalc --help.

Features

  • Full support of parsing HyperLMNtal.
  • Simple static analysis on parse tree level.
  • Support of compiling Flat HyperLMNtal to target languages.

Target Languages

  • C++ 20
  • Java 17
  • Python 3.11

Behavioral Difference from lmntal-compiler

Expression

a + b is the same with '+'(a, b) in lmntal-compiler, but they are different in LMNtalc.

Known Issues

  • Rules in membranes in top level rule is not supported. i.e. Cannot generate membranes with rules.

License

This software is released under the MIT License, see LICENSE.

Dependencies

~4.5MB
~86K SLoC