]> code.delx.au - gnu-emacs/blobdiff - lisp/cedet/semantic/debug.el
Update copyright year to 2015
[gnu-emacs] / lisp / cedet / semantic / debug.el
index 2271c602b09119c063243155442d4713640db086..9168af59dd4471180b59ed9a5aafee9c234c637e 100644 (file)
@@ -1,6 +1,6 @@
 ;;; semantic/debug.el --- Language Debugger framework
 
-;; Copyright (C) 2003, 2004, 2005, 2008, 2009, 2010, 2011  Free Software Foundation, Inc.
+;; Copyright (C) 2003-2005, 2008-2015 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 
@@ -57,6 +57,12 @@ to one of the parser generators.")
 ;;;###autoload
 (make-variable-buffer-local 'semantic-debug-parser-class)
 
+;;;###autoload
+(defvar semantic-debug-parser-debugger-source nil
+  "Location of the debug parser class.")
+;;;###autoload
+(make-variable-buffer-local 'semantic-debug-parser-source)
+
 (defvar semantic-debug-enabled nil
   "Non-nil when debugging a parser.")
 
@@ -104,6 +110,7 @@ These buffers are brought into view when layout occurs.")
                  "The currently displayed frame.")
    (overlays :type list
             :initarg nil
+            :initform nil
             :documentation
             "Any active overlays being used to show the debug position.")
    )
@@ -175,7 +182,7 @@ TOKEN is a lexical token."
   "For IFACE, highlight NONTERM in the parser buffer.
 NONTERM is the name of the rule currently being processed that shows up
 as a nonterminal (or tag) in the source buffer.
-If RULE and MATCH indicies are specified, highlight those also."
+If RULE and MATCH indices are specified, highlight those also."
   (set-buffer (oref iface :parser-buffer))
 
   (let* ((rules (semantic-find-tags-by-class 'nonterminal (current-buffer)))
@@ -308,13 +315,13 @@ Argument ONOFF is non-nil when we are entering debug mode.
          ;; Install our map onto this buffer
          (use-local-map semantic-debug-mode-map)
          ;; Make the buffer read only
-         (toggle-read-only 1)
+         (setq buffer-read-only t)
 
          (set-buffer (oref iface source-buffer))
          ;; Use our map in the source buffer also
          (use-local-map semantic-debug-mode-map)
          ;; Make the buffer read only
-         (toggle-read-only 1)
+         (setq buffer-read-only t)
          ;; Hooks
          (run-hooks 'semantic-debug-mode-hook)
          )
@@ -323,15 +330,18 @@ Argument ONOFF is non-nil when we are entering debug mode.
           (oref semantic-debug-current-interface parser-buffer)
        (use-local-map
         (oref semantic-debug-current-interface parser-local-map))
+       (setq buffer-read-only nil)
        )
       (with-current-buffer
           (oref semantic-debug-current-interface source-buffer)
        (use-local-map
         (oref semantic-debug-current-interface source-local-map))
+       (setq buffer-read-only nil)
        )
       (run-hooks 'semantic-debug-exit-hook)
       )))
 
+;;;###autoload
 (defun semantic-debug ()
   "Parse the current buffer and run in debug mode."
   (interactive)
@@ -341,6 +351,9 @@ Argument ONOFF is non-nil when we are entering debug mode.
       (error "This major mode does not support parser debugging"))
   ;; Clear the cache to force a full reparse.
   (semantic-clear-toplevel-cache)
+  ;; Load in the debugger for this file.
+  (when semantic-debug-parser-debugger-source
+    (require semantic-debug-parser-debugger-source))
   ;; Do the parse
   (let ((semantic-debug-enabled t)
        ;; Create an interface
@@ -519,22 +532,22 @@ down to your parser later."
   )
 
 (defmethod semantic-debug-parser-go ((parser semantic-debug-parser))
-  "Continue executiong in this PARSER until the next breakpoint."
+  "Continue execution in this PARSER until the next breakpoint."
   (setq semantic-debug-user-command 'go)
   )
 
 (defmethod semantic-debug-parser-fail ((parser semantic-debug-parser))
-  "Continue executiong in this PARSER until the next breakpoint."
+  "Continue execution in this PARSER until the next breakpoint."
   (setq semantic-debug-user-command 'fail)
   )
 
 (defmethod semantic-debug-parser-quit ((parser semantic-debug-parser))
-  "Continue executiong in this PARSER until the next breakpoint."
+  "Continue execution in this PARSER until the next breakpoint."
   (setq semantic-debug-user-command 'quit)
   )
 
 (defmethod semantic-debug-parser-abort ((parser semantic-debug-parser))
-  "Continue executiong in this PARSER until the next breakpoint."
+  "Continue execution in this PARSER until the next breakpoint."
   (setq semantic-debug-user-command 'abort)
   )
 
@@ -566,5 +579,4 @@ A frame is of the form:
 ;; generated-autoload-load-name: "semantic/debug"
 ;; End:
 
-;; arch-tag: 6f189d2d-8a65-45a5-a7f0-9894625eb860
 ;;; semantic/debug.el ends here