Re: Basic question about creating a parser
Eric Abrahamsen <[email protected]> Sat, 29 Apr 2017 17:30:56 -0700
| Newsgroups | gmane.emacs.semantic |
|---|---|
| Message-ID | <[email protected]> |
On 04/29/17 18:03 PM, Eric Ludlam wrote: [...] > Hi Eric, > > Sorry for a slow response. Kids are pretty time consuming. No worries, I appreciate the pointers! > The semantic tools is a great way to build a parser for a language. I > recommend the 'wisent' parser generator, as it is faster than the > original bovine version. The wisent manual has some nice examples in > it for building a language. The goal of any of these parsers is to > create a 'tag' which is then used for code analysis. If you want to > create a parser with some other struture output, that is also > possible. The example semantic/wisent/calc.wy and > semantic/wisent/calc.el shows a calculator parser that does the math > instead of generating tags, so it might be a nice example. Okay, thanks. The calc.el/wy example is very helpful. I'd assumed that wisent would be overkill for my use-case, but faster would certainly be better. I hope I might be able to use this to, for example, reasonably quickly parse a file of several hundred vCard contacts into EIEIO object instances. The calc.wy file indicates that I could make object creation part of the actual parsing process (the way that calc.wy does the math as it parses), so that's encouraging. Thanks again, Eric ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot