gitweb on Svarog
projekti pod git sistemom za održavanje verzija -- projects under the git version control system
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8bb607f)
raw | patch | inline | side by side (parent: 8bb607f)
author | Doni Pracner <quinnuendo@gmail.com> | |
Tue, 26 Nov 2013 20:42:14 +0000 (21:42 +0100) | ||
committer | Doni Pracner <quinnuendo@gmail.com> | |
Tue, 26 Nov 2013 20:42:14 +0000 (21:42 +0100) |
src/mjc2wsl.java | patch | blob | history |
diff --git a/src/mjc2wsl.java b/src/mjc2wsl.java
index b807bc8d7be03f539ead619073a336d996f9af3d..c482ccfeaa9c294df9d3a1dc75485686dc93be14 100644 (file)
--- a/src/mjc2wsl.java
+++ b/src/mjc2wsl.java
public class mjc2wsl{
public static String versionN = "0.1.2";
+ public static final int M_ERR = 2, M_WAR = 1;
+
+ private int printLevel = 0;
+
+ private int[] messageCounters = new int[M_ERR+1];
+
+ private void message(String mes, int level){
+ if (level>printLevel)
+ System.out.println(mes);
+ messageCounters[level]++;
+ }
+
+ private void printMessageCounters(){
+ printMessageCounters(System.out);
+ }
+
+ private void printMessageCounters(PrintStream out){
+ out.println("total errors:"+messageCounters[M_ERR]+" warnings:"+messageCounters[M_WAR]);
+ }
+
/** Constant used for marking a regular comment from the original file */
public static final char C_REG = ' ';
/**
case enter: {
prl(createComment("enter not fully procesed yet"));
+ message("enter not fully procesed yet", M_WAR);
get();
get();
break;
}
case return_: {
prl(createComment("return not fully procesed yet"));
+ message("return not fully procesed yet", M_WAR);
break;
}
case exit: {
prl(createComment("exit not fully procesed yet"));
+ message("exit not fully procesed yet", M_WAR);
break;
}
}
default:
prl(createComment("unknown op error: " + op, C_ERR));
+ message("unknown op error: "+ op, M_ERR);
break;
}
}
if (f.exists()) {
Calendar now = Calendar.getInstance();
+ printLevel=10;
convertFile(f);
long mili = Calendar.getInstance().getTimeInMillis()
- now.getTimeInMillis();
System.out.println("conversion time:" + mili + " ms");
+ printMessageCounters();
out.close();
} else
System.out.println("file does not exist");