Commits

Anonymous committed 70be4b5

Moving code around.

Comments (0)

Files changed (18)

META-INF/MANIFEST.MF

 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Export-Package: org.lispdev.swank,
  org.lispdev.swank.debug,
- org.lispdev.swank.infos,
  org.lispdev.swank.runnables

src/org/lispdev/swank/ISwank.java

 
 import org.lispdev.swank.debug.LispDebugTarget;
 import org.lispdev.swank.debug.LispVariable;
-import org.lispdev.swank.infos.DebugInfo;
 import org.lispdev.swank.runnables.SwankDebugActivateRunnable;
 import org.lispdev.swank.runnables.SwankDebugReturnRunnable;
 import org.lispdev.swank.runnables.SwankDebugRunnable;
+import org.lispdev.swank.runnables.SwankDebugRunnable.DebugInfo;
 import org.lispdev.swank.runnables.SwankPresentationRunnable;
 import org.lispdev.swank.runnables.SwankReadStringRunnable;
 import org.lispdev.swank.runnables.SwankRunnable;

src/org/lispdev/swank/LispImplementation.java

 import org.lispdev.log.Log;
 import org.lispdev.swank.debug.LispDebugTarget;
 import org.lispdev.swank.debug.LispVariable;
-import org.lispdev.swank.infos.CompileStringInfo;
-import org.lispdev.swank.infos.CompileStringInfo.CompileMessage;
-import org.lispdev.swank.infos.DebugActivateInfo;
-import org.lispdev.swank.infos.DebugInfo;
-import org.lispdev.swank.infos.ReadStringInfo;
-import org.lispdev.swank.infos.WriteStringInfo;
+import org.lispdev.swank.runnables.SwankCompileStringRunnable.CompileMessage;
+import org.lispdev.swank.runnables.SwankCompileStringRunnable.CompileStringInfo;
+import org.lispdev.swank.runnables.SwankDebugActivateRunnable.DebugActivateInfo;
+import org.lispdev.swank.runnables.SwankDebugRunnable.DebugInfo;
+import org.lispdev.swank.runnables.SwankReadStringRunnable.ReadStringInfo;
+import org.lispdev.swank.runnables.SwankWriteStringRunnable.WriteStringInfo;
 
 /**
  * Abstract Lisp Implementation class.

src/org/lispdev/swank/SwankInterface.java

 import org.eclipse.core.runtime.Assert;
 import org.lispdev.swank.debug.LispDebugTarget;
 import org.lispdev.swank.debug.LispVariable;
-import org.lispdev.swank.infos.DebugInfo;
 import org.lispdev.swank.internal.LispParser;
 import org.lispdev.swank.runnables.SwankCompileStringRunnable;
 import org.lispdev.swank.runnables.SwankDebugActivateRunnable;
 import org.lispdev.swank.runnables.SwankDebugReturnRunnable;
 import org.lispdev.swank.runnables.SwankDebugRunnable;
+import org.lispdev.swank.runnables.SwankDebugRunnable.DebugInfo;
 import org.lispdev.swank.runnables.SwankMacroExpandRunnable;
 import org.lispdev.swank.runnables.SwankPresentationRunnable;
 import org.lispdev.swank.runnables.SwankReadStringRunnable;

src/org/lispdev/swank/SwankInterfaceTest.java

 import org.lispdev.swank.debug.BaseLocalLispLaunchDelegate;
 import org.lispdev.swank.debug.LispProcess;
 import org.lispdev.swank.debug.LispVariable;
-import org.lispdev.swank.infos.DebugInfo;
-import org.lispdev.swank.infos.ReadStringInfo;
 import org.lispdev.swank.runnables.SwankCompileStringRunnable;
 import org.lispdev.swank.runnables.SwankDebugActivateRunnable;
 import org.lispdev.swank.runnables.SwankDebugReturnRunnable;
 import org.lispdev.swank.runnables.SwankDebugRunnable;
+import org.lispdev.swank.runnables.SwankDebugRunnable.DebugInfo;
 import org.lispdev.swank.runnables.SwankMacroExpandRunnable;
 import org.lispdev.swank.runnables.SwankPresentationRunnable;
 import org.lispdev.swank.runnables.SwankReadStringRunnable;

src/org/lispdev/swank/debug/LispThread.java

 import org.eclipse.debug.core.model.IBreakpoint;
 import org.eclipse.debug.core.model.IStackFrame;
 import org.eclipse.debug.core.model.IThread;
-import org.lispdev.swank.infos.DebugInfo;
+import org.lispdev.swank.runnables.SwankDebugRunnable.DebugInfo;
 
 public class LispThread extends LispDebugElement implements IThread
 {

src/org/lispdev/swank/infos/CompileStringInfo.java

-package org.lispdev.swank.infos;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/*
- * three lists:
- * - notes,
- * - results    ; a result is of type (MEMBER T NIL :COMPLAINED)
- * - durations  ;
- *
- * notes:
- *   (list* :message (message condition)
-       :severity (severity condition)
-       :location (location condition)
-       :references (references condition)
-       (let ((s (short-message condition)))
-         (if s (list :short-message s)))))
-
-
--->(:emacs-rex (swank:compile-string-for-emacs "(defun g (x)
-  (z x))
-
-(defun z (x)
-  (y x))
-" "/home/sk/cusp/ws/org.lispdev.swank/test.lisp" 1
-"/home/sk/cusp/ws/org.lispdev.swank/" 3) nil :repl-thread 2)
-<--(:return (:ok
-(:swank-compilation-unit
-  ((:message "undefined function: Y" :severity :style-warning
-    :location (:location (:buffer "/home/sk/cusp/ws/org.lispdev.swank/test.lisp")
-                         (:position 39) nil)
-    :references nil :short-message "undefined function: Y")
-   (:message "This function is undefined:
-  Y" :severity :style-warning :location (:error "No error location available")
-    :references nil :short-message "This function is undefined:
-  Y")) (:complained) (0.019))) 2)
-
-
--->(:emacs-rex (swank:compile-string-for-emacs "(defun g (x)
-  (+ 2 x))
-" "/home/sk/cusp/ws/org.lispdev.swank/test.lisp" 1
-"/home/sk/cusp/ws/org.lispdev.swank/" 3) nil :repl-thread 2)
-<--(:return (:ok (:swank-compilation-unit nil (t) (0.007))) 2)
-
- */
-public class CompileStringInfo
-{
-  public final List<CompileMessage> messages = new ArrayList<CompileMessage>();
-
-  public static class CompileMessage
-  {
-    public final String message;
-    public final String severity;
-    public final String locationError;
-    public final String file;
-    public final String position;
-    public final String shortMessage;
-
-    public CompileMessage(String message, String shortMessage, String severity,
-        String file, String position)
-    {
-      this.message = message;
-      this.severity = severity;
-      this.locationError = null;
-      this.file = file;
-      this.position = position;
-      this.shortMessage = shortMessage;
-    }
-
-    public CompileMessage(String message, String shortMessage, String severity,
-        String locationError)
-    {
-      this.message = message;
-      this.severity = severity;
-      this.locationError = locationError;
-      this.file = null;
-      this.position = null;
-      this.shortMessage = shortMessage;
-    }
-  }
-}

