Function: wisent-production-bounds

wisent-production-bounds is a byte-compiled function defined in wisent.el.gz.

Signature

(wisent-production-bounds STACK I J)

Documentation

Determine the start and end locations of a production value.

Return a pair (START . END), where START is the first available start location, and END the last available end location, in components values of the rule currently reduced. Return nil when no component location is available. STACK is the parser stack. I and J are the indices in STACK of respectively the value of the first and last components of the current rule. This function is for internal use by semantic actions' generated lambda-expression.

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/semantic/wisent/wisent.el.gz
;;; Core parser engine
(defsubst wisent-production-bounds (stack i j)
  "Determine the start and end locations of a production value.
Return a pair (START . END), where START is the first available start
location, and END the last available end location, in components
values of the rule currently reduced.
Return nil when no component location is available.
STACK is the parser stack.
I and J are the indices in STACK of respectively the value of the
first and last components of the current rule.
This function is for internal use by semantic actions' generated
lambda-expression."
  (let ((f (cadr (aref stack i)))
        (l (cddr (aref stack j))))
    (while (/= i j)
      (cond
       ((not f) (setq f (cadr (aref stack (setq i (+ i 2))))))
       ((not l) (setq l (cddr (aref stack (setq j (- j 2))))))
       ((setq i j))))
    (and f l (cons f l))))