Antlr PL/SQL Lexer Parser Forked from https://github.com/antlr/grammars-v4/tree/master/plsql
You need to get JDK and Kotlin installed. For Mac:
brew cask install java
brew install kotlin
lib/pps
This Repo ships prebuilt PlSql.jar and dependencies (in lib
folder). You are able to call lib/pps
to parse multiple PL/SQL files. It will generate JSON output.
brew install antlr
echo 'export CLASSPATH=".:/usr/local/lib/antlr-4.7-complete.jar:$CLASSPATH"' >> ~/.bash_profile
cd grammar && ./build && cd ../bin
Now it's ready to call ./gjg <file>
to test grammars.
- You may need
Tools
->Kotlin
->Configure Kotlin in Project
- You may need to add lines below into
Help
->Edit Custom Properties...
idea_rt idea.no.launcher=true idea.max.intellisense.filesize=3000
Run
->Edit Configurations
,Add New Configuration
(button "+" on up-left corner), name it and setMain class
toPlSql
- Install latest
org.antlr:antlr4-runtime
andorg.json:json
via Maven - You may need to increase your console buffer size via
Preferences
,Editor
->General
->Console
,Override console cycle buffer size
like 10MB
After restarting IDEA you should be able to Run src/PlSql.kt
.
- Build with IDEA. The files should be placed in
target/classes
- Run
bin/pack
to generate JAR file aslib/PlSql.jar