prolog-shell: Simple command line Prolog interpreter

Since Prolog isn't the most popular language, define a small
interactive interpreter that users or site administartors can play
around with by downloading the Gerrit WAR file and executing:

  java -jar gerrit.war prolog-shell

Change-Id: I0474b59e6ace24e6e6bfda58f574add3b2bf79e0
This commit is contained in:
Shawn O. Pearce
2011-06-21 14:14:34 -07:00
parent c1806f2a2e
commit 5e0071169a
4 changed files with 164 additions and 1 deletions

View File

@@ -120,7 +120,17 @@ public final class GerritLauncher {
try {
String cn = name;
if (cn.equals(cn.toLowerCase())) {
cn = cn.substring(0, 1).toUpperCase() + cn.substring(1);
StringBuilder buf = new StringBuilder();
buf.append(Character.toUpperCase(cn.charAt(0)));
for (int i = 1; i < cn.length(); i++) {
if (cn.charAt(i) == '-' && i + 1 < cn.length()) {
i++;
buf.append(Character.toUpperCase(cn.charAt(i)));
} else {
buf.append(cn.charAt(i));
}
}
cn = buf.toString();
}
clazz = Class.forName(pkg + "." + cn, true, loader);
} catch (ClassNotFoundException cnfe) {