<commit_before>package no.uio.ifi.alboc.alboc;

/*
 * module AlboC
 *
 * (c) 2014 <EMAIL>
 */

import java.io.*;
import no.uio.ifi.alboc.chargenerator.CharGenerator;
import no.uio.ifi.alboc.code.Code;
import no.uio.ifi.alboc.error.Error;
import no.uio.ifi.alboc.error.AlboCError;
import no.uio.ifi.alboc.log.Log;
import no.uio.ifi.alboc.scanner.Scanner;
import static no.uio.ifi.alboc.scanner.Token.*;
import no.uio.ifi.alboc.syntax.Syntax;
import no.uio.ifi.alboc.types.Types;

/*
 * The main program of the AlboC compiler.
 */
public class AlboC {
    public static final String version = "2014-08-08";

    public static String sourceName = null,  // Source file name
	sourceBaseName = null;               // Source file name without extension
    public static boolean noLink = false;    // Should we drop linking?
    public static final String myOS =        // The current operating system
	System.getProperty("os.name");

    private static boolean testParser = false, testScanner = false;

    private static boolean checkParams(String[] args) {
	for (String opt: args) {
	    if (opt.equals("-c")) {
		noLink = true;
	    } else if (opt.equals("-logB")) {
		Log.doLogBinding = true;
	    } else if (opt.equals("-logI")) {
		Log.doLogTree = true;
	    } else if (opt.equals("-logP")) {
		Log.doLogParser = true;
	    } else if (opt.equals("-logS")) {
		Log.doLogScanner = true;
	    } else if (opt.equals("-logT")) {
		Log.doLogTypeCheck = true;
	    } else if (opt.equals("-testparser")) {
		testParser = true;
		Log.doLogParser = Log.doLogTree = true;
	    } else if (opt.equals("-testscanner")) {
		testScanner = true;  
		Log.doLogScanner = true;
	    } else if (opt.startsWith("-")) {
		return false;
	    } else {
		if (sourceName != null) return false;
		sourceName = sourceBaseName = opt;
		if (opt.length()>6 && opt.endsWith(".alboc")) 
		    sourceBaseName = opt.substring(0,opt.length()-6);
	    }
	}
	return true;
    }

    /**
     * The actual main program of the AlboC compiler.
     * It will initialize the various modules and start the
     * compilation (or module testing, if requested); finally,
     * it will terminate the modules.
     *
     * @param args The command line arguments.
     */
    public static void main(String[] args) {
	int exitStatus = 0;

	if (checkParams(args) && sourceName!=null) {
	    System.out.println("This is the AlboC compiler (version " + version +
			       " on " + myOS + ")");

	    try {
		Error.init();  Log.init();  Code.init();  Types.init();
		CharGenerator.init();  Scanner.init();  Syntax.init();
		
		if (testScanner) {
		    System.out.print("Scanning...");
		    while (Scanner.nextToken != eofToken) 
			Scanner.readNext();
		} else {
		    System.out.print("Parsing...");  
		    Syntax.parseProgram();
<commit_msg>La til noen S.o.pln i AlboC.java. Skrev hvem som har laget og modifisert prosjektet (altså oss).<commit_after>package no.uio.ifi.alboc.alboc;

/*
 * module AlboC
 *
 * (c) 2014 <EMAIL>
 */

import java.io.*;
import no.uio.ifi.alboc.chargenerator.CharGenerator;
import no.uio.ifi.alboc.code.Code;
import no.uio.ifi.alboc.error.Error;
import no.uio.ifi.alboc.error.AlboCError;
import no.uio.ifi.alboc.log.Log;
import no.uio.ifi.alboc.scanner.Scanner;
import static no.uio.ifi.alboc.scanner.Token.*;
import no.uio.ifi.alboc.syntax.Syntax;
import no.uio.ifi.alboc.types.Types;

/*
 * The main program of the AlboC compiler.
 */
public class AlboC {
    public static final String version = "2014-08-08";

    public static String sourceName = null,  // Source file name
	sourceBaseName = null;               // Source file name without extension
    public static boolean noLink = false;    // Should we drop linking?
    public static final String myOS =        // The current operating system
	System.getProperty("os.name");

    private static boolean testParser = false, testScanner = false;

    private static boolean checkParams(String[] args) {
	for (String opt: args) {
	    if (opt.equals("-c")) {
		noLink = true;
	    } else if (opt.equals("-logB")) {
		Log.doLogBinding = true;
	    } else if (opt.equals("-logI")) {
		Log.doLogTree = true;
	    } else if (opt.equals("-logP")) {
		Log.doLogParser = true;
	    } else if (opt.equals("-logS")) {
		Log.doLogScanner = true;
	    } else if (opt.equals("-logT")) {
		Log.doLogTypeCheck = true;
	    } else if (opt.equals("-testparser")) {
		testParser = true;
		Log.doLogParser = Log.doLogTree = true;
	    } else if (opt.equals("-testscanner")) {
		testScanner = true;  
		Log.doLogScanner = true;
	    } else if (opt.startsWith("-")) {
		return false;
	    } else {
		if (sourceName != null) return false;
		sourceName = sourceBaseName = opt;
		if (opt.length()>6 && opt.endsWith(".alboc")) 
		    sourceBaseName = opt.substring(0,opt.length()-6);
	    }
	}
	return true;
    }

    /**
     * The actual main program of the AlboC compiler.
     * It will initialize the various modules and start the
     * compilation (or module testing, if requested); finally,
     * it will terminate the modules.
     *
     * @param args The command line arguments.
     */
    public static void main(String[] args) {
	int exitStatus = 0;

	if (checkParams(args) && sourceName!=null) {
	    System.out.println("This is the AlboC compiler (version " + version +
			       " on " + myOS + ")");
	    System.out.println("It is written by <NAME>");
	    System.out.println("Modified by: <NAME>");
	    System.out.println("\t\t <NAME>");
	    try {
		Error.init();  Log.init();  Code.init();  Types.init();
		CharGenerator.init();  Scanner.init();  Syntax.init();
		
		if (testScanner) {
		    System.out.print("Scanning...");
		    while (Scanner.nextToken != eofToken) 
			Scanner.readNext();
		} else {
		    System.out.print("Parsing...");  
		    Syntax.parseProgram();

{'fraction_non_alphanumeric': 0.1456828345373237, 'fraction_numerical': 0.005503955968352253, 'mean_word_length': 2.8896321070234112, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 10, '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': '2478490', 'n_tokens_mistral': 2087, 'n_tokens_neox': 1963, 'n_words': 489}