Hi,
To avoid restarting Emacs after pressing C-c C-c, you can do the
following steps:
In the generated file, such as wisent-php-wy.el, you would move the
part of the file that you may have changed, and press C-M-x. The
C-M-x is `eval-defun', and will case the variable created by the
wisent compiler-compiler to be reset.
Once you have reset the value of the particular part of the grammar
you changed, switch to a buffer with you PHP code, and reinitialize
that buffer. Usually this is something like
M-x revert-buffer RET ; a big hammer
or
M-x php-mode RET ; a smaller hammer
or
M-: (wisent-php-why--install-parser) RET ; small boot
I usually just call the mode-function.
Of course, you need to know what part of the grammar you edited to use
C-M-x on the correct piece.
The --keyword-table is modified if you changed any %keyword entries.
The --token-table is modified if you changed any %token entries.
The --parse-table is modified if you change the grammar.
The define-lex is modified if you change that explicit code in the .wy
file.
This used to be fully automated, but it was a bit fragile with some
bad unintended consequences making it impossible to do anything, and
removed some time ago.
Good Luck
Eric
>>> "Mike Rowse" <MR@...> seems to think that:
>Hi,
>
>This is perhaps a good moment to ask something that I have been =
>wondering about that is related. What is the best process to develop a =
>grammar?
>
>I do not have a comp sci degree and so I am left with reading and =
>tinkering to understand how to make minor fixes to the PHP wisent =
>grammar. In particular I have a few expressions (that are used =
>frequently in the CMS) that break further processing of the buffer in =
>which they are in.
>
>
>The only way I can figure out how to make changes is the following =
>process:
>
>1. make the change
>2. C-c C-c to re-compile the wisent grammar.
>3. quit emacs
>4. start emacs again
>
>Do you work with grammars in a more interactive way? I presume that the =
>generated parsers must be constants to save cpu power? Thus there is no =
>conceivable way to edit a grammar and see the results in the same Emacs =
>session?
>
--
Eric Ludlam: eric@...
Siege: http://www.siege-engine.com Emacs: http://cedet.sourceforge.net
|