You've already forked RecordFlux-parser
mirror of
https://github.com/AdaCore/RecordFlux-parser.git
synced 2026-02-12 13:09:26 -08:00
40 lines
844 B
Python
Executable File
40 lines
844 B
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
import os
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
from langkit.compile_context import CompileCtx
|
|
from langkit.libmanage import ManageScript
|
|
|
|
from language.lexer import rflx_lexer as lexer
|
|
from language.parser import grammar
|
|
|
|
base_dir = Path(os.path.dirname(os.path.abspath(__file__))) / ".."
|
|
|
|
BUILD_DIR = sys.argv[1]
|
|
VERSION = sys.argv[2]
|
|
|
|
|
|
class Manage(ManageScript): # type: ignore[misc]
|
|
def create_context(self, args: object) -> CompileCtx:
|
|
return CompileCtx(lang_name="Rflx", lexer=lexer, grammar=grammar)
|
|
|
|
|
|
manage = Manage()
|
|
|
|
manage.run(
|
|
[
|
|
"generate",
|
|
"--version",
|
|
VERSION,
|
|
"--build-dir",
|
|
f"{BUILD_DIR}",
|
|
"--relative-project",
|
|
"--no-pretty-print",
|
|
"--relative-project",
|
|
"--disable-warning",
|
|
"undocumented-nodes",
|
|
]
|
|
)
|