parser state



What problem are you trying to solve? Is there a bug you're trying to fix?
A change/extension you'd like to program? Or are you just trying to
understand the system?

            -s


On Wed, Nov 27, 2013 at 1:36 PM, Leo Butler
<l_butler at users.sourceforge.net>wrote:

>
> Is there a way to inspect the state of the parser that I am missing?
> Specifically, I would like to have access to the string of characters
> that constitute a line of input.
>
> Here is what I wrote, but I would like to know if this state is not
> already available and I am just missing something obvious.
>
> Leo
>
>
> (defvar *parse-tyi-sf-fun* (symbol-function 'parse-tyi))
> (defvar *parse-stack* '())
> (defvar *parse-current-input-line* '())
>
> (defun parse-tyi ()
>   (declare (special *parse-stack* *parse-tyi* *parse-current-input-line*))
>   (let ((c (funcall *parse-tyi-sf-fun*)))
>     (push c *parse-stack*)
>     (push c *parse-current-input-line*)
>     ;; faulty: ignores quotes
>     (cond ((member c '(#\; #\$))
>            (setf (get (makelabel $inchar) '$input) (coerce (reverse
> *parse-current-input-line*) 'string)
>                  *parse-current-input-line* '()))
>           (t nil))
>     c))
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>