Is there a TeX grammar that parses simple constructs like document, enumerate, section, subsection, etc.? I'm not interested in parsing complicated constructs requiring a more complex computational model.
Asked
Active
Viewed 478 times
1 Answers
2
Short answer, no.
longer answer there are of course grammars for various subsets. One possible starting point would be the flex source of the tex grammar used by the tth system. It's not that accurate for modern real world latex files, but it will parse a core subset well enough (or at least it used to, I haven't tried it for a long time)/
David Carlisle
- 757,742
-
Thanks, I'm working on it now and I'll post it as an answer when I'm done. – Neil G Feb 11 '15 at 19:56
-
Where is the flex file? I looked in the source for tth and ttm but only found the flex output as a C file. Thanks! – cxw Jun 23 '15 at 13:42
-
@cxw I haven't looked for 10 years or so, I thought that I remembered it used to be public perhaps it's been withdrawn, you'd need to ask the author. – David Carlisle Jun 23 '15 at 15:56