• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/emacs-93/emacs/lisp/progmodes/

Lines Matching +defs:list +defs:unique

92 (defvar ebnf-empty-rule-list nil
96 (defun ebnf-add-empty-rule-list (rule)
97 "Add empty RULE in `ebnf-empty-rule-list'."
101 (setq ebnf-empty-rule-list (cons (ebnf-node-name rule)
102 ebnf-empty-rule-list))))
107 (setq ebnf-empty-rule-list nil))
115 (defun ebnf-eliminate-empty-rules (syntax-list)
117 (while ebnf-empty-rule-list
118 (let ((ebnf-total (length syntax-list))
120 (prod-list syntax-list)
121 new-list before)
122 (while prod-list
124 (let ((rule (car prod-list)))
125 ;; if any non-terminal pertains to ebnf-empty-rule-list
128 (setq before prod-list)
129 ;; eliminate empty rule from syntax-list
130 (setq new-list (cons (ebnf-node-name rule) new-list))
132 (setcdr before (cdr prod-list))
133 (setq syntax-list (cdr syntax-list)))))
134 (setq prod-list (cdr prod-list)))
135 (setq ebnf-empty-rule-list new-list)))
136 syntax-list)
140 ;; [sequence width-func entry height width list]
141 ;; [alternative width-func entry height width list]
152 (if (member (ebnf-node-name rule) ebnf-empty-rule-list)
157 (let ((seq (ebnf-node-list rule))
158 (header (ebnf-node-list rule))
169 (ebnf-node-list rule header)
173 (let ((seq (ebnf-node-list rule))
174 (header (ebnf-node-list rule))
187 (ebnf-node-list rule header)
241 (defun ebnf-optimize (syntax-list)
244 syntax-list
245 (let ((ebnf-total (length syntax-list))
248 (while syntax-list
249 (setq new (cons (ebnf-optimize1 (car syntax-list)) new)
250 syntax-list (cdr syntax-list)))
275 (ebnf-node-list production)
301 (nnode (ebnf-map-list-to-optional nlist)))
303 (setq nlist (list nnode)))
310 (list (or (ebnf-prefix-suffix nlist)
326 (defun ebnf-split-header-prefix (node-list header)
327 (let* ((hlist (ebnf-split-header-prefix1 node-list header))
334 (let ((seq (cdr (ebnf-node-list elt))))
337 (ebnf-node-list elt seq)
347 (defun ebnf-split-header-prefix1 (node-list header)
349 (while node-list
350 (if (ebnf-node-equal-header (car node-list) header)
351 (setq hlist (cons (car node-list) hlist))
352 (setq nlist (cons (car node-list) nlist)))
353 (setq node-list (cdr node-list)))
361 (ebnf-node-equal-header (car (ebnf-node-list node)) header))
371 (ebnf-map-list-to-optional (ebnf-node-list node))))
374 (defun ebnf-map-list-to-optional (nlist)
431 (let* ((lis (ebnf-unique-list new))
452 (let ((nl (ebnf-node-list ne))
453 (zl (ebnf-node-list ze))
469 (let* ((zl (ebnf-node-list ze))
497 (list (or (ebnf-map-list-to-optional middle)
506 (ebnf-node-list (car lis))
507 (list (car lis))))
513 (ebnf-node-list (car tail))
514 (list (car tail))))
540 (ebnf-node-list (car lis) tail))
547 (setq rest (nthcdr ipre (ebnf-node-list elt))))
551 (ebnf-node-list elt rest))
558 (cons prefix (ebnf-unique-list
560 (nconc lis (list (ebnf-make-empty)))
569 (ebnf-node-list (car lis))
570 (list (car lis)))))
577 (ebnf-node-list (car tail))
578 (list (car tail)))))
608 (ebnf-node-list (car lis) tail))
615 (setq rest (ebnf-node-list elt)
622 (ebnf-node-list elt rest))
629 (cons suffix (ebnf-unique-list
631 (nconc lis (list (ebnf-make-empty)))
635 (defun ebnf-unique-list (nlist)
672 (let ((listA (ebnf-node-list A))
673 (listB (ebnf-node-list B)))