On 11/07/11 17:53, Charles Strahan wrote:
Hello,

Is the Vim Script grammar documented anywhere? I'd like to write a parser.

(Searching for "vim script grammar/parser" brings up grammars/parsers
written _in_ vim script, unfortunately...)


Thanks!

-Charles

In addition to all good answers already present in this thread, I'll add the following:

- AFAIK, a "formal grammar" for Vim script has never been written (and if you start writing one now, it will quite possibly be obsolete by the time you finish writing it, because new features will have been added in the meantime). The sum total of the help files constitute a sort of "unformal" but detailed grammar which is quite good enough for users of Vim.

What I've seen that comes closest to a formal grammar for _part_ of Vim script is Section 2 of pattern.txt (see :help pattern). It is the single section in the whole help which I find the most abtruse, that is the least understandable for the common folk.

- IMHO, the "best" interpreter for Vim script language will always be Vim itself. Why? Because any other "imitation" interpreter will be hard put to implement bug fixes and new features as fast as Vim does, and any user of such an interpreter is bound to find it deficient compared to Bram's masterwork.

- If you're on Windows, you can use the OLE interface to communicate with Vim, see :help if_ole.txt

- On other platforms, it's harder to have an interactive Vim running as if it were part of your application, but you can run "gvim -f filename" as a subprocess and continue when the subprocess terminates. (Without -f or the equivalent --nofork you would restart much too early, see :help gui-fork)


Best regards,
Tony.
--
"To be responsive at this time, though I will simply say, and therefore
this is a repeat of what I said previously, that which I am unable to
offer in response is based on information available to make no such
statement."

--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to