Skip to content

Commit

Permalink
Merge pull request #1 from datacamp/sql-spec
Browse files Browse the repository at this point in the history
Sql spec
  • Loading branch information
machow authored Feb 8, 2017
2 parents d1c5c1c + 6df2cfa commit 6cd5745
Show file tree
Hide file tree
Showing 16 changed files with 3,926 additions and 203 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Ignore java files
*.java
*.class

# Vim swapfiles
.*.swp

# Python ----------------------------------------------------------------------
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down Expand Up @@ -72,6 +72,6 @@ target/
# pyenv
.python-version

# Mac stuff
# Mac stuff -------------------------------------------------------------------
.DS_Store
tests/.DS_Store
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,12 @@ docker run -it -v ${PWD}:/output $CONTAINER\_ID /bin/bash
cd /output
antlr4 -Dlanguage=Python3 $GRAMMAR_FILE.g4
```

Running unit tests
------------------

In order to install psycopg2 in a virtualenv, I [needed to run](http://stackoverflow.com/a/39244687/1144523)..

```
env LDFLAGS="-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib" pip install --no-cache psycopg2
```
20 changes: 16 additions & 4 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ Vagrant.configure(2) do |config|
# end

script = <<-EOF
export ANTLR4="/usr/local/lib/antlr-4.5-complete.jar"
#export ANTLR4="/usr/local/lib/antlr-4.6-complete.jar"
export ANTLR4="/usr/local/lib/antlr4-4.6.1-SNAPSHOT-complete.jar"
export CLASSPATH=".:$ANTLR4:$CLASSPATH"
alias antlr4="java -Xmx500M org.antlr.v4.Tool"
alias grun="java org.antlr.v4.runtime.misc.TestRig"
Expand All @@ -73,9 +74,20 @@ Vagrant.configure(2) do |config|
# documentation for more information about their specific syntax and use.
config.vm.provision "shell", inline: <<-SHELL
sudo apt-get update
sudo apt-get install -y build-essential default-jdk python3.5-dev python-pip
cd /usr/local/lib
sudo curl -O http://www.antlr.org/download/antlr-4.5-complete.jar
sudo apt-get install -y build-essential default-jdk python3.5-dev python-pip maven
#
# NOTE: replacing download with manual build for now
# cd /usr/local/lib
# sudo curl -O http://www.antlr.org/download/antlr-4.6-complete.jar
#
# Manual Build ---
git clone https://github.com/antlr/antlr4.git
cd antlr4
export MAVEN_OPTS="-Xmx1G"
mvn -DskipTests install
mv ~/.m2/repository/org/antlr/antlr4/4.6.1-SNAPSHOT/antlr4-4.6.1-SNAPSHOT-complete.jar /usr/local/lib
#
#
cd /tmp
echo '#{script}' > antlr4.sh
sudo mv antlr4.sh /etc/profile.d/antlr4.sh
Expand Down
Loading

0 comments on commit 6cd5745

Please sign in to comment.