<commit_before>/*
  This file is licensed through the GNU public License.  Please read it.
  Basically you can modify this code as you wish, but you need to distribute
  the source code for all applications that use this code.

  I'd appreciate comments/suggestions on the code <EMAIL>
*/
package org.tcfreenet.schewe.assert;

import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.IOException;

import antlr.TokenStreamSelector;

import gnu.getopt.Getopt;

public class Main {

  static /* package */ TokenStreamSelector selector = new TokenStreamSelector();
  static /* package */ JavaLexer javaLexer;
  static /* package */ AssertLexer assertLexer;
  /** the symbol table */
  static private Symtab _symtab;
  static /*pacakge*/ boolean _ignoreTimeStamp = false;
  
  public static void main(String[] args) {


    _symtab = new Symtab(parseCommandLine(args));
    
    // if we have at least one command-line argument
    if (args.length > 0 ) {
      System.err.println("Parsing...");
      // for each directory/file specified on the command line
      for(int i=0; i< args.length;i++) {
        doFile(new File(args[i])); // parse it
      }
    }
    else {
      System.err.println("Parsing...");
      //Test case
      doFile(new File("org/tcfreenet/schewe/assert/testcases/")); // parse it
    }
    
  }

  static private Configuration parseCommandLine(String[] args) {
    Configuration config = new Configuration();
    Getopt g = new Getopt("Main", args, "f");

    int c;
    String arg;
    while((c = g.getopt()) != -1) {
      switch(c) {
      case 'f':
        config.setIgnoreTimeStamp(true);
        break;
      default:
        System.err.println("getopt() returned " + c);<commit_msg>* Main.java: Started adding command line parameters.  Added the important -f for forcing instrumentation even if the file already exists.<commit_after>/*
  This file is licensed through the GNU public License.  Please read it.
  Basically you can modify this code as you wish, but you need to distribute
  the source code for all applications that use this code.

  I'd appreciate comments/suggestions on the code <EMAIL>
*/
package org.tcfreenet.schewe.assert;

import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.IOException;

import antlr.TokenStreamSelector;

import gnu.getopt.Getopt;
import gnu.getopt.LongOpt;

public class Main {

  static /* package */ TokenStreamSelector selector = new TokenStreamSelector();
  static /* package */ JavaLexer javaLexer;
  static /* package */ AssertLexer assertLexer;
  /** the symbol table */
  static private Symtab _symtab;
  static /*pacakge*/ boolean _ignoreTimeStamp = false;
  
  public static void main(String[] args) {


    _symtab = new Symtab(parseCommandLine(args));
    
    // if we have at least one command-line argument
    if (args.length > 0 ) {
      System.err.println("Parsing...");
      // for each directory/file specified on the command line
      for(int i=0; i< args.length;i++) {
        doFile(new File(args[i])); // parse it
      }
    }
    else {
      System.err.println("Parsing...");
      //Test case
      doFile(new File("org/tcfreenet/schewe/assert/testcases/")); // parse it
    }
    
  }

  static private Configuration parseCommandLine(String[] args) {
    Configuration config = new Configuration();
    LongOpt[] longopts = new LongOpt[1];

    longopts[0] = new LongOpt("force", LongOpt.NO_ARGUMENT, null, 'f');    
    Getopt g = new Getopt("JonsAssert", args, "f", longopts);

    int c;
    String arg;
    while((c = g.getopt()) != -1) {
      switch(c) {
      case 'f':
        config.setIgnoreTimeStamp(true);
        break;
      default:
        //Print out usage and exit
        System.err.println("Usage: JonsAssert [options] files ...");
        System.err.println("-f, --force  force instrumentation");
        System.exit(1);
{'fraction_non_alphanumeric': 0.1165691015525579, 'fraction_numerical': 0.0022906592008144567, 'mean_word_length': 2.9457831325301207, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '3943867', 'n_tokens_mistral': 1187, 'n_tokens_neox': 1152, 'n_words': 366}