src/org/lispdev/swank/infos/DebugActivateInfo.java

-package org.lispdev.swank.infos;
-
-public class DebugActivateInfo
-{
-  public final int level;
-  public final String thread;
-
-  public DebugActivateInfo(String thread, int level)
-  {
-    this.thread = thread;
-    this.level = level;
-  }
-
-}

src/org/lispdev/swank/infos/DebugInfo.java

-package org.lispdev.swank.infos;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.lispdev.swank.LispImplementation;
-import org.lispdev.swank.SwankEvent;
-import org.lispdev.swank.runnables.SwankRunnable;
-
-/**
- * The structure that is initialized when {@link SwankEvent#DEBUG} is received
- * from {@link SwankRunnable#result} using {@link LispImplementation#getDebugInfo}
- */
-public class DebugInfo
-{
-  public final String thread;
-  public final int level;
-  /**
-   * the condition to debug
-   */
-  public final String condition;
-  public final List<SwankDebugRestart> restarts =
-    new ArrayList<SwankDebugRestart>();
-  public final List<String> frames = new ArrayList<String>();
-
-  public DebugInfo(String thread, int lvl, String condition)
-  {
-    this.thread = thread;
-    level = lvl;
-    this.condition = condition;
-  }
-
-  public void addRestart(String name, String description)
-  {
-    restarts.add(new SwankDebugRestart(capitalizeString(name), description));
-  }
-
-  private static String capitalizeString(String string)
-  {
-    char[] chars = string.toLowerCase().toCharArray();
-    boolean found = false;
-    for(int i = 0; i < chars.length; i++)
-    {
-      if( !found && Character.isLetter(chars[i]) )
-      {
-        chars[i] = Character.toUpperCase(chars[i]);
-        found = true;
-      }
-      else if( Character.isWhitespace(chars[i]) || chars[i] == '-' )
-      { // You can add other chars here
-        found = false;
-      }
-    }
-    return String.valueOf(chars);
-  }
-
-  public void addFrame(String frame)
-  {
-    frames.add(frame);
-  }
-
-  public static class SwankDebugRestart
-  {
-    public final String name;
-    public final String description;
-
-    public SwankDebugRestart(String name, String description)
-    {
-      this.name = name;
-      this.description = description;
-    }
-  }
-
-  @Override
-  public int hashCode()
-  {
-    final int prime = 31;
-    int result = 1;
-    result = prime * result + ((condition == null) ? 0 : condition.hashCode());
-    result = prime * result + level;
-    result = prime * result + ((thread == null) ? 0 : thread.hashCode());
-    return result;
-  }
-
-  @Override
-  public boolean equals(Object obj)
-  {
-    if( this == obj ) return true;
-    if( obj == null ) return false;
-    if( getClass() != obj.getClass() ) return false;
-    DebugInfo other = (DebugInfo)obj;
-    if( condition == null )
-    {
-      if( other.condition != null ) return false;
-    }
-    else if( !condition.equals(other.condition) ) return false;
-    if( level != other.level ) return false;
-    if( thread == null )
-    {
-      if( other.thread != null ) return false;
-    }
-    else if( !thread.equals(other.thread) ) return false;
-    return true;
-  }
-}

