• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/emacs-92/emacs/lisp/progmodes/

Lines Matching +defs:body +defs:file

11 ;; This file is part of GNU Emacs.
24 ;; along with GNU Emacs; see the file COPYING. If not, write to the
72 ;; This file requires Emacs-20.3, XEmacs-20.4 or higher and package cc-mode.
74 ;; If antlr-mode is not part of your distribution, put this file into your
152 (defmacro ignore-errors-x (&rest body)
156 (null (cdr body)) (consp (car body))
157 (setq spec (assq (caar body) specials))
158 (>= (setq nils (- (cdr spec) (length (car body)))) 0))
159 `(,@(car body) ,@(make-list nils nil) t)
160 `(ignore-errors ,@body)))))
164 (defmacro save-buffer-state-x (&rest body) ; similar to EMACS/lazy-lock.el
172 buffer-file-name buffer-file-truename)
173 ,@body)
224 variable list\" near the end of the file, see
287 whose REGEXP is nil or matches variable `buffer-file-name' is used to
344 it includes four submenus to insert file/grammar/rule/subrule options."
407 (defvar antlr-options-headings '("file" "grammar" "rule" "subrule")
409 The standard value is (\"file\" \"grammar\" \"rule\" \"subrule\"). See
413 '(;; file options ----------------------------------------------------------
542 defines a file/grammar/rule/subrule option with name OPTION-NAME. The
609 the file names of all makefile rules. GEN-VAR-FORMAT is a format string
622 (defvar antlr-file-formats-alist
631 `antlr-special-file-formats' for language independent files.
634 VOCAB/%s the generated file for each export vocabulary VOCAB.
636 CLASS/%s the generated file for each grammar class CLASS.")
638 (defvar antlr-special-file-formats '("%sTokenTypes.txt" "expanded%s.g")
643 VOCAB/%s the generated or input file for each export or import
646 grammar file if the file GRAMMAR.g contains a grammar class which
649 See variable `antlr-file-formats-alist' for language dependent
652 (defvar antlr-unknown-file-formats '("?%s?.g" "?%s?")
657 SUPER/%s the name of a grammar file for Antlr's option \"-glib\" if no
658 grammar file in the current directory defines the class SUPER or if it
663 (defvar antlr-help-unknown-file-text
666 ## where SUPERCLASS is not found to be defined in any grammar file of
670 See \\[antlr-show-makefile-rules] and `antlr-unknown-file-formats'.")
701 (define-key map "\C-c\C-a" 'antlr-beginning-of-body)
702 (define-key map "\C-c\C-e" 'antlr-end-of-body)
745 ["Start of Rule Body" antlr-beginning-of-body
747 ["End of Rule Body" antlr-end-of-body
1031 (defmacro antlr-with-syntax-table (syntab &rest body)
1035 (progn (set-syntax-table ,syntab) ,@body)
1038 (put 'antlr-with-syntax-table 'edebug-form-spec '(form body))
1268 (antlr-skip-file-prelude t)
1324 (defun antlr-skip-file-prelude (skip-comment)
1325 "Skip the file prelude: the header and file options.
1327 Return the start position of the file prelude.
1346 A grammar class header and the file prelude are also considered as a
1360 (antlr-skip-file-prelude skip-comment))
1369 ;; try file prelude:
1370 (setq pos (antlr-skip-file-prelude skip-comment))
1406 A grammar class header and the file prelude are also considered as a
1414 A grammar class header and the file prelude are also considered as a
1416 rule. If ARG is zero, run `antlr-end-of-body'."
1419 (antlr-end-of-body)
1425 A grammar class header and the file prelude are also considered as a
1427 of rule. If ARG is zero, run `antlr-beginning-of-body'."
1430 (antlr-beginning-of-body)
1434 (defunx antlr-end-of-body (&optional msg)
1444 (when (< (antlr-skip-file-prelude t) (point))
1445 ;; Yes, we are in the file prelude
1447 (error (or msg "The file prelude is without `;'")))
1457 (defunx antlr-beginning-of-body ()
1460 (antlr-end-of-body "Class headers and the file prelude are without `:'"))
1536 "Insert file/grammar/rule/subrule option near point.
1537 LEVEL determines option kind to insert: 1=file, 2=grammar, 3=rule,
1552 valid option to insert into the current file.
1637 (error "Valid prefix args: no=auto, 1=file, 2=grammar, 3=rule, 4=subrule"))
1683 ((eq level 1) ; file options
1685 (setq pos (antlr-skip-file-prelude 'header-only)))
1743 ((save-excursion ; in region of file options?
1745 (antlr-skip-file-prelude t) ; ws/comment after: OK
2086 (defun antlr-file-dependencies ()
2093 FILE is the current buffer's file-name without directory part and
2100 (unless buffer-file-name
2101 (error "Grammar buffer does not visit a file"))
2109 ;; export vocab defaults to class name (first grammar in file)
2110 ;; or to the export vocab of the first grammar in file:
2139 ;; default export vocab is export vocab of first grammar in file:
2145 (list* (file-name-nondirectory buffer-file-name)
2155 FILE-DEP are the dependencies for each grammar file in DIRNAME, see
2156 `antlr-file-dependencies'. For each grammar class CLASS, FILE is a
2157 grammar file in which CLASS is defined and EVOCAB is the name of the
2158 export vocabulary specified in that file."
2165 (cadr antlr-special-file-formats))
2173 (dolist (file grammar)
2174 (when (and (file-regular-p file)
2175 (null (string-match expanded-regexp file)))
2176 (insert-file-contents file t nil nil t)
2180 (let* ((file-deps (antlr-file-dependencies))
2181 (file (car file-deps)))
2182 (when file-deps
2183 (dolist (class-def (caadr file-deps))
2184 (let ((file-evocab (cons file (cdr class-def)))
2187 (nconc (cdr class-spec) (list file-evocab))
2188 (push (list (car class-def) file-evocab)
2190 (push file-deps dependencies)))))))
2202 part SUPER in the result of `antlr-file-dependencies'. CLASSES is the
2207 or more than one grammar file for at least one super grammar.
2209 Each GLIB looks like \(GRAMMAR-FILE \. EVOCAB). GRAMMAR-FILE is a file
2212 ;; If the superclass is defined in the same file, that file will be included
2214 ;; analyzer of the same class twice in a file will lead to an error anyway...
2219 (file (and sup-files (null (cdr sup-files)) (car sup-files))))
2220 (or file (setq unknown t)) ; not exactly one file
2221 (push (cons (or (car file)
2222 (format (car antlr-unknown-file-formats)
2225 (or (cdr file)
2226 (format (cadr antlr-unknown-file-formats)
2232 (defun antlr-run-tool (command file &optional saved)
2243 (let ((default-directory (file-name-directory file)))
2244 (compilation-start (concat command " " (file-name-nondirectory file))
2254 (antlr-file-dependencies)))))
2262 (list (antlr-read-shell-command "Run Antlr on current file with: "
2264 buffer-file-name
2295 (lang (cdr (assoc (cdddr dep) antlr-file-formats-alist))))
2300 (format (cadr antlr-special-file-formats)
2301 (file-name-sans-extension (car dep)))))
2304 (dolist (class-file (cadr lang))
2305 (insert sep (format class-file (car class-def)))
2309 (dolist (vocab-file (cons (car antlr-special-file-formats)
2311 (insert sep (format vocab-file evocab))
2316 (insert " " (format (car antlr-special-file-formats) ivocab)))
2322 (insert " " (format (car antlr-special-file-formats)
2339 (insert antlr-help-unknown-file-text))
2358 If the file for a super-grammar cannot be determined, special file names
2359 are used according to variable `antlr-unknown-file-formats' and a
2360 commentary with value `antlr-help-unknown-file-text' is added. The
2378 - plus 0/2/1, depending on the position inside the rule: header, body,
2417 (setq indent 2)) ; in rule body
2654 (if buffer-file-name
2660 (string-match (cadr elem) buffer-file-name))