                                         "registers" "annotation"
                                         "end" "source" "inner")) "\\>")
          font-lock-preprocessor-face)
-   (cons "^\\sw+:" font-lock-constant-face)
    (cons "\\<[vp][[:digit:]]+\\>" font-lock-variable-name-face)))
 
 (defvar ddx-mode-map

(defvar ddx-all-labels nil
  "All labels in the current buffer")

(defun ddx-collect-labels ()
  (set (make-local-variable 'ddx-all-labels)
       (make-hash-table :test 'equal))
  (save-excursion
    (beginning-of-buffer)
     (while (re-search-forward "^\\(\\sw+\\):" nil t)
       (let ((l (match-string-no-properties 1)))
         (puthash l t ddx-all-labels)))))


   "Major mode to edit decompiled DEX files."
   (set (make-local-variable 'font-lock-defaults)
        '(ddx-mode-font-lock-keywords))
   (font-lock-add-keywords nil (list (cons ddx-label-re font-lock-constant-face)))
   (use-local-map ddx-mode-map)
   (set-syntax-table ddx-mode-syntax-table)
   (set (make-local-variable 'ddx-highlighted-label) nil)
   (ddx-collect-labels)
   (ddx-reset-timer)
   (require 'javadoc))

(defun smali-mode ()
  (interactive)
  (let ((ddx-label-re "^\s *:\\([a-zA-Z0-9_]+\\)"))
    (ddx-mode)))

(add-to-list 'auto-mode-alist (cons "\\.ddx$" 'ddx-mode))