src/org/lispdev/swank/infos/PresentationInfo.java

-package org.lispdev.swank.infos;
-
-public class PresentationInfo extends WriteStringInfo
-{
-  public final String id;
-
-  public PresentationInfo(String id, String text, boolean result)
-  {
-    super(text,result);
-    this.id = id;
-  }
-}

src/org/lispdev/swank/infos/ReadStringInfo.java

-package org.lispdev.swank.infos;
-
-import org.lispdev.swank.SwankEvent;
-import org.lispdev.swank.runnables.SwankRunnable;
-
-/**
- * The structure is initialized when {@link SwankEvent#READ_STRING} is received
- * by its listeners from {@link SwankRunnable#result} using
- */
-public class ReadStringInfo
-{
-  public final String str1;
-  public final String str2;
-
-  public ReadStringInfo(String str1, String str2)
-  {
-    this.str1 = str1;
-    this.str2 = str2;
-  }
-
-}

src/org/lispdev/swank/infos/WriteStringInfo.java

-package org.lispdev.swank.infos;
-
-public class WriteStringInfo
-{
-  public final String text;
-  /**
-   * is it repl-result or not
-   */
-  public final boolean result;
-
-  public WriteStringInfo(String text, boolean result)
-  {
-    this.text = text;
-    this.result = result;
-  }
-}

src/org/lispdev/swank/runnables/SwankCompileStringRunnable.java

 package org.lispdev.swank.runnables;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import org.lispdev.swank.LispImplementation;
-import org.lispdev.swank.infos.CompileStringInfo;
 
 public abstract class SwankCompileStringRunnable extends SwankRunnable
 {
     return implem.getCompileStringInfo(result);
   }
 
+  /*
+   * three lists:
+   * - notes,
+   * - results    ; a result is of type (MEMBER T NIL :COMPLAINED)
+   * - durations  ;
+   *
+   * notes:
+   *   (list* :message (message condition)
+         :severity (severity condition)
+         :location (location condition)
+         :references (references condition)
+         (let ((s (short-message condition)))
+           (if s (list :short-message s)))))
+
+
+  -->(:emacs-rex (swank:compile-string-for-emacs "(defun g (x)
+    (z x))
+
+  (defun z (x)
+    (y x))
+  " "/home/sk/cusp/ws/org.lispdev.swank/test.lisp" 1
+  "/home/sk/cusp/ws/org.lispdev.swank/" 3) nil :repl-thread 2)
+  <--(:return (:ok
+  (:swank-compilation-unit
+    ((:message "undefined function: Y" :severity :style-warning
+      :location (:location (:buffer "/home/sk/cusp/ws/org.lispdev.swank/test.lisp")
+                           (:position 39) nil)
+      :references nil :short-message "undefined function: Y")
+     (:message "This function is undefined:
+    Y" :severity :style-warning :location (:error "No error location available")
+      :references nil :short-message "This function is undefined:
+    Y")) (:complained) (0.019))) 2)
+
+
+  -->(:emacs-rex (swank:compile-string-for-emacs "(defun g (x)
+    (+ 2 x))
+  " "/home/sk/cusp/ws/org.lispdev.swank/test.lisp" 1
+  "/home/sk/cusp/ws/org.lispdev.swank/" 3) nil :repl-thread 2)
+  <--(:return (:ok (:swank-compilation-unit nil (t) (0.007))) 2)
+
+   */
+  public static class CompileStringInfo
+  {
+    public final List<CompileMessage> messages = new ArrayList<CompileMessage>();
+  }
+
+  public static class CompileMessage
+  {
+    public final String message;
+    public final String severity;
+    public final String locationError;
+    public final String file;
+    public final String position;
+    public final String shortMessage;
+
+    public CompileMessage(String message, String shortMessage, String severity,
+        String file, String position)
+    {
+      this.message = message;
+      this.severity = severity;
+      this.locationError = null;
+      this.file = file;
+      this.position = position;
+      this.shortMessage = shortMessage;
+    }
+
+    public CompileMessage(String message, String shortMessage, String severity,
+        String locationError)
+    {
+      this.message = message;
+      this.severity = severity;
+      this.locationError = locationError;
+      this.file = null;
+      this.position = null;
+      this.shortMessage = shortMessage;
+    }
+  }
+
 }

src/org/lispdev/swank/runnables/SwankDebugActivateRunnable.java

 package org.lispdev.swank.runnables;
 
 import org.lispdev.swank.LispImplementation;
-import org.lispdev.swank.infos.DebugActivateInfo;
 
 public abstract class SwankDebugActivateRunnable extends SwankRunnable
 {
     return implem.getDebugActivateInfo(result);
   }
 
+  public static class DebugActivateInfo
+  {
+    public final int level;
+    public final String thread;
+
+    public DebugActivateInfo(String thread, int level)
+    {
+      this.thread = thread;
+      this.level = level;
+    }
+
+  }
+
 }

src/org/lispdev/swank/runnables/SwankDebugRunnable.java

 package org.lispdev.swank.runnables;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import org.lispdev.swank.LispImplementation;
-import org.lispdev.swank.infos.DebugInfo;
+import org.lispdev.swank.SwankEvent;
 
 public abstract class SwankDebugRunnable extends SwankRunnable
 {
     DebugInfo info = getInfo();
     return info.thread + ":" + info.level;
   }
