(eval-when-compile
(let ((load-path
(if (and (boundp 'byte-compile-dest-file)
(stringp byte-compile-dest-file))
(cons (file-name-directory byte-compile-dest-file) load-path)
load-path)))
(require 'cc-bytecomp)))
(cc-require 'cc-defs)
(cc-require 'cc-vars)
(defvar c-buffer-is-cc-mode nil
"Non-nil for all buffers with a `major-mode' derived from CC Mode.
Otherwise, this variable is nil. I.e. this variable is non-nil for
`c-mode', `c++-mode', `objc-mode', `java-mode', `idl-mode',
`pike-mode', and any other non-CC Mode mode that calls
`c-initialize-cc-mode' (e.g. `awk-mode').")
(make-variable-buffer-local 'c-buffer-is-cc-mode)
(put 'c-buffer-is-cc-mode 'permanent-local t)
(defconst c-symbol-key "[_a-zA-Z]\\(\\w\\|\\s_\\)*")
(defconst c-C-primitive-type-kwds
"char\\|double\\|float\\|int\\|long\\|short\\|signed\\|unsigned\\|void")
(defconst c-C++-primitive-type-kwds c-C-primitive-type-kwds)
(defconst c-ObjC-primitive-type-kwds c-C-primitive-type-kwds)
(defconst c-Java-primitive-type-kwds
"boolean\\|byte\\|char\\|double\\|float\\|int\\|long\\|short\\|void")
(defconst c-IDL-primitive-type-kwds c-C-primitive-type-kwds)
(defconst c-Pike-primitive-type-kwds
(concat "constant\\|float\\|int\\|mapping\\|multiset\\|object\\|"
"program\\|string\\|void"))
(defconst c-C-specifier-kwds
"auto\\|const\\|extern\\|register\\|static\\|volatile")
(defconst c-C++-specifier-kwds
(concat c-C-specifier-kwds "\\|friend\\|inline\\|virtual"))
(defconst c-ObjC-specifier-kwds c-C++-specifier-kwds)
(defconst c-Java-specifier-kwds
(concat "abstract\\|const\\|final\\|native\\|private\\|protected\\|"
"public\\|static\\|synchronized\\|transient\\|volatile"))
(defconst c-IDL-specifier-kwds c-C++-specifier-kwds)
(defconst c-Pike-specifier-kwds
(concat "final\\|inline\\|local\\|nomask\\|optional\\|private\\|"
"protected\\|static\\|variant"))
(defconst c-C-class-kwds "struct\\|union")
(defconst c-C++-class-kwds (concat c-C-class-kwds "\\|class"))
(defconst c-ObjC-class-kwds "interface\\|implementation")
(defconst c-Java-class-kwds "class\\|interface")
(defconst c-IDL-class-kwds
(concat c-C++-class-kwds "\\|interface\\|valuetype"))
(defconst c-Pike-class-kwds "class")
(defconst c-C-extra-toplevel-kwds "extern")
(defconst c-C++-extra-toplevel-kwds
(concat c-C-extra-toplevel-kwds "\\|namespace"))
(defconst c-IDL-extra-toplevel-kwds "module")
(defconst c-C-other-decl-kwds "enum\\|typedef")
(defconst c-C++-other-decl-kwds (concat c-C-other-decl-kwds "\\|template"))
(defconst c-Java-other-decl-kwds "import\\|package")
(defconst c-Pike-other-decl-kwds "import\\|inherit")
(defconst c-Java-decl-level-kwds "extends\\|implements\\|throws")
(defconst c-C++-protection-kwds "private\\|protected\\|public")
(defconst c-ObjC-protection-kwds c-C++-protection-kwds)
(defconst c-C-block-stmt-1-kwds "do\\|else")
(defconst c-C++-block-stmt-1-kwds
(concat c-C-block-stmt-1-kwds "\\|asm\\|try"))
(defconst c-ObjC-block-stmt-1-kwds c-C++-block-stmt-1-kwds)
(defconst c-Java-block-stmt-1-kwds
(concat c-C-block-stmt-1-kwds "\\|finally\\|try"))
(defconst c-Pike-block-stmt-1-kwds c-C-block-stmt-1-kwds)
(defconst c-C-block-stmt-2-kwds "for\\|if\\|switch\\|while")
(defconst c-C++-block-stmt-2-kwds (concat c-C-block-stmt-2-kwds "\\|catch"))
(defconst c-ObjC-block-stmt-2-kwds c-C++-block-stmt-2-kwds)
(defconst c-Java-block-stmt-2-kwds
(concat c-C++-block-stmt-2-kwds "\\|synchronized"))
(defconst c-Pike-block-stmt-2-kwds c-C-block-stmt-2-kwds)
(defconst c-C-simple-stmt-kwds "break\\|continue\\|goto\\|return")
(defconst c-C++-simple-stmt-kwds c-C-simple-stmt-kwds)
(defconst c-ObjC-simple-stmt-kwds c-C-simple-stmt-kwds)
(defconst c-Java-simple-stmt-kwds
(concat c-C-simple-stmt-kwds "\\|throw"))
(defconst c-Pike-simple-stmt-kwds "break\\|continue\\|return")
(defconst c-C-label-kwds "case\\|default")
(defconst c-C++-label-kwds c-C-label-kwds)
(defconst c-ObjC-label-kwds c-C-label-kwds)
(defconst c-Java-label-kwds c-C-label-kwds)
(defconst c-Pike-label-kwds c-C-label-kwds)
(defconst c-C-expr-kwds "sizeof")
(defconst c-C++-expr-kwds
(concat c-C-expr-kwds "\\|delete\\|new\\|operator\\|this\\|throw"))
(defconst c-ObjC-expr-kwds c-C-expr-kwds)
(defconst c-Java-expr-kwds "instanceof\\|new\\|super\\|this")
(defconst c-Pike-expr-kwds
(concat c-C-expr-kwds "\\|catch\\|class\\|gauge\\|lambda\\|predef"))
(defconst c-C-keywords
(concat c-C-primitive-type-kwds "\\|" c-C-specifier-kwds
"\\|" c-C-class-kwds "\\|" c-C-extra-toplevel-kwds
"\\|" c-C-other-decl-kwds
"\\|" c-C-block-stmt-1-kwds "\\|" c-C-block-stmt-2-kwds
"\\|" c-C-simple-stmt-kwds "\\|" c-C-label-kwds
"\\|" c-C-expr-kwds))
(defconst c-C++-keywords
(concat c-C++-primitive-type-kwds "\\|" c-C++-specifier-kwds
"\\|" c-C++-class-kwds "\\|" c-C++-extra-toplevel-kwds
"\\|" c-C++-other-decl-kwds
"\\|" c-C++-protection-kwds
"\\|" c-C++-block-stmt-1-kwds "\\|" c-C++-block-stmt-2-kwds
"\\|" c-C++-simple-stmt-kwds "\\|" c-C++-label-kwds
"\\|" c-C++-expr-kwds))
(defconst c-ObjC-keywords
(concat c-ObjC-primitive-type-kwds "\\|" c-ObjC-specifier-kwds
"\\|" c-ObjC-class-kwds
"\\|" c-ObjC-protection-kwds
"\\|" c-ObjC-block-stmt-1-kwds "\\|" c-ObjC-block-stmt-2-kwds
"\\|" c-ObjC-simple-stmt-kwds "\\|" c-ObjC-label-kwds
"\\|" c-ObjC-expr-kwds))
(defconst c-Java-keywords
(concat c-Java-primitive-type-kwds "\\|" c-Java-specifier-kwds
"\\|" c-Java-class-kwds
"\\|" c-Java-other-decl-kwds "\\|" c-Java-decl-level-kwds
"\\|" c-Java-block-stmt-1-kwds "\\|" c-Java-block-stmt-2-kwds
"\\|" c-Java-simple-stmt-kwds "\\|" c-Java-label-kwds
"\\|" c-Java-expr-kwds))
(defconst c-IDL-keywords
(concat c-IDL-primitive-type-kwds "\\|" c-IDL-specifier-kwds
"\\|" c-IDL-class-kwds "\\|" c-IDL-extra-toplevel-kwds
))
(defconst c-Pike-keywords
(concat c-Pike-primitive-type-kwds "\\|" c-Pike-specifier-kwds
"\\|" c-Pike-class-kwds
"\\|" c-Pike-other-decl-kwds
"\\|" c-Pike-block-stmt-1-kwds "\\|" c-Pike-block-stmt-2-kwds
"\\|" c-Pike-simple-stmt-kwds "\\|" c-Pike-label-kwds
"\\|" c-Pike-expr-kwds))
(defvar c-keywords nil)
(make-variable-buffer-local 'c-keywords)
(defconst c-protection-key "\\<\\(public\\|protected\\|private\\)\\>")
(defconst c-C-class-key (c-paren-re c-C-class-kwds))
(defconst c-C++-class-key (c-paren-re c-C++-class-kwds))
(defconst c-IDL-class-key (c-paren-re c-IDL-class-kwds))
(defconst c-ObjC-class-key
(concat
"@\\(" c-ObjC-class-kwds "\\)\\s +"
c-symbol-key "\\(\\s *:\\s *" c-symbol-key "\\)?" "\\(\\s *<[^>]+>\\)?" ))
(defconst c-Java-class-key
(concat
"\\(" c-protection-key "\\s +\\)?"
"\\(" c-Java-class-kwds "\\)\\s +"
c-symbol-key "\\(\\s *extends\\s *" c-symbol-key "\\)?" ))
(defconst c-Pike-class-key (c-paren-re c-Pike-class-kwds))
(defvar c-class-key c-C-class-key)
(make-variable-buffer-local 'c-class-key)
(defconst c-C-extra-toplevel-key (c-paren-re c-C-extra-toplevel-kwds))
(defconst c-C++-extra-toplevel-key (c-paren-re c-C++-extra-toplevel-kwds))
(defconst c-IDL-extra-toplevel-key (c-paren-re c-IDL-extra-toplevel-kwds))
(defvar c-extra-toplevel-key c-C-extra-toplevel-key)
(make-variable-buffer-local 'c-extra-toplevel-key)
(defconst c-C-bitfield-key "\\(char\\|int\\|long\\|signed\\|unsigned\\)")
(defvar c-bitfield-key nil)
(make-variable-buffer-local 'c-bitfield-key)
(defvar c-access-key nil)
(make-variable-buffer-local 'c-access-key)
(defconst c-C++-access-key
(concat "\\<\\(" c-C++-protection-kwds "\\)\\>[ \t]*:"))
(defconst c-ObjC-access-key (concat "@" c-protection-key))
(defconst c-C-conditional-key nil)
(defconst c-C++-conditional-key nil)
(defconst c-IDL-conditional-key nil)
(defconst c-ObjC-conditional-key nil)
(defconst c-Java-conditional-key nil)
(defconst c-Pike-conditional-key nil)
(let ((all-kws "for\\|if\\|do\\|else\\|while\\|switch")
(exc-kws "\\|try\\|catch")
(thr-kws "\\|finally\\|synchronized")
(front "\\<\\(")
(back "\\)\\>[^_]"))
(setq c-C-conditional-key (concat front all-kws back)
c-C++-conditional-key (concat front all-kws exc-kws back)
c-ObjC-conditional-key c-C-conditional-key
c-Java-conditional-key (concat front all-kws exc-kws thr-kws back)
c-Pike-conditional-key (concat front all-kws "\\|foreach" back)))
(defvar c-conditional-key c-C-conditional-key)
(make-variable-buffer-local 'c-conditional-key)
(defvar c-method-key nil)
(make-variable-buffer-local 'c-method-key)
(defconst c-ObjC-method-key
(concat
"^\\s *[+-]\\s *"
"\\(([^)]*)\\)?" "[ \t\n]*" c-symbol-key))
(defconst c-C++-comment-start-regexp "/[/*]")
(defconst c-C-comment-start-regexp c-C++-comment-start-regexp)
(defconst c-IDL-comment-start-regexp c-C++-comment-start-regexp)
(defconst c-ObjC-comment-start-regexp c-C++-comment-start-regexp)
(defconst c-Pike-comment-start-regexp c-C++-comment-start-regexp)
(defconst c-Java-comment-start-regexp "/\\(/\\|[*][*]?\\)")
(defvar c-comment-start-regexp c-C++-comment-start-regexp)
(make-variable-buffer-local 'c-comment-start-regexp)
(defconst c-switch-label-key "\\(\\(case[( \t]+\\S .*\\)\\|default[ \t]*\\):")
(defconst c-label-key (concat c-symbol-key ":\\([^:]\\|$\\)"))
(defconst c-inher-key
(concat "\\(\\<static\\>\\s +\\)?"
c-C++-class-key "[ \t]+" c-symbol-key
"\\([ \t]*:[ \t]*\\)\\s *[^;]"))
(defvar c-baseclass-key
(concat
":?[ \t]*\\(virtual[ \t]+\\)?\\("
c-protection-key "[ \t]+\\)" c-symbol-key))
(make-variable-buffer-local 'c-baseclass-key)
(defconst c-C++-friend-key
"friend[ \t]+\\|template[ \t]*<.+>[ \t]*friend[ \t]+")
(defconst c-Java-special-key "\\(implements\\|extends\\|throws\\)[^_]")
(defconst c-Java-defun-prompt-regexp
"^[ \t]*\\(\\(\\(public\\|protected\\|private\\|const\\|abstract\\|synchronized\\|final\\|static\\|threadsafe\\|transient\\|native\\|volatile\\)\\s-+\\)*\\(\\(\\([[a-zA-Z][][_$.a-zA-Z0-9]*[][_$.a-zA-Z0-9]+\\|[[a-zA-Z]\\)\\s-*\\)\\s-+\\)\\)?\\(\\([[a-zA-Z][][_$.a-zA-Z0-9]*\\s-+\\)\\s-*\\)?\\([_a-zA-Z][^][ \t:;.,{}()=]*\\|\\([_$a-zA-Z][_$.a-zA-Z0-9]*\\)\\)\\s-*\\(([^);{}]*)\\)?\\([] \t]*\\)\\(\\s-*\\<throws\\>\\s-*\\(\\([_$a-zA-Z][_$.a-zA-Z0-9]*\\)[, \t\n\r\f]*\\)+\\)?\\s-*")
(defvar c-append-paragraph-start "$")
(make-variable-buffer-local 'c-append-paragraph-start)
(defconst c-Java-javadoc-paragraph-start
"\\(@[a-zA-Z]+\\>\\|$\\)")
(defconst c-Pike-pikedoc-paragraph-start
"\\(@[a-zA-Z]+\\>\\([^{]\\|$\\)\\|$\\)")
(defvar c-append-paragraph-separate "$")
(make-variable-buffer-local 'c-append-paragraph-separate)
(defconst c-Pike-pikedoc-paragraph-separate c-Pike-pikedoc-paragraph-start)
(defvar c-lambda-key nil)
(make-variable-buffer-local 'c-lambda-key)
(defconst c-Pike-lambda-key "\\<lambda\\>")
(defvar c-inexpr-block-key nil)
(make-variable-buffer-local 'c-inexpr-block-key)
(defconst c-Pike-inexpr-block-key "\\<\\(catch\\|gauge\\)\\>")
(defvar c-inexpr-class-key nil)
(make-variable-buffer-local 'c-inexpr-class-key)
(defconst c-Java-inexpr-class-key "\\<new\\>")
(defconst c-Pike-inexpr-class-key "\\<class\\>")
(defvar c-special-brace-lists nil)
(make-variable-buffer-local 'c-special-brace-lists)
(defconst c-Pike-special-brace-lists '((?{ . ?})
(?\[ . ?\])
(?< . ?>)))
(defun c-populate-syntax-table (table)
(modify-syntax-entry ?_ "_" table)
(modify-syntax-entry ?\\ "\\" table)
(modify-syntax-entry ?+ "." table)
(modify-syntax-entry ?- "." table)
(modify-syntax-entry ?= "." table)
(modify-syntax-entry ?% "." table)
(modify-syntax-entry ?< "." table)
(modify-syntax-entry ?> "." table)
(modify-syntax-entry ?& "." table)
(modify-syntax-entry ?| "." table)
(modify-syntax-entry ?\' "\"" table)
(cond
((memq '8-bit c-emacs-features)
(modify-syntax-entry ?/ ". 1456" table)
(modify-syntax-entry ?* ". 23" table))
((memq '1-bit c-emacs-features)
(modify-syntax-entry ?/ ". 124b" table)
(modify-syntax-entry ?* ". 23" table))
(t (error "CC Mode is incompatible with this version of Emacs"))
)
(modify-syntax-entry ?\n "> b" table)
(modify-syntax-entry ?\^m "> b" table))
(defvar c-mode-syntax-table nil
"Syntax table used in c-mode buffers.")
(if c-mode-syntax-table
()
(setq c-mode-syntax-table (make-syntax-table))
(c-populate-syntax-table c-mode-syntax-table))
(defvar c++-mode-syntax-table nil
"Syntax table used in c++-mode buffers.")
(if c++-mode-syntax-table
()
(setq c++-mode-syntax-table (make-syntax-table))
(c-populate-syntax-table c++-mode-syntax-table)
)
(defvar c++-template-syntax-table nil
"A variant of `c++-mode-syntax-table' that defines `<' and `>' as
parenthesis characters. Used temporarily when template argument lists
are parsed.")
(if c++-template-syntax-table
()
(setq c++-template-syntax-table
(copy-syntax-table c++-mode-syntax-table))
(modify-syntax-entry ?< "(>" c++-template-syntax-table)
(modify-syntax-entry ?> ")<" c++-template-syntax-table))
(defvar objc-mode-syntax-table nil
"Syntax table used in objc-mode buffers.")
(if objc-mode-syntax-table
()
(setq objc-mode-syntax-table (make-syntax-table))
(c-populate-syntax-table objc-mode-syntax-table)
(modify-syntax-entry ?@ "_" objc-mode-syntax-table))
(defvar java-mode-syntax-table nil
"Syntax table used in java-mode buffers.")
(if java-mode-syntax-table
()
(setq java-mode-syntax-table (make-syntax-table))
(c-populate-syntax-table java-mode-syntax-table))
(defvar idl-mode-syntax-table nil
"Syntax table used in idl-mode buffers.")
(if idl-mode-syntax-table
nil
(setq idl-mode-syntax-table (make-syntax-table))
(c-populate-syntax-table idl-mode-syntax-table))
(defvar pike-mode-syntax-table nil
"Syntax table used in pike-mode buffers.")
(if pike-mode-syntax-table
()
(setq pike-mode-syntax-table (make-syntax-table))
(c-populate-syntax-table pike-mode-syntax-table)
(modify-syntax-entry ?@ "." pike-mode-syntax-table))
(defvar c-hungry-delete-key nil)
(make-variable-buffer-local 'c-hungry-delete-key)
(defvar c-auto-newline nil)
(make-variable-buffer-local 'c-auto-newline)
(defvar c-auto-hungry-string nil)
(make-variable-buffer-local 'c-auto-hungry-string)
(defvar c-recognize-knr-p t)
(make-variable-buffer-local 'c-recognize-knr-p)
(cc-provide 'cc-langs)