diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2014-10-10 08:44:24 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2014-10-10 08:44:24 +0000 |
commit | 56fe72aebb64bb54a4bbaf3edf6673253fafdf24 (patch) | |
tree | e745d5bbd763f04d5208104d8d03abd46e6b2663 /mandoc.h | |
parent | ab00e3652ae08997f4eb0cd41e34c86874cd4eb9 (diff) | |
download | mandoc-56fe72aebb64bb54a4bbaf3edf6673253fafdf24.tar.gz |
Re-write of eqn(7) parser and MathML output.
This adds parser-level support for the grammar described by the eqn
second-edition technical paper, "Typesetting Mathematics — User's Guide"
(Kernighan, Cherry).
The reason for this re-write is the grouping rules, which were not
possible given the existing implementation.
The re-write has also considerably simplified the HTML (and, if it ever
is completed, terminal) front-end.
Diffstat (limited to 'mandoc.h')
-rw-r--r-- | mandoc.h | 31 |
1 files changed, 12 insertions, 19 deletions
@@ -306,21 +306,10 @@ enum eqn_boxt { EQN_ROOT, /* root of parse tree */ EQN_TEXT, /* text (number, variable, whatever) */ EQN_SUBEXPR, /* nested `eqn' subexpression */ - EQN_LIST, /* subexpressions list */ - EQN_MATRIX /* matrix subexpression */ -}; - -enum eqn_markt { - EQNMARK_NONE = 0, - EQNMARK_DOT, - EQNMARK_DOTDOT, - EQNMARK_HAT, - EQNMARK_TILDE, - EQNMARK_VEC, - EQNMARK_DYAD, - EQNMARK_BAR, - EQNMARK_UNDER, - EQNMARK__MAX + EQN_LIST, /* list (braces, etc.) */ + EQN_LISTONE, /* singleton list */ + EQN_PILE, /* vertical pile */ + EQN_MATRIX /* pile of piles */ }; enum eqn_fontt { @@ -334,13 +323,14 @@ enum eqn_fontt { enum eqn_post { EQNPOS_NONE = 0, - EQNPOS_OVER, EQNPOS_SUP, EQNPOS_SUBSUP, EQNPOS_SUB, EQNPOS_TO, EQNPOS_FROM, EQNPOS_FROMTO, + EQNPOS_OVER, + EQNPOS_SQRT, EQNPOS__MAX }; @@ -371,10 +361,13 @@ struct eqn_box { struct eqn_box *prev; /* node sibling */ struct eqn_box *parent; /* node sibling */ char *text; /* text (or NULL) */ - char *left; - char *right; + char *left; /* fence left-hand */ + char *right; /* fence right-hand */ + char *top; /* expression over-symbol */ + char *bottom; /* expression under-symbol */ + size_t args; /* arguments in parent */ + size_t expectargs; /* max arguments in parent */ enum eqn_post pos; /* position of next box */ - enum eqn_markt mark; /* a mark about the box */ enum eqn_fontt font; /* font of box */ enum eqn_pilet pile; /* equation piling */ }; |