+
+  /**
+   * The structure that is initialized when {@link SwankEvent#DEBUG} is received
+   * from {@link SwankRunnable#result} using {@link LispImplementation#getDebugInfo}
+   */
+  public static class DebugInfo
+  {
+    public final String thread;
+    public final int level;
+    /**
+     * the condition to debug
+     */
+    public final String condition;
+    public final List<SwankDebugRestart> restarts =
+      new ArrayList<SwankDebugRestart>();
+    public final List<String> frames = new ArrayList<String>();
+
+    public DebugInfo(String thread, int lvl, String condition)
+    {
+      this.thread = thread;
+      level = lvl;
+      this.condition = condition;
+    }
+
+    public void addRestart(String name, String description)
+    {
+      restarts.add(new SwankDebugRestart(capitalizeString(name), description));
+    }
+
+    private static String capitalizeString(String string)
+    {
+      char[] chars = string.toLowerCase().toCharArray();
+      boolean found = false;
+      for(int i = 0; i < chars.length; i++)
+      {
+        if( !found && Character.isLetter(chars[i]) )
+        {
+          chars[i] = Character.toUpperCase(chars[i]);
+          found = true;
+        }
+        else if( Character.isWhitespace(chars[i]) || chars[i] == '-' )
+        { // You can add other chars here
+          found = false;
+        }
+      }
+      return String.valueOf(chars);
+    }
+
+    public void addFrame(String frame)
+    {
+      frames.add(frame);
+    }
+
+    public static class SwankDebugRestart
+    {
+      public final String name;
+      public final String description;
+
+      public SwankDebugRestart(String name, String description)
+      {
+        this.name = name;
+        this.description = description;
+      }
+    }
+
+    @Override
+    public int hashCode()
+    {
+      final int prime = 31;
+      int result = 1;
+      result = prime * result + ((condition == null) ? 0 : condition.hashCode());
+      result = prime * result + level;
+      result = prime * result + ((thread == null) ? 0 : thread.hashCode());
+      return result;
+    }
+
+    @Override
+    public boolean equals(Object obj)
+    {
+      if( this == obj ) return true;
+      if( obj == null ) return false;
+      if( getClass() != obj.getClass() ) return false;
+      DebugInfo other = (DebugInfo)obj;
+      if( condition == null )
+      {
+        if( other.condition != null ) return false;
+      }
+      else if( !condition.equals(other.condition) ) return false;
+      if( level != other.level ) return false;
+      if( thread == null )
+      {
+        if( other.thread != null ) return false;
+      }
+      else if( !thread.equals(other.thread) ) return false;
+      return true;
+    }
+  }
+
 }

src/org/lispdev/swank/runnables/SwankPresentationRunnable.java

 package org.lispdev.swank.runnables;
 
 import org.lispdev.swank.LispImplementation;
-import org.lispdev.swank.infos.PresentationInfo;
-import org.lispdev.swank.infos.WriteStringInfo;
+import org.lispdev.swank.runnables.SwankWriteStringRunnable.WriteStringInfo;
 
 public abstract class SwankPresentationRunnable extends SwankRunnable
 {
     PresentationInfo res = new PresentationInfo(id, tmp.text, tmp.result);
     return res;
   }
+
+  public static class PresentationInfo extends WriteStringInfo
+  {
+    public final String id;
+
+    public PresentationInfo(String id, String text, boolean result)
+    {
+      super(text,result);
+      this.id = id;
+    }
+  }
+
 }

src/org/lispdev/swank/runnables/SwankReadStringRunnable.java

 package org.lispdev.swank.runnables;
 
 import org.lispdev.swank.LispImplementation;
-import org.lispdev.swank.infos.ReadStringInfo;
+import org.lispdev.swank.SwankEvent;
 
 public abstract class SwankReadStringRunnable extends SwankRunnable
 {
     return implem.getReadStringInfo(result);
   }
 
+  /**
+   * The structure is initialized when {@link SwankEvent#READ_STRING} is received
+   * by its listeners from {@link SwankRunnable#result} using
+   */
+  public static class ReadStringInfo
+  {
+    public final String str1;
+    public final String str2;
+
+    public ReadStringInfo(String str1, String str2)
+    {
+      this.str1 = str1;
+      this.str2 = str2;
+    }
+
+  }
 }

src/org/lispdev/swank/runnables/SwankWriteStringRunnable.java

 package org.lispdev.swank.runnables;
 
 import org.lispdev.swank.LispImplementation;
-import org.lispdev.swank.infos.WriteStringInfo;
 
 public abstract class SwankWriteStringRunnable extends SwankRunnable
 {
     return implem.getWriteString(result);
   }
 
+  public static class WriteStringInfo
+  {
+    public final String text;
+    /**
+     * is it repl-result or not
+     */
+    public final boolean result;
+
+    public WriteStringInfo(String text, boolean result)
+    {
+      this.text = text;
+      this.result = result;
+    }
+  }
+
 }
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.