How to parse blocks lead by spaces
Dan Bloomquist <[email protected]> Sat, 24 Mar 2018 13:32:45 -0700
| Newsgroups | gmane.comp.parsers.spirit.general |
|---|---|
| Message-ID | <[email protected]> |
So, I gave up on VS2015. I've installed 2017 on my desk top for spirit. What I'm out to do is parse a decompressed BXL file into my object. <http://lakeweb.net/content/bxl_output.txt> Question: Scoping is done with leading spaces. I've searched but still at a loss as to the right way to do it. My first thought is to read leading spaces and create an index. The only stuff I want to parse at first is the 'TextStyle' and 'Symbol' blocks. So skip 'unknown' blocks for now, add them later as needed. ~~~~ I do want to avoid semantic actions as much as possible but they may be unavoidable. This: <https://stackoverflow.com/questions/49246414/dynamically-switching-symbol-tables-in-x3/49269239#49269239> Is one of the best starting points I've found for the likes of what I'm after. And from there, an x3::symbols table?? Reason, I am parsing Pins now but with the assumption that the order of the sub objects is consistent. That I should parse with any order acceptable as I did in 'extra info'. ~~~~ extra info It has been a couple of years since I've worked with spirit. Here I think I've done a decent job with the front end but the back end became quite the ad hoc. <https://github.com/lakeweb/PCBEdit/blob/master/SpiritParsers.h> The source file looks like: <http://lakeweb.net/content/ecc83-pp.kicad_pcb> pudding proof( not from the same file) <http://lakeweb.net/content/ScreenShot.png> Thanks, Dan. ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot