Re: latex grammar

bonzini@gnu.org (Paolo Bonzini)
3 Apr 2004 09:12:53 -0500

          From comp.compilers

Related articles
latex grammar journey@op.pl (Lukasz) (2004-03-26)
Re: latex grammar boldyrev+nospam@cgitftp.uiggm.nsc.ru (Ivan Boldyrev) (2004-04-03)
Re: latex grammar dmaze@mit.edu (David Z Maze) (2004-04-03)
Re: latex grammar haberg@matematik.su.se (2004-04-03)
Re: latex grammar gah@ugcs.caltech.edu (glen herrmannsfeldt) (2004-04-03)
Re: latex grammar bonzini@gnu.org (2004-04-03)
Re: latex grammar theo@engr.mun.ca (Theodore Norvell) (2004-04-14)
Re: latex grammar James.Leifer@inria.fr (James Leifer) (2004-04-14)
| List of all articles for this month |
From: bonzini@gnu.org (Paolo Bonzini)
Newsgroups: comp.compilers,comp.compilers.tools.javacc
Date: 3 Apr 2004 09:12:53 -0500
Organization: http://groups.google.com
References: 04-03-099
Keywords: parse
Posted-Date: 03 Apr 2004 09:12:53 EST

> Where can I find grammar for latex so I can create parser?
> Thanks for any advices.


LaTeX is interpreted and it is pretty much impossible to create a
complete parser for it. It should be possible (and fairly easy, I'd
say) to support a streamlined version without macros (except very
simple ones -- no \ifs, no \futurelet, no \expandafter, no token
registers, etc.), catcodes (again except possibly some easy ones), and
most of TeX complexities (\hbox/\vbox, \halign, only very simple
glues, \specials, leaders, marks, insertions, etc. etc.). In other
words, expect to hardcode in your parser something to support for
every LaTeX package you care about.


Paolo



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.