<commit_before>#!/bin/bash

if [ "$#" -ne 1 ]; then
  echo "Usage: $0 <INPUT TIGER PROGRAM FILE>" >&2
  exit 1
fi
if ! [ -e "$1" ]; then
  echo "$1 not found" >&2
  exit 1
fi
if ! [ -f "$1" ]; then
  echo "$1 not a file" >&2
  exit 1
fi

fullfile=$1
filename=$(basename "$fullfile")
extension="${filename##*.}"
filename="${filename%.*}"

mkdir -p classes
javac -d ./classes/ -classpath antlr-runtime.jar:antlr-stringtemplate.jar:antlr.jar:. TigerParser.java TigerLexer.java Tiger.java
java -classpath antlr-runtime.jar:antlr-stringtemplate.jar:antlr.jar:./classes/ Tiger "$filename.tiger"  
dot -Tpng "$filename.dot" -o "$filename.png"
<commit_msg>conditionally execute dot<commit_after>#!/bin/bash

if [ "$#" -ne 1 ]; then
  echo "Usage: $0 <INPUT TIGER PROGRAM FILE>" >&2
  exit 1
fi
if ! [ -e "$1" ]; then
  echo "$1 not found" >&2
  exit 1
fi
if ! [ -f "$1" ]; then
  echo "$1 not a file" >&2
  exit 1
fi

fullfile=$1
filename=$(basename "$fullfile")
extension="${filename##*.}"
filename="${filename%.*}"

mkdir -p classes
javac -d ./classes/ -classpath antlr-runtime.jar:antlr-stringtemplate.jar:antlr.jar:. TigerParser.java TigerLexer.java Tiger.java
java -classpath antlr-runtime.jar:antlr-stringtemplate.jar:antlr.jar:./classes/ Tiger "$filename.tiger"  
if hash dot 2>/dev/null; then
    dot -Tpng "$filename.dot" -o "$filename.png"
fi

{'fraction_non_alphanumeric': 0.1828996282527881, 'fraction_numerical': 0.020074349442379184, 'mean_word_length': 3.93040293040293, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '174245', 'n_tokens_mistral': 527, 'n_tokens_neox': 497, 'n_words': 142}