Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,5 @@ jobs:
with:
go-version: '1.25'

- name: Build
run: |
go run mage.go generate

- name: Test
run: go test -v ./...
4 changes: 0 additions & 4 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: "Generate parser files"
run: |
./generate.sh

- name: Install dependencies
run: |
uv sync --all-extras --dev
Expand Down
6 changes: 0 additions & 6 deletions g4/generate.go

This file was deleted.

14 changes: 5 additions & 9 deletions generate.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
#!/bin/sh
# Copyright 2023 Felipe Zipitria
# Copyright 2025 Felipe Zipitria
# SPDX-License-Identifier: Apache-2.0

# This script is used to generate the parser files for the seclang DSL.
# It is used by the pre-commit hook to ensure that the parser files are up to date.

# Check if java is installed
if ! command -v java >/dev/null 2>&1; then
echo "Java is not installed. Please install Java and try again."
if ! command -v npx >/dev/null 2>&1; then
echo "Node is not installed. Please install nodejs and try again."
exit 1
fi

# Find g4 files and change directory
g4_files=$(find . -name "SecLangLexer.g4")
g4_dir=$(dirname "$g4_files")

# Change directory to g4
cd "$g4_dir"

alias antlr4='java -Xmx500M -cp "../lib/antlr-4.13.2-complete.jar:$CLASSPATH" org.antlr.v4.Tool'
antlr4 -Dlanguage=Go -no-visitor -package parser -o ../parser *.g4
antlr4 -Dlanguage=Python3 -no-visitor -package parser -o ../src/seclang_parser *.g4
npx antlr-ng -Dlanguage=Go -p parser -o parser g4/*.g4
npx antlr-ng -Dlanguage=Python3 -o src/seclang_parser g4/*.g4
Binary file removed lib/antlr-4.13.2-complete.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func Coverage() error {
}

func Generate() error {
return sh.RunV("go", "generate", "./...")
return sh.RunV("./generate.sh")
}

// Doc runs godoc, access at http://localhost:6060
Expand Down
2 changes: 0 additions & 2 deletions parser/seclang_lexer.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// Code generated from SecLangLexer.g4 by ANTLR 4.13.2. DO NOT EDIT.

package parser

import (
Expand Down
Loading