Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
155 commits
Select commit Hold shift + click to select a range
8ada11c
Add language-tree-sitter-utils module
holtvogt May 21, 2025
7fb1356
Use original tree-sitter dependency
holtvogt May 26, 2025
aa1f8f2
Use JTreeSitter as internal tree-sitter parser
holtvogt May 26, 2025
e76c6e7
Add TreeSitterLanguage abstract class for tree-sitter integration
holtvogt May 26, 2025
c1d3fc7
Add OS utility class for operating system and architecture detection
holtvogt May 26, 2025
04315bf
Add classes for native library loading support in tree-sitter
holtvogt May 26, 2025
12cb33c
Add service loader configuration for LibraryLookup
holtvogt May 26, 2025
82aae4a
Add tree-sitter utils to converage report
holtvogt May 27, 2025
5d82e52
Remove test utils and build options for now
holtvogt May 28, 2025
5ad72c4
Sort dependencies
holtvogt May 28, 2025
cd68528
Bump to JDK 22
holtvogt May 28, 2025
a966457
Add Tree-sitter-based Python module
holtvogt May 28, 2025
2621eb1
Add colon to method end
holtvogt May 28, 2025
607afdb
Fix Javadoc reference
holtvogt May 28, 2025
928b262
Use template method to provide language specific grammar
holtvogt May 28, 2025
7516f39
Add Python language class
holtvogt May 28, 2025
edae33a
Add Pytho parser adapter
holtvogt May 28, 2025
5a82810
Add whitespace for code formatting in TreeSitterPython
holtvogt May 28, 2025
65d8fa7
Add new token types for Python 3.12
holtvogt Jun 2, 2025
1e90d6a
Add binary files for Java and Python TreeSitter language support
holtvogt Jun 2, 2025
34094fe
Add Python dependency to CLI module
holtvogt Jun 2, 2025
d85e2a7
Update Python identifier to return python
holtvogt Jun 2, 2025
ddbda29
Remove OS magic numbers
Jun 4, 2025
c38be13
Remove symbol name magic number
Jun 4, 2025
9168ac6
Add libraries for Mac OS
Jun 4, 2025
fef7292
Add visitor interface for Tree-sitter
holtvogt Aug 2, 2025
3cff92b
Add utility class for traversing Tree-sitter syntax trees
holtvogt Aug 2, 2025
680224b
Implement token extraction in PythonParserAdapter
holtvogt Aug 2, 2025
565345f
Use a constant for symbol name
holtvogt Aug 2, 2025
6a97879
Add PythonTokenCollector class for token extraction
holtvogt Aug 2, 2025
e108418
Add test files for Python language features
holtvogt Aug 2, 2025
e180591
Remove debug print statement from TreeSitterPythonTest
holtvogt Aug 2, 2025
be85d66
Add test suite for the Python language module
holtvogt Aug 2, 2025
86de313
Add token handlers for list, set, and dictionary
holtvogt Aug 2, 2025
4b0481c
Add LIST, SET, and DICTIONARY token types
holtvogt Aug 2, 2025
cd3ad79
Add ANTLR Python module dependency for regression tests
holtvogt Aug 2, 2025
d7ad26f
Add missing newline
holtvogt Aug 2, 2025
700ca23
Add regression tests for ANTLR Python 3.6 compatibility
holtvogt Aug 2, 2025
b24ba77
Disable test due to tokenization issue in ANTLR
holtvogt Aug 2, 2025
272fd5e
Add integration test for Tree-sitter Python parser
holtvogt Aug 3, 2025
775b237
Refactor async/await test documentation
holtvogt Aug 3, 2025
3c32c9b
Refactor BasicTest.py
holtvogt Aug 3, 2025
77cfcab
Update language test with list, set and dict tokens
holtvogt Aug 3, 2025
f96da12
Use constant regression test file name
holtvogt Aug 3, 2025
b45578d
Fix LanguageTest to include the new Python module
holtvogt Aug 3, 2025
36fdebc
Integrate Tree-sitter based Python in report viewer
holtvogt Aug 3, 2025
d9b89bb
Enhance documentation for Tree-sitter classes
holtvogt Aug 3, 2025
37fdc71
Remove Tree-sitter libraries for Java and Python
holtvogt Aug 3, 2025
4de13ce
Add Maven profile to build Tree-sitter libraries
holtvogt Aug 3, 2025
3eae546
Add build script for Tree-sitter native libraries
holtvogt Aug 3, 2025
f0fbb35
Add README for native library building process
holtvogt Aug 3, 2025
43a8ba7
Add GitHub Action to build Tree-sitter libraries
holtvogt Aug 3, 2025
59f1021
Add build directory to .gitignore
holtvogt Aug 3, 2025
86c527b
Add MinGW-w64 and make to requirements
holtvogt Aug 3, 2025
f271d30
Implement cleanup function for build directoriy
holtvogt Aug 3, 2025
13a6123
Add Windows build tools
holtvogt Aug 3, 2025
7862de0
Replace MinGW-w64 with Cygwin
holtvogt Aug 3, 2025
46fac02
Update Cygwin installation path
holtvogt Aug 3, 2025
636ddc0
Refactor Cygwin tool verification in build workflow
holtvogt Aug 3, 2025
b7c31da
Update Windows build requirements in README
holtvogt Aug 3, 2025
47f4927
Add verification for make installation
holtvogt Aug 3, 2025
c569775
Continue on Windows error for now
holtvogt Aug 3, 2025
f62337c
Disable condition for combining artifacts
holtvogt Aug 3, 2025
8993fe2
Add Python Tree-Sitter language module doc
holtvogt Aug 3, 2025
b92bdfe
Add documentation for adding Tree-Sitter-based language modules
holtvogt Aug 3, 2025
5719a39
Add PythonTokenSequencePrinter utility for printing token sequences
holtvogt Aug 3, 2025
4f9928f
Fix JDoc issues
holtvogt Aug 3, 2025
175e646
Merge branch 'feature/tree-sitter-parser-integration' into feature/tr…
holtvogt Aug 15, 2025
fdb2256
Add new Python module to coverage report
holtvogt Aug 15, 2025
907d7f8
Upgrade to Java JDK 22
holtvogt Aug 15, 2025
ce35ca6
Add jextract installation and verification
holtvogt Aug 15, 2025
e8652c2
Implement new token length handling
holtvogt Aug 15, 2025
3ff4272
Add missing echo to GitHub Actions environments path
holtvogt Aug 15, 2025
63e2d15
Add native library build run as prerequisite
holtvogt Aug 15, 2025
ea8fab8
Make workflow callable
holtvogt Aug 15, 2025
828b278
Fix dependency on build native libraries
holtvogt Aug 15, 2025
2751be2
Debug maven workflow
holtvogt Aug 15, 2025
f85f81a
Add missing Jextract installation
holtvogt Aug 15, 2025
6fe1e1c
Make Windows architecture optional for now
holtvogt Aug 15, 2025
b893719
Replace downloading with local native library build
holtvogt Aug 15, 2025
9d5281a
Use version from main pom
holtvogt Aug 15, 2025
e9920fe
Remove dependency on AbstractParser
holtvogt Aug 15, 2025
919b2c5
Implement fileExtensions method and remove suffixes method
holtvogt Aug 15, 2025
7c9eefc
Refactor file reading logic
holtvogt Aug 15, 2025
40daa9d
Use new Token constructor
holtvogt Aug 15, 2025
6ee5d01
Update guide for adding Tree-Sitter language modules to JPlag
holtvogt Aug 15, 2025
19b35aa
Remove blank line
holtvogt Aug 15, 2025
9cee241
Update Python language module README
holtvogt Aug 15, 2025
1151356
Replace hardcoded available languages number
holtvogt Aug 18, 2025
494e4b7
Shorten isEndToken example
holtvogt Aug 18, 2025
c166991
Update comment in README
holtvogt Aug 18, 2025
f5b7c6b
Use Tree-sitter's indexing methods
holtvogt Aug 18, 2025
391346c
Remove line and column calculation
holtvogt Aug 18, 2025
269acba
Inline variable declarations for line and column
holtvogt Aug 18, 2025
410abed
Add list, set and dict comprehension tokenization support
holtvogt Aug 18, 2025
6d16b2b
Remove unused code information
holtvogt Aug 18, 2025
c5031a1
Use fixed number of available languages
holtvogt Aug 18, 2025
4e109af
Add priority as this language exists twice
holtvogt Aug 18, 2025
d41b46e
Add Tree-sitter Python module to CLI text
holtvogt Aug 18, 2025
7710619
Add default token length lookup with second constructor
holtvogt Aug 30, 2025
1398536
Trying to fix the Windows build error here
holtvogt Aug 30, 2025
a89eb44
Use Zig for Windows builds
holtvogt Aug 30, 2025
923ccf4
Fix Zig download URLs
holtvogt Aug 30, 2025
dabcec9
Use Zig GitHub Action instead
holtvogt Aug 30, 2025
0db9fee
Add separation of Tree-sitter language API and core library
holtvogt Aug 30, 2025
0251e9a
Update Tree-sitter core library use
holtvogt Aug 30, 2025
b9ccaf9
Support versioning of Tree-sitter libraries
holtvogt Aug 30, 2025
d290ec7
Downgrade Zig version
holtvogt Aug 30, 2025
02fd6bd
Downgrade Zig until it works
holtvogt Aug 30, 2025
d811404
Fix default build output dir of Zig
holtvogt Aug 30, 2025
ddbd246
Change Zig build command to lib
holtvogt Aug 30, 2025
bce79da
Add missing positional argument
holtvogt Aug 30, 2025
2f78865
Still fixing
holtvogt Aug 30, 2025
0d7c034
Try to make it work
holtvogt Aug 30, 2025
bd50cb7
Once more
holtvogt Aug 30, 2025
aac9934
Another try
holtvogt Aug 30, 2025
694f4a1
Fix zig output dir
holtvogt Aug 30, 2025
4c518f2
Fix library naming issue
holtvogt Aug 30, 2025
4ad858d
Improve comments in build-native-libraries.sh
holtvogt Aug 30, 2025
964e83a
Use MSYS2 shell for Windows environments
holtvogt Aug 30, 2025
6bd6b38
Use maintained GitHub Action of Zig
holtvogt Aug 30, 2025
1e08c78
Use manual Zig installer
holtvogt Aug 30, 2025
3a96554
Add sudo permissions
holtvogt Aug 30, 2025
199752f
Fix jextract move
holtvogt Aug 30, 2025
31f33f5
Fix again
holtvogt Aug 30, 2025
86eea78
Debug
holtvogt Aug 30, 2025
b6ff3fa
Debug more
holtvogt Aug 30, 2025
724c057
More
holtvogt Aug 30, 2025
a6aeb04
Add msys shell explicitly
holtvogt Aug 30, 2025
cbbd9f3
Manually hack jextract to path
holtvogt Aug 30, 2025
addf391
Remove this shell
holtvogt Aug 30, 2025
8c58a94
Revert MSYS shell usage in Windows builds
holtvogt Aug 30, 2025
92f8682
Zig old
holtvogt Aug 30, 2025
d0e146a
Improve comments
holtvogt Aug 30, 2025
7b7c32e
Reorder Windows subjobs
holtvogt Aug 30, 2025
d4801e9
Use newer Zig GitHub action
holtvogt Aug 30, 2025
8e35ae8
Do not use new GitHub Action
holtvogt Aug 30, 2025
d047ee9
Use 14.1
holtvogt Aug 30, 2025
6912f5f
13.0 seems to work
holtvogt Aug 30, 2025
2eb2940
Fix dict comprehension handler name
holtvogt Aug 30, 2025
0d4dd8c
Add exception group handler
holtvogt Aug 30, 2025
2f5a8b6
Fix comprehensions test
holtvogt Aug 30, 2025
addc109
Fix exceptions group test
holtvogt Aug 30, 2025
4ac4198
Exclude virtual environment files
holtvogt Aug 30, 2025
3aefeb2
Fix tokenization for elif and else
holtvogt Aug 30, 2025
dd4a8dc
Update README to reflect versioned output structure for built libraries
holtvogt Sep 2, 2025
7fad071
Refactor token mappings for regression testing
holtvogt Sep 2, 2025
7cf95a7
Convert TreeSitterVisitor to abstract class with built-in handlers
holtvogt Sep 2, 2025
5008d1b
Remove static traversal utility
holtvogt Sep 2, 2025
ffb09f5
Rename parser classes to remove misleading "Adapter" suffix
holtvogt Sep 2, 2025
66e5989
Apply spotless for AbstractTreeSitterParser constructor
holtvogt Sep 2, 2025
fa7ce74
Map exception group tokens to exceptions
holtvogt Sep 2, 2025
77c2bfd
Refactor token collection in TreeSitterVisitor and PythonTokenCollector
holtvogt Sep 2, 2025
e296a53
Add documentation for Tree-sitter-based language modules
holtvogt Sep 2, 2025
30c8aab
Remove example code from documentation
holtvogt Sep 2, 2025
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
189 changes: 189 additions & 0 deletions .github/workflows/build-native-libraries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
name: Build Native Libraries

on:
push:
paths:
- "scripts/build-native-libraries.sh"
- "language-tree-sitter-utils/**"
- ".github/workflows/build-native-libraries.yml"
pull_request:
paths:
- "scripts/build-native-libraries.sh"
- "language-tree-sitter-utils/**"
- ".github/workflows/build-native-libraries.yml"
workflow_dispatch:
workflow_call:

jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 22
distribution: 'temurin'

- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential git wget

- name: Install jextract
run: |
# Download jextract for Linux x64
wget https://download.java.net/java/early_access/jextract/22/6/openjdk-22-jextract+6-47_linux-x64_bin.tar.gz
tar -xzf openjdk-22-jextract+6-47_linux-x64_bin.tar.gz

# Install to /usr/local/jextract
echo "Installing jextract-22 to /usr/local/jextract"
sudo mv jextract-22 /usr/local/jextract
echo "/usr/local/jextract/bin" >> $GITHUB_PATH

- name: Verify jextract availability
run: |
jextract --version

- name: Verify make installation
run: |
make -v

- name: Build native libraries
run: |
chmod +x scripts/build-native-libraries.sh
mvn -Pbuild-native-libraries generate-resources

- name: Upload Linux libraries
uses: actions/upload-artifact@v4
with:
name: "native-libraries-linux"
path: |
language-tree-sitter-utils/src/main/resources/native/linux/
languages/python/src/main/resources/native/linux/
build/native/

build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 22
distribution: 'temurin'

- name: Install build dependencies
run: |
xcode-select --install || true

- name: Install jextract
run: |
# Download jextract for macOS (detect architecture)
if [[ $(uname -m) == "arm64" ]]; then
wget https://download.java.net/java/early_access/jextract/22/6/openjdk-22-jextract+6-47_macos-aarch64_bin.tar.gz
tar -xzf openjdk-22-jextract+6-47_macos-aarch64_bin.tar.gz
else
wget https://download.java.net/java/early_access/jextract/22/6/openjdk-22-jextract+6-47_macos-x64_bin.tar.gz
tar -xzf openjdk-22-jextract+6-47_macos-x64_bin.tar.gz
fi

# Remove quarantine attribute (macOS specific)
echo "Removing quarantine attribute for jextract-22 on macOS"
sudo xattr -r -d com.apple.quarantine jextract-22

# Install to /usr/local/jextract
echo "Installing jextract-22 to /usr/local/jextract"
sudo mv jextract-22 /usr/local/jextract
echo "/usr/local/jextract/bin" >> $GITHUB_PATH

- name: Verify jextract availability
run: |
jextract --version

- name: Verify make installation
run: |
make -v

- name: Build native libraries
run: |
chmod +x scripts/build-native-libraries.sh
mvn -Pbuild-native-libraries generate-resources

- name: Upload macOS libraries
uses: actions/upload-artifact@v4
with:
name: "native-libraries-macos"
path: |
language-tree-sitter-utils/src/main/resources/native/mac/
languages/python/src/main/resources/native/mac/
build/native/

build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 22
distribution: 'temurin'

- name: Install jextract
run: |
# Download jextract for Windows x64
curl -L -o jextract-windows.tar.gz https://download.java.net/java/early_access/jextract/22/6/openjdk-22-jextract+6-47_windows-x64_bin.tar.gz
tar -xzf jextract-windows.tar.gz

# Install to C:\jextract
echo "Installing jextract-22 to C:\jextract"
mkdir -p C:\jextract
mv jextract-22\* C:\jextract\
echo "C:\jextract\bin" >> $env:GITHUB_PATH

- name: Verify jextract availability
run: |
jextract --version

- name: Set up Zig
uses: goto-bus-stop/setup-zig@v2
with:
version: 0.13.0

- name: Verify Zig installation
run: |
zig version

- name: Build native libraries
run: |
# Convert line endings for Windows
git config --global core.autocrlf false
mvn -Pbuild-native-libraries generate-resources

- name: Upload Windows libraries
uses: actions/upload-artifact@v4
with:
name: "native-libraries-windows"
path: |
language-tree-sitter-utils/src/main/resources/native/windows/
languages/python/src/main/resources/native/windows/
build/native/

combine-artifacts:
needs: [build-linux, build-macos, build-windows]
runs-on: ubuntu-latest
# if: github.event_name == 'push' && github.ref == 'refs/heads/main' TODO: Enable condition when finished
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts

- name: Combine and commit libraries
run: |
# This step combines the artifacts and commit them to the repository
# For now, we'll just list what we have
find artifacts -name "*.so" -o -name "*.dylib" -o -name "*.dll" | sort
21 changes: 18 additions & 3 deletions .github/workflows/complete-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,28 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 21
java-version: 22
distribution: 'temurin'

- name: Install jextract
run: |
# Download jextract for Linux x64
wget https://download.java.net/java/early_access/jextract/22/6/openjdk-22-jextract+6-47_linux-x64_bin.tar.gz
tar -xzf openjdk-22-jextract+6-47_linux-x64_bin.tar.gz

# Install to /usr/local/jextract
echo "Installing jextract-22 to /usr/local/jextract"
sudo mv jextract-22 /usr/local/jextract
echo "/usr/local/jextract/bin" >> $GITHUB_PATH

- name: Build native libraries
run: |
chmod +x scripts/build-native-libraries.sh
mvn -Pbuild-native-libraries generate-resources

- uses: actions/setup-node@v4
with:
node-version: "18"

- name: Build Assembly
run: mvn -DskipTests clean package assembly:single

Expand Down Expand Up @@ -82,7 +97,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 21
java-version: 22
distribution: 'temurin'

- name: Get JAR
Expand Down
21 changes: 17 additions & 4 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ on:
- "**/pom.xml"
- "**.java"
- "**.g4"

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
Expand All @@ -42,13 +40,28 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 21
java-version: 22
distribution: 'temurin'

- name: Install jextract
run: |
# Download jextract for Linux x64
wget https://download.java.net/java/early_access/jextract/22/6/openjdk-22-jextract+6-47_linux-x64_bin.tar.gz
tar -xzf openjdk-22-jextract+6-47_linux-x64_bin.tar.gz

# Install to /usr/local/jextract
echo "Installing jextract-22 to /usr/local/jextract"
sudo mv jextract-22 /usr/local/jextract
echo "/usr/local/jextract/bin" >> $GITHUB_PATH

- name: Build native libraries
run: |
chmod +x scripts/build-native-libraries.sh
mvn -Pbuild-native-libraries generate-resources

- uses: actions/setup-node@v4
with:
node-version: "18"

- name: Run Tests
run: mvn verify -B -U

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '21'
java-version: '22'
distribution: 'temurin'
- name: Set maven settings.xml
uses: whelk-io/maven-settings-xml-action@v22
Expand All @@ -29,7 +29,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '21'
java-version: '22'
distribution: 'temurin'
- uses: actions/setup-node@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/report-viewer-demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 21
java-version: 22
distribution: 'temurin'

- name: Build Assembly
Expand All @@ -41,7 +41,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 21
java-version: 22
distribution: 'temurin'

- name: Get JAR
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/spotless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 21
java-version: 22
distribution: 'temurin'

- name: Check with Spotless
Expand Down
18 changes: 17 additions & 1 deletion .github/workflows/verify-help-text.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,24 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 21
java-version: 22
distribution: 'temurin'

- name: Install jextract
run: |
# Download jextract for Linux x64
wget https://download.java.net/java/early_access/jextract/22/6/openjdk-22-jextract+6-47_linux-x64_bin.tar.gz
tar -xzf openjdk-22-jextract+6-47_linux-x64_bin.tar.gz

# Install to /usr/local/jextract
echo "Installing jextract-22 to /usr/local/jextract"
sudo mv jextract-22 /usr/local/jextract
echo "/usr/local/jextract/bin" >> $GITHUB_PATH

- name: Build native libraries
run: |
chmod +x scripts/build-native-libraries.sh
mvn -Pbuild-native-libraries generate-resources

- name: Build Assembly
run: mvn -DskipTests clean package assembly:single
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,10 @@ result/
result.zip
result.jplag

.venv/

# macOS
*.DS_Store

# Build directories
build/
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ Languages:
kotlin
llvmir
multi
python
python3
rlang
rust
Expand Down
5 changes: 5 additions & 0 deletions cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@
<artifactId>java</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>de.jplag</groupId>
<artifactId>python</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>de.jplag</groupId>
<artifactId>python-3</artifactId>
Expand Down
Loading
Loading