1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00
This commit is contained in:
gnosygnu
2015-09-06 21:31:25 -04:00
parent 5fc4eb41ec
commit 2145f6382c
89 changed files with 2250 additions and 671 deletions

View File

@@ -1,73 +0,0 @@
/*
XOWA: the XOWA Offline Wiki Application
Copyright (C) 2012 gnosygnu@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.xtns.math.parsers; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.math.*;
import gplx.core.btries.*; import gplx.core.primitives.*;
class Math_func_ml_parser {
private byte[] src; public int src_len;
private Btrie_slim_mgr prop_trie;
public void Parse(byte[] src) {
this.prop_trie = Math_prop_itm.Trie;
this.src = src; this.src_len = src.length;
int pos = Bry_finder.Find_fwd(src, Bry__parse_bgn, 0); if (pos == Bry_finder.Not_found) throw Err_.new_("ml_parser", "unable to find beginning of ml file");
pos = Bry_finder.Find_fwd(src, Byte_ascii.Quote, pos, src_len); if (pos == Bry_finder.Not_found) throw Err_.new_("ml_parser", "unable to find first func");
while (true) {
pos = Parse_itm(pos);
if (pos == Bry_finder.Not_found) break;
}
}
private int Parse_itm(int pos) { // pos should start at quote
int end_quote = Bry_finder.Find_fwd(src, Byte_ascii.Quote, pos + 1); if (pos == Bry_finder.Not_found) throw Err_.new_("ml_parser", "unable to find end quote", "excerpt", Excerpt(pos));
byte[] key = Bry_.Mid_by_len_safe(src, pos + 1, end_quote);
Math_func_itm func_itm = new Math_func_itm(key);
pos = end_quote + 1;
pos = Bry_finder.Find_fwd(src, Bry__kv_spr, pos); if (pos == Bry_finder.Not_found) throw Err_.new_("ml_parser", "unable to find kv spr", "excerpt", Excerpt(pos));
while (true) {
pos = Bry_finder.Find_fwd_while_ws(src, pos, src_len);
if (pos == src_len) return -1;
byte b = src[pos];
Object o = prop_trie.Match_bgn_w_byte(b, src, pos, src_len);
if (o == null) {
// throw error
break;
}
else {
Int_obj_val prop_obj = (Int_obj_val)o;
func_itm.Props__add(prop_obj.Val());
}
}
return pos;
}
private byte[] Excerpt(int bgn) {return Bry_.Mid_by_len_safe(src, bgn, bgn + 25);}
private static final byte[]
Bry__parse_bgn = Bry_.new_a7("let find = function")
, Bry__kv_spr = Bry_.new_a7("->")
;
}
/*
let find = function
"\\alpha" -> LITERAL (HTMLABLEC (FONT_UF, "\\alpha ", "&alpha;"))
| "\\Alpha" -> (tex_use_ams (); LITERAL (HTMLABLEC (FONT_UF,
"\\mathrm{A}", "&Alpha;")))
| "\\beta" -> LITERAL (HTMLABLEC (FONT_UF, "\\beta ", "&beta;"))
| "\\Beta" -> (tex_use_ams (); LITERAL (HTMLABLEC (FONT_UF,
"\\mathrm{B}", "&Beta;")))
| "\\gamma" -> LITERAL (HTMLABLEC (FONT_UF, "\\gamma ", "&gamma;"))
| "\\text" -> raise (Failure "malformatted \\text")
| "\\frac" -> FUN_AR2h ("\\frac ", fun num den -> Html.html_render [num], "<hr style=\"{background: black}\"/>", Html.html_render [den])
*/

View File

@@ -18,4 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package gplx.xowa.xtns.math.parsers; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.math.*;
class Mwm_ctx {
public Int_ary Stack() {return stack;} private final Int_ary stack = new Int_ary(4);
public void Clear() {
stack.Clear();
}
}

View File

@@ -23,10 +23,11 @@ interface Mwm_lxr {
class Mwm_lxr_ {
public static final int
Tid__ws = 0
, Tid__backslash = 1
, Tid__curly_bgn = 2
, Tid__curly_end = 3
, Tid__brack_bgn = 4
, Tid__brack_end = 5
, Tid__raw = 1
, Tid__backslash = 2
, Tid__curly_bgn = 3
, Tid__curly_end = 4
, Tid__brack_bgn = 5
, Tid__brack_end = 6
;
}

View File

@@ -44,7 +44,7 @@ class Mwm_lxr__backslash implements Mwm_lxr {
break;
}
}
root.Regy__add(Mwm_tkn_.Tid__func, bgn_pos, cur_pos, new Mwm_tkn__node());
root.Regy__add(Mwm_tkn_.Tid__fnc, bgn_pos, cur_pos, new Mwm_tkn__node());
return cur_pos;
}
}

View File

@@ -16,16 +16,11 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.xtns.math.parsers; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.math.*;
import gplx.core.btries.*;
class Mwm_trie_bldr {
public static Btrie_fast_mgr new_() {
Btrie_fast_mgr rv = Btrie_fast_mgr.cs();
rv.Add(" " , new Mwm_lxr__ws());
rv.Add("\\" , new Mwm_lxr__backslash());
rv.Add("{" , new Mwm_lxr__curly_bgn());
rv.Add("}" , new Mwm_lxr__curly_end());
rv.Add("[" , new Mwm_lxr__brack_bgn());
rv.Add("]" , new Mwm_lxr__brack_end());
return rv;
class Mwm_lxr__leaf implements Mwm_lxr {
public Mwm_lxr__leaf(int tkn_tid) {this.tkn_tid = tkn_tid;} private final int tkn_tid;
public int Tid() {return Mwm_lxr_.Tid__raw;}
public int Make_tkn(Mwm_ctx ctx, Mwm_tkn__root root, byte[] src, int src_len, int bgn_pos, int cur_pos) {
root.Regy__add(tkn_tid, bgn_pos, cur_pos, null);
return cur_pos;
}
}

View File

@@ -0,0 +1,64 @@
/*
XOWA: the XOWA Offline Wiki Application
Copyright (C) 2012 gnosygnu@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.xtns.math.parsers; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.math.*;
import gplx.core.btries.*;
class Mwm_lxr_trie_bldr {
public static Btrie_fast_mgr new_(Mwm_tkn_mkr tkn_mkr) {// REF.MW:/Math/textvccheck/lexer.mll
tkn_mkr.Reg_leaf(Mwm_tkn_.Tid__text, new Mwm_tkn__leaf_raw());
Btrie_fast_mgr rv = Btrie_fast_mgr.cs();
Add_lxr (rv, tkn_mkr, new Mwm_lxr__backslash() , "\\");
Add_lxr (rv, tkn_mkr, new Mwm_lxr__curly_bgn() , "{");
Add_lxr (rv, tkn_mkr, new Mwm_lxr__curly_end() , "}");
Add_lxr (rv, tkn_mkr, new Mwm_lxr__brack_bgn() , "[");
Add_lxr (rv, tkn_mkr, new Mwm_lxr__brack_end() , "]");
Add_lxr_leaf (rv, tkn_mkr, new Mwm_lxr__ws(), Mwm_tkn_.Tid__ws , " ", "\t", "\n", "\r");
Add_lxr_leaf (rv, tkn_mkr, Mwm_tkn_.Tid__lit_basic , ">", "<", "~");
Add_lxr_leaf (rv, tkn_mkr, Mwm_tkn_.Tid__lit_uf_lt , ",", ":", ";", "?", "!", "'");
Add_lxr_leaf (rv, tkn_mkr, Mwm_tkn_.Tid__lit_uf_op , "+", "-", "*", "=");
Add_lxr_leaf (rv, tkn_mkr, Mwm_tkn_.Tid__dlm_uf_lt , "(", ")", ".");
Add_lxr_leaf_repl (rv, tkn_mkr, Mwm_tkn_.Tid__lit_basic , "%", "\\%");
Add_lxr_leaf_repl (rv, tkn_mkr, Mwm_tkn_.Tid__lit_basic , "$", "\\$");
Add_lxr_leaf (rv, tkn_mkr, Mwm_tkn_.Tid__lit_basic , "\\,", "\\ ", "\\;", "\\!");
Add_lxr_leaf (rv, tkn_mkr, Mwm_tkn_.Tid__dlm_basic , "\\{", "\\}", "\\|");
Add_lxr_leaf (rv, tkn_mkr, Mwm_tkn_.Tid__lit_basic , "\\_", "\\#", "\\%", "\\$", "\\&");
Add_lxr_leaf (rv, tkn_mkr, Mwm_tkn_.Tid__next_cell , "%");
Add_lxr_leaf (rv, tkn_mkr, Mwm_tkn_.Tid__next_row , "\\\\");
Add_lxr_leaf (rv, tkn_mkr, Mwm_tkn_.Tid__lit_basic , "~", ">", "<");
Add_lxr_leaf (rv, tkn_mkr, Mwm_tkn_.Tid__sup , "^");
Add_lxr_leaf (rv, tkn_mkr, Mwm_tkn_.Tid__sub , "_");
return rv;
}
private static void Add_lxr(Btrie_fast_mgr trie, Mwm_tkn_mkr tkn_mkr, Mwm_lxr lxr, String... ary) {
for (String itm : ary)
trie.Add(itm, lxr);
}
private static void Add_lxr_leaf(Btrie_fast_mgr trie, Mwm_tkn_mkr tkn_mkr, int tid, String... ary) {
Add_lxr_leaf(trie, tkn_mkr, new Mwm_lxr__leaf(tid), tid, new Mwm_tkn__leaf_raw(), ary);
}
private static void Add_lxr_leaf(Btrie_fast_mgr trie, Mwm_tkn_mkr tkn_mkr, Mwm_lxr lxr, int tkn_tid, String... ary) {
Add_lxr_leaf(trie, tkn_mkr, lxr, tkn_tid, new Mwm_tkn__leaf_raw(), ary);
}
private static void Add_lxr_leaf_repl(Btrie_fast_mgr trie, Mwm_tkn_mkr tkn_mkr, int tid, String src, String trg) {
Add_lxr_leaf(trie, tkn_mkr, new Mwm_lxr__leaf(tid), tid, new Mwm_tkn__leaf_repl(tid, Bry_.new_u8(trg)), src);
}
private static void Add_lxr_leaf(Btrie_fast_mgr trie, Mwm_tkn_mkr tkn_mkr, Mwm_lxr lxr, int tkn_tid, Mwm_tkn proto, String... ary) {
tkn_mkr.Reg_leaf(tkn_tid, proto);
for (String itm : ary)
trie.Add(itm, lxr);
}
}

View File

@@ -18,12 +18,19 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package gplx.xowa.xtns.math.parsers; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.math.*;
import gplx.core.btries.*;
class Mwm_parser {
private final Mwm_ctx ctx = new Mwm_ctx();
private final Btrie_fast_mgr trie;
public Mwm_tkn_mkr Tkn_mkr() {return tkn_mkr;} private final Mwm_tkn_mkr tkn_mkr = new Mwm_tkn_mkr();
public Mwm_parser() {
this.trie = Mwm_lxr_trie_bldr.new_(tkn_mkr);
}
public void Parse(Mwm_tkn__root root, byte[] src) {
int src_len = src.length;
Btrie_fast_mgr trie = Mwm_trie_bldr.new_();
Parse(trie, root, new Mwm_ctx(), src, src_len, 0, src_len);
ctx.Clear();
root.Init_as_root(tkn_mkr, 0, src.length);
Parse(root, ctx, src, src_len, 0, src_len);
}
private int Parse(Btrie_fast_mgr trie, Mwm_tkn__root root, Mwm_ctx ctx, byte[] src, int src_len, int bgn_pos, int end_pos) {
private int Parse(Mwm_tkn__root root, Mwm_ctx ctx, byte[] src, int src_len, int bgn_pos, int end_pos) {
int pos = bgn_pos;
int txt_bgn = pos, txt_uid = -1;
byte b = src[pos];

View File

@@ -65,14 +65,13 @@ class Mwm_parser_fxt {
private final Bry_bfr tmp_bfr = Bry_bfr.reset_(255);
private final Mwm_parser parser = new Mwm_parser();
private final Mwm_tkn__root expd_root, actl_root;
private final Mwm_tkn_mkr tkn_mkr = new Mwm_tkn_mkr();
public Mwm_parser_fxt() {
this.expd_root = new Mwm_tkn__root(tkn_mkr);
this.actl_root = new Mwm_tkn__root(tkn_mkr);
this.expd_root = new Mwm_tkn__root();
this.actl_root = new Mwm_tkn__root();
}
public void Clear() {
expd_root.Init_as_root(0, 8);
actl_root.Init_as_root(0, 8);
expd_root.Init_as_root(parser.Tkn_mkr(), 0, 8);
actl_root.Init_as_root(parser.Tkn_mkr(), 0, 8);
}
public void Test_parse(String src_str, Mwm_tkn... expd_tkns) {
byte[] src_bry = Bry_.new_u8(src_str);
@@ -93,7 +92,7 @@ class Mwm_parser_fxt {
}
private Mwm_tkn leaf(int tid, int bgn, int end) {
int uid = expd_root.Regy__add(tid, bgn, end, null);
return new Mwm_tkn__leaf().Init(expd_root, tid, uid, bgn, end);
return new Mwm_tkn__leaf_raw().Init(expd_root, tid, uid, bgn, end);
}
private Mwm_tkn node(int tid, int bgn, int end, Mwm_tkn tkn) {
int uid = expd_root.Regy__add(tid, bgn, end, tkn);
@@ -101,7 +100,7 @@ class Mwm_parser_fxt {
}
public Mwm_tkn text (int bgn, int end) {return leaf(Mwm_tkn_.Tid__text , bgn, end);}
public Mwm_tkn ws (int bgn, int end) {return leaf(Mwm_tkn_.Tid__ws , bgn, end);}
public Mwm_tkn func (int bgn, int end) {return node(Mwm_tkn_.Tid__func , bgn, end, new Mwm_tkn__node());}
public Mwm_tkn func (int bgn, int end) {return node(Mwm_tkn_.Tid__fnc , bgn, end, new Mwm_tkn__node());}
public Mwm_tkn brack(int bgn, int end, Mwm_tkn... subs) {return node_w_subs(Mwm_tkn_.Tid__brack, bgn, end, subs);}
public Mwm_tkn curly(int bgn, int end, Mwm_tkn... subs) {return node_w_subs(Mwm_tkn_.Tid__curly, bgn, end, subs);}
private Mwm_tkn node_w_subs(int tid, int bgn, int end, Mwm_tkn... subs) {

View File

@@ -21,39 +21,104 @@ class Mwm_tkn_ {
public static final Mwm_tkn[] Ary_empty = new Mwm_tkn[0];
public static final int Uid__root = 0;
public static final int
Tid__root = 0
, Tid__text = 1
, Tid__ws = 2
, Tid__func = 3
, Tid__curly = 4
, Tid__brack = 5
Tid__root = 0
, Tid__text = 1
, Tid__ws = 2
, Tid__curly = 3
, Tid__brack = 4
, Tid__lit_basic = 5
, Tid__lit_uf_lt = 6
, Tid__lit_uf_op = 7
, Tid__dlm_basic = 8
, Tid__dlm_uf_lt = 9
, Tid__dlm_uf_op = 10
, Tid__sub = 11
, Tid__sup = 12
, Tid__next_row = 13
, Tid__next_cell = 14
, Tid__fnc = 15
, Tid__fnc_latex = 16
, Tid__fnc_mw = 17
, Tid__matrix_bgn = 18
, Tid__matrix_end = 19
, Tid__pmatrix_bgn = 20
, Tid__pmatrix_end = 21
, Tid__bmatrix_bgn = 22
, Tid__bmatrix_end = 23
, Tid__Bmatrix_bgn = 24
, Tid__Bmatrix_end = 25
, Tid__vmatrix_bgn = 26
, Tid__vmatrix_end = 27
, Tid__Vmatrix_bgn = 28
, Tid__Vmatrix_end = 29
, Tid__array_bgn = 30
, Tid__array_end = 31
, Tid__align_bgn = 32
, Tid__align_end = 33
, Tid__alignat_bgn = 34
, Tid__alignat_end = 35
, Tid__smallmatrix_bgn = 36
, Tid__smallmatrix_end = 37
, Tid__cases_bgn = 38
, Tid__cases_end = 39
;
public static byte[]
Bry__root = Bry_.new_a7("root")
, Bry__text = Bry_.new_a7("text")
, Bry__ws = Bry_.new_a7("ws")
, Bry__func = Bry_.new_a7("func")
, Bry__curly = Bry_.new_a7("curly")
, Bry__brack = Bry_.new_a7("brack")
;
public static byte[] Tid_to_bry(int tid) {
switch (tid) {
case Tid__root: return Bry__root;
case Tid__text: return Bry__text;
case Tid__ws: return Bry__ws;
case Tid__func: return Bry__func;
case Tid__curly: return Bry__curly;
case Tid__brack: return Bry__brack;
default: throw Err_.new_unhandled(tid);
}
public static final int Tid_len = 40;
private static final byte[][] Bry__ary = Bry__ary__new();
private static byte[][] Bry__ary__new() {
byte[][] rv = new byte[Tid_len][];
Reg_itm(rv, Tid__root , "root");
Reg_itm(rv, Tid__text , "text");
Reg_itm(rv, Tid__ws , "ws");
Reg_itm(rv, Tid__fnc , "func");
Reg_itm(rv, Tid__curly , "curly");
Reg_itm(rv, Tid__brack , "brack");
Reg_itm(rv, Tid__lit_basic , "literal_basic");
Reg_itm(rv, Tid__lit_uf_lt , "literal_uf_lt");
Reg_itm(rv, Tid__lit_uf_op , "literal_uf_op");
Reg_itm(rv, Tid__dlm_basic , "delimiter_basic");
Reg_itm(rv, Tid__dlm_uf_lt , "delimiter_uf_lt");
Reg_itm(rv, Tid__dlm_uf_op , "delimiter_uf_op");
Reg_itm(rv, Tid__sub , "sub");
Reg_itm(rv, Tid__sup , "sup");
Reg_itm(rv, Tid__next_row , "next_row");
Reg_itm(rv, Tid__next_cell , "next_cell");
Reg_itm(rv, Tid__fnc_latex , "func_latex");
Reg_itm(rv, Tid__fnc_mw , "func_mediawiki");
Reg_itm(rv, Tid__matrix_bgn , "matrix_bgn");
Reg_itm(rv, Tid__matrix_end , "matrix_end");
Reg_itm(rv, Tid__pmatrix_bgn , "pmatrix_bgn");
Reg_itm(rv, Tid__pmatrix_end , "pmatrix_end");
Reg_itm(rv, Tid__bmatrix_bgn , "bmatrix_bgn");
Reg_itm(rv, Tid__bmatrix_end , "bmatrix_end");
Reg_itm(rv, Tid__Bmatrix_bgn , "Bmatrix_bgn");
Reg_itm(rv, Tid__Bmatrix_end , "Bmatrix_bgn");
Reg_itm(rv, Tid__vmatrix_bgn , "vmatrix_bgn");
Reg_itm(rv, Tid__vmatrix_end , "vmatrix_end");
Reg_itm(rv, Tid__Vmatrix_bgn , "Vmatrix_bgn");
Reg_itm(rv, Tid__Vmatrix_end , "Vmatrix_end");
Reg_itm(rv, Tid__array_bgn , "array_bgn");
Reg_itm(rv, Tid__array_end , "array_end");
Reg_itm(rv, Tid__align_bgn , "align_bgn");
Reg_itm(rv, Tid__align_end , "align_end");
Reg_itm(rv, Tid__alignat_bgn , "alignat_bgn");
Reg_itm(rv, Tid__alignat_end , "alignat_end");
Reg_itm(rv, Tid__smallmatrix_bgn , "smallmatrix_bgn");
Reg_itm(rv, Tid__smallmatrix_end , "smallmatrix_end");
Reg_itm(rv, Tid__cases_bgn , "cases_bgn");
Reg_itm(rv, Tid__cases_end , "cases_end");
return rv;
}
private static void Reg_itm(byte[][] ary, int id, String name) {ary[id] = Bry_.new_a7(name);}
public static byte[] Tid_to_bry(int tid) {return Bry__ary[tid];}
public static boolean Tid_is_node(int tid) {
switch (tid) {
case Mwm_tkn_.Tid__text:
case Mwm_tkn_.Tid__ws:
return false;
default:
case Mwm_tkn_.Tid__root:
case Mwm_tkn_.Tid__fnc:
case Mwm_tkn_.Tid__curly:
case Mwm_tkn_.Tid__brack:
return true;
default:
return false;
}
}
public static void Tkn_to_bry__bgn(Bry_bfr bfr, int indent, Mwm_tkn tkn) {

View File

@@ -0,0 +1,41 @@
/*
XOWA: the XOWA Offline Wiki Application
Copyright (C) 2012 gnosygnu@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.xtns.math.parsers; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.math.*;
import gplx.core.btries.*;
class Mwm_tkn__func {
public Mwm_tkn__func(byte[] key) {
this.key = key;
}
public byte[] Key() {return key;} private final byte[] key;
public byte[] Manual() {return manual;} public Mwm_tkn__func Manual_(String v) {manual = Bry_.new_a7(v); return this;} private byte[] manual;
public boolean Literal() {return literal;} public Mwm_tkn__func Literal_() {this.literal = true; return this;} private boolean literal;
public boolean Big() {return big;} public Mwm_tkn__func Big_() {this.big = true; return this;} private boolean big;
public boolean Delimiter() {return delimiter;} public Mwm_tkn__func Delimiter_() {this.delimiter = true; return this;} private boolean delimiter;
public boolean Tex_only() {return tex_only;} public Mwm_tkn__func Tex_only_() {this.tex_only = true; return this;} private boolean tex_only;
public boolean Fun_ar1() {return fun_ar1;} public Mwm_tkn__func Fun_ar1_() {this.fun_ar1 = true; return this;} private boolean fun_ar1;
public boolean Fun_ar2() {return fun_ar2;} public Mwm_tkn__func Fun_ar2_() {this.fun_ar2 = true; return this;} private boolean fun_ar2;
public boolean Fun_ar2nb() {return fun_ar2nb;} public Mwm_tkn__func Fun_ar2nb_() {this.fun_ar2nb = true; return this;} private boolean fun_ar2nb;
public boolean Fun_infix() {return fun_infix;} public Mwm_tkn__func Fun_infix_() {this.fun_infix = true; return this;} private boolean fun_infix;
public boolean Declh() {return declh;} public Mwm_tkn__func Declh_() {this.declh = true; return this;} private boolean declh;
public boolean Fontforce_rm() {return fontforce_rm;} public Mwm_tkn__func Fontforce_rm_() {this.fontforce_rm = true; return this;} private boolean fontforce_rm;
public boolean Left() {return left;} public Mwm_tkn__func Left_() {this.left = true; return this;} private boolean left;
public boolean Right() {return right;} public Mwm_tkn__func Right_() {this.right = true; return this;} private boolean right;
public boolean Fail() {return fail;} public Mwm_tkn__func Fail_() {this.fail = true; return this;} private boolean fail;
public boolean Type_latex() {return type_latex;} public Mwm_tkn__func Type_latex_() {this.type_latex = true; return this;} private boolean type_latex;
public boolean Type_mw() {return type_mw;} public Mwm_tkn__func Type_mw_() {this.type_mw = true; return this;} private boolean type_mw;
}

View File

@@ -0,0 +1,52 @@
/*
XOWA: the XOWA Offline Wiki Application
Copyright (C) 2012 gnosygnu@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.xtns.math.parsers; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.math.*;
import gplx.core.btries.*;
class Mwm_tkn__func_ {
public static final int
Tid__space = 0
, Tid__lit_uf_lt = 1
, Tid__dlm_uf_lt = 2
, Tid__lit_uf_op = 3
, Tid__dlm_uf_op = 4
, Tid__fnc_latex = 5
, Tid__fnc_mw = 6
;
public Btrie_slim_mgr Make_trie() {
Btrie_slim_mgr rv = Btrie_slim_mgr.ci_a7(); // NOTE: texvc tkns are ascii
Make_itm(rv, Tid__space , " ", "\t", "\n", "\r");
Make_itm(rv, Tid__lit_uf_lt , ",", ":", ";", "?", "!", "'");
Make_itm(rv, Tid__dlm_uf_lt , "(", ")", ".");
Make_itm(rv, Tid__lit_uf_op , "+", "-", "*", "=");
Make_itm(rv, Tid__dlm_uf_op , "/", "|");
Make_itm(rv, Tid__fnc_latex , "arccos", "arcsin", "arctan", "arg", "cos", "cosh", "cot", "coth", "csc"
, "deg", "det", "dim", "exp", "gcd", "hom", "inf", "ker", "lg", "lim", "liminf", "limsup", "ln", "log"
, "max", "min", "Pr", "sec", "sin", "sinh", "sup", "tan", "tanh");
Make_itm(rv, Tid__fnc_mw , "arccot", "arcsec", "arccsc", "sgn", "sen");
return rv;
}
private void Make_itm(Btrie_slim_mgr trie, int tid, String... ary) {
for (String itm : ary)
trie.Add_bry_int(Bry_.new_a7(itm), tid);
}
//let alpha = ['a'-'z' 'A'-'Z']
//let literal_id = ['a'-'z' 'A'-'Z']
//let literal_mn = ['0'-'9']
//let boxchars = ['0'-'9' 'a'-'z' 'A'-'Z' '+' '-' '*' ',' '=' '(' ')' ':' '/' ';' '?' '.' '!' '\'' '`' ' ' '\128'-'\255']
//let aboxchars = ['0'-'9' 'a'-'z' 'A'-'Z' '+' '-' '*' ',' '=' '(' ')' ':' '/' ';' '?' '.' '!' '\'' '`' ' ']
}

View File

@@ -0,0 +1,705 @@
/*
XOWA: the XOWA Offline Wiki Application
Copyright (C) 2012 gnosygnu@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.xtns.math.parsers; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.math.*;
import gplx.core.btries.*;
class Mwm_tkn__func_trie {
public Btrie_slim_mgr Make() {
Btrie_slim_mgr trie = Btrie_slim_mgr.ci_a7();
Add(trie, Make("\\AA").Literal_().Tex_only_());
Add(trie, Make("\\aleph").Literal_().Tex_only_());
Add(trie, Make("\\alpha").Literal_().Tex_only_());
Add(trie, Make("\\amalg").Literal_().Tex_only_());
Add(trie, Make("\\And").Literal_().Tex_only_());
Add(trie, Make("\\angle").Literal_().Tex_only_());
Add(trie, Make("\\approx").Literal_().Tex_only_());
Add(trie, Make("\\approxeq").Literal_().Tex_only_());
Add(trie, Make("\\ast").Literal_().Tex_only_());
Add(trie, Make("\\asymp").Literal_().Tex_only_());
Add(trie, Make("\\backepsilon").Literal_().Tex_only_());
Add(trie, Make("\\backprime").Literal_().Tex_only_());
Add(trie, Make("\\backsim").Literal_().Tex_only_());
Add(trie, Make("\\backsimeq").Literal_().Tex_only_());
Add(trie, Make("\\barwedge").Literal_().Tex_only_());
Add(trie, Make("\\Bbbk").Literal_().Tex_only_());
Add(trie, Make("\\because").Literal_().Tex_only_());
Add(trie, Make("\\beta").Literal_().Tex_only_());
Add(trie, Make("\\beth").Literal_().Tex_only_());
Add(trie, Make("\\between").Literal_().Tex_only_());
Add(trie, Make("\\bigcap").Literal_().Tex_only_());
Add(trie, Make("\\bigcirc").Literal_().Tex_only_());
Add(trie, Make("\\bigcup").Literal_().Tex_only_());
Add(trie, Make("\\bigodot").Literal_().Tex_only_());
Add(trie, Make("\\bigoplus").Literal_().Tex_only_());
Add(trie, Make("\\bigotimes").Literal_().Tex_only_());
Add(trie, Make("\\bigsqcup").Literal_().Tex_only_());
Add(trie, Make("\\bigstar").Literal_().Tex_only_());
Add(trie, Make("\\bigtriangledown").Literal_().Tex_only_());
Add(trie, Make("\\bigtriangleup").Literal_().Tex_only_());
Add(trie, Make("\\biguplus").Literal_().Tex_only_());
Add(trie, Make("\\bigvee").Literal_().Tex_only_());
Add(trie, Make("\\bigwedge").Literal_().Tex_only_());
Add(trie, Make("\\blacklozenge").Literal_().Tex_only_());
Add(trie, Make("\\blacksquare").Literal_().Tex_only_());
Add(trie, Make("\\blacktriangle").Literal_().Tex_only_());
Add(trie, Make("\\blacktriangledown").Literal_().Tex_only_());
Add(trie, Make("\\blacktriangleleft").Literal_().Tex_only_());
Add(trie, Make("\\blacktriangleright").Literal_().Tex_only_());
Add(trie, Make("\\bot").Literal_().Tex_only_());
Add(trie, Make("\\bowtie").Literal_().Tex_only_());
Add(trie, Make("\\Box").Literal_().Tex_only_());
Add(trie, Make("\\boxdot").Literal_().Tex_only_());
Add(trie, Make("\\boxminus").Literal_().Tex_only_());
Add(trie, Make("\\boxplus").Literal_().Tex_only_());
Add(trie, Make("\\boxtimes").Literal_().Tex_only_());
Add(trie, Make("\\bullet").Literal_().Tex_only_());
Add(trie, Make("\\bumpeq").Literal_().Tex_only_());
Add(trie, Make("\\Bumpeq").Literal_().Tex_only_());
Add(trie, Make("\\cap").Literal_().Tex_only_());
Add(trie, Make("\\Cap").Literal_().Tex_only_());
Add(trie, Make("\\cdot").Literal_().Tex_only_());
Add(trie, Make("\\cdots").Literal_().Tex_only_());
Add(trie, Make("\\centerdot").Literal_().Tex_only_());
Add(trie, Make("\\checkmark").Literal_().Tex_only_());
Add(trie, Make("\\chi").Literal_().Tex_only_());
Add(trie, Make("\\circ").Literal_().Tex_only_());
Add(trie, Make("\\circeq").Literal_().Tex_only_());
Add(trie, Make("\\circlearrowleft").Literal_().Tex_only_());
Add(trie, Make("\\circlearrowright").Literal_().Tex_only_());
Add(trie, Make("\\circledast").Literal_().Tex_only_());
Add(trie, Make("\\circledcirc").Literal_().Tex_only_());
Add(trie, Make("\\circleddash").Literal_().Tex_only_());
Add(trie, Make("\\circledS").Literal_().Tex_only_());
Add(trie, Make("\\clubsuit").Literal_().Tex_only_());
Add(trie, Make("\\colon").Literal_().Tex_only_());
Add(trie, Make("\\color").Literal_().Tex_only_());
Add(trie, Make("\\complement").Literal_().Tex_only_());
Add(trie, Make("\\cong").Literal_().Tex_only_());
Add(trie, Make("\\coprod").Literal_().Tex_only_());
Add(trie, Make("\\cup").Literal_().Tex_only_());
Add(trie, Make("\\Cup").Literal_().Tex_only_());
Add(trie, Make("\\curlyeqprec").Literal_().Tex_only_());
Add(trie, Make("\\curlyeqsucc").Literal_().Tex_only_());
Add(trie, Make("\\curlyvee").Literal_().Tex_only_());
Add(trie, Make("\\curlywedge").Literal_().Tex_only_());
Add(trie, Make("\\curvearrowleft").Literal_().Tex_only_());
Add(trie, Make("\\curvearrowright").Literal_().Tex_only_());
Add(trie, Make("\\dagger").Literal_().Tex_only_());
Add(trie, Make("\\daleth").Literal_().Tex_only_());
Add(trie, Make("\\dashv").Literal_().Tex_only_());
Add(trie, Make("\\ddagger").Literal_().Tex_only_());
Add(trie, Make("\\ddots").Literal_().Tex_only_());
Add(trie, Make("\\definecolor").Literal_().Tex_only_());
Add(trie, Make("\\delta").Literal_().Tex_only_());
Add(trie, Make("\\Delta").Literal_().Tex_only_());
Add(trie, Make("\\diagdown").Literal_().Tex_only_());
Add(trie, Make("\\diagup").Literal_().Tex_only_());
Add(trie, Make("\\diamond").Literal_().Tex_only_());
Add(trie, Make("\\Diamond").Literal_().Tex_only_());
Add(trie, Make("\\diamondsuit").Literal_().Tex_only_());
Add(trie, Make("\\digamma").Literal_().Tex_only_());
Add(trie, Make("\\displaystyle").Literal_().Tex_only_());
Add(trie, Make("\\div").Literal_().Tex_only_());
Add(trie, Make("\\divideontimes").Literal_().Tex_only_());
Add(trie, Make("\\doteq").Literal_().Tex_only_());
Add(trie, Make("\\doteqdot").Literal_().Tex_only_());
Add(trie, Make("\\dotplus").Literal_().Tex_only_());
Add(trie, Make("\\dots").Literal_().Tex_only_());
Add(trie, Make("\\dotsb").Literal_().Tex_only_());
Add(trie, Make("\\dotsc").Literal_().Tex_only_());
Add(trie, Make("\\dotsi").Literal_().Tex_only_());
Add(trie, Make("\\dotsm").Literal_().Tex_only_());
Add(trie, Make("\\dotso").Literal_().Tex_only_());
Add(trie, Make("\\doublebarwedge").Literal_().Tex_only_());
Add(trie, Make("\\downdownarrows").Literal_().Tex_only_());
Add(trie, Make("\\downharpoonleft").Literal_().Tex_only_());
Add(trie, Make("\\downharpoonright").Literal_().Tex_only_());
Add(trie, Make("\\ell").Literal_().Tex_only_());
Add(trie, Make("\\emptyset").Literal_().Tex_only_());
Add(trie, Make("\\epsilon").Literal_().Tex_only_());
Add(trie, Make("\\eqcirc").Literal_().Tex_only_());
Add(trie, Make("\\eqsim").Literal_().Tex_only_());
Add(trie, Make("\\eqslantgtr").Literal_().Tex_only_());
Add(trie, Make("\\eqslantless").Literal_().Tex_only_());
Add(trie, Make("\\equiv").Literal_().Tex_only_());
Add(trie, Make("\\eta").Literal_().Tex_only_());
Add(trie, Make("\\eth").Literal_().Tex_only_());
Add(trie, Make("\\exists").Literal_().Tex_only_());
Add(trie, Make("\\fallingdotseq").Literal_().Tex_only_());
Add(trie, Make("\\Finv").Literal_().Tex_only_());
Add(trie, Make("\\flat").Literal_().Tex_only_());
Add(trie, Make("\\forall").Literal_().Tex_only_());
Add(trie, Make("\\frown").Literal_().Tex_only_());
Add(trie, Make("\\Game").Literal_().Tex_only_());
Add(trie, Make("\\gamma").Literal_().Tex_only_());
Add(trie, Make("\\Gamma").Literal_().Tex_only_());
Add(trie, Make("\\geq").Literal_().Tex_only_());
Add(trie, Make("\\geqq").Literal_().Tex_only_());
Add(trie, Make("\\geqslant").Literal_().Tex_only_());
Add(trie, Make("\\gets").Literal_().Tex_only_());
Add(trie, Make("\\gg").Literal_().Tex_only_());
Add(trie, Make("\\ggg").Literal_().Tex_only_());
Add(trie, Make("\\gimel").Literal_().Tex_only_());
Add(trie, Make("\\gnapprox").Literal_().Tex_only_());
Add(trie, Make("\\gneq").Literal_().Tex_only_());
Add(trie, Make("\\gneqq").Literal_().Tex_only_());
Add(trie, Make("\\gnsim").Literal_().Tex_only_());
Add(trie, Make("\\gtrapprox").Literal_().Tex_only_());
Add(trie, Make("\\gtrdot").Literal_().Tex_only_());
Add(trie, Make("\\gtreqless").Literal_().Tex_only_());
Add(trie, Make("\\gtreqqless").Literal_().Tex_only_());
Add(trie, Make("\\gtrless").Literal_().Tex_only_());
Add(trie, Make("\\gtrsim").Literal_().Tex_only_());
Add(trie, Make("\\gvertneqq").Literal_().Tex_only_());
Add(trie, Make("\\hbar").Literal_().Tex_only_());
Add(trie, Make("\\heartsuit").Literal_().Tex_only_());
Add(trie, Make("\\hline").Literal_().Tex_only_());
Add(trie, Make("\\hookleftarrow").Literal_().Tex_only_());
Add(trie, Make("\\hookrightarrow").Literal_().Tex_only_());
Add(trie, Make("\\hslash").Literal_().Tex_only_());
Add(trie, Make("\\iff").Literal_().Tex_only_());
Add(trie, Make("\\iiiint").Literal_().Tex_only_());
Add(trie, Make("\\iiint").Literal_().Tex_only_());
Add(trie, Make("\\iint").Literal_().Tex_only_());
Add(trie, Make("\\Im").Literal_().Tex_only_());
Add(trie, Make("\\imath").Literal_().Tex_only_());
Add(trie, Make("\\implies").Literal_().Tex_only_());
Add(trie, Make("\\in").Literal_().Tex_only_());
Add(trie, Make("\\infty").Literal_().Tex_only_());
Add(trie, Make("\\injlim").Literal_().Tex_only_());
Add(trie, Make("\\int").Literal_().Tex_only_());
Add(trie, Make("\\intercal").Literal_().Tex_only_());
Add(trie, Make("\\iota").Literal_().Tex_only_());
Add(trie, Make("\\jmath").Literal_().Tex_only_());
Add(trie, Make("\\kappa").Literal_().Tex_only_());
Add(trie, Make("\\lambda").Literal_().Tex_only_());
Add(trie, Make("\\Lambda").Literal_().Tex_only_());
Add(trie, Make("\\land").Literal_().Tex_only_());
Add(trie, Make("\\ldots").Literal_().Tex_only_());
Add(trie, Make("\\leftarrow").Literal_().Tex_only_());
Add(trie, Make("\\Leftarrow").Literal_().Tex_only_());
Add(trie, Make("\\leftarrowtail").Literal_().Tex_only_());
Add(trie, Make("\\leftharpoondown").Literal_().Tex_only_());
Add(trie, Make("\\leftharpoonup").Literal_().Tex_only_());
Add(trie, Make("\\leftleftarrows").Literal_().Tex_only_());
Add(trie, Make("\\leftrightarrow").Literal_().Tex_only_());
Add(trie, Make("\\Leftrightarrow").Literal_().Tex_only_());
Add(trie, Make("\\leftrightarrows").Literal_().Tex_only_());
Add(trie, Make("\\leftrightharpoons").Literal_().Tex_only_());
Add(trie, Make("\\leftrightsquigarrow").Literal_().Tex_only_());
Add(trie, Make("\\leftthreetimes").Literal_().Tex_only_());
Add(trie, Make("\\leq").Literal_().Tex_only_());
Add(trie, Make("\\leqq").Literal_().Tex_only_());
Add(trie, Make("\\leqslant").Literal_().Tex_only_());
Add(trie, Make("\\lessapprox").Literal_().Tex_only_());
Add(trie, Make("\\lessdot").Literal_().Tex_only_());
Add(trie, Make("\\lesseqgtr").Literal_().Tex_only_());
Add(trie, Make("\\lesseqqgtr").Literal_().Tex_only_());
Add(trie, Make("\\lessgtr").Literal_().Tex_only_());
Add(trie, Make("\\lesssim").Literal_().Tex_only_());
Add(trie, Make("\\limits").Literal_().Tex_only_());
Add(trie, Make("\\ll").Literal_().Tex_only_());
Add(trie, Make("\\Lleftarrow").Literal_().Tex_only_());
Add(trie, Make("\\lll").Literal_().Tex_only_());
Add(trie, Make("\\lnapprox").Literal_().Tex_only_());
Add(trie, Make("\\lneq").Literal_().Tex_only_());
Add(trie, Make("\\lneqq").Literal_().Tex_only_());
Add(trie, Make("\\lnot").Literal_().Tex_only_());
Add(trie, Make("\\lnsim").Literal_().Tex_only_());
Add(trie, Make("\\longleftarrow").Literal_().Tex_only_());
Add(trie, Make("\\Longleftarrow").Literal_().Tex_only_());
Add(trie, Make("\\longleftrightarrow").Literal_().Tex_only_());
Add(trie, Make("\\Longleftrightarrow").Literal_().Tex_only_());
Add(trie, Make("\\longmapsto").Literal_().Tex_only_());
Add(trie, Make("\\longrightarrow").Literal_().Tex_only_());
Add(trie, Make("\\Longrightarrow").Literal_().Tex_only_());
Add(trie, Make("\\looparrowleft").Literal_().Tex_only_());
Add(trie, Make("\\looparrowright").Literal_().Tex_only_());
Add(trie, Make("\\lor").Literal_().Tex_only_());
Add(trie, Make("\\lozenge").Literal_().Tex_only_());
Add(trie, Make("\\Lsh").Literal_().Tex_only_());
Add(trie, Make("\\ltimes").Literal_().Tex_only_());
Add(trie, Make("\\lVert").Literal_().Tex_only_());
Add(trie, Make("\\lvertneqq").Literal_().Tex_only_());
Add(trie, Make("\\mapsto").Literal_().Tex_only_());
Add(trie, Make("\\measuredangle").Literal_().Tex_only_());
Add(trie, Make("\\mho").Literal_().Tex_only_());
Add(trie, Make("\\mid").Literal_().Tex_only_());
Add(trie, Make("\\mod").Literal_().Tex_only_());
Add(trie, Make("\\models").Literal_().Tex_only_());
Add(trie, Make("\\mp").Literal_().Tex_only_());
Add(trie, Make("\\mu").Literal_().Tex_only_());
Add(trie, Make("\\multimap").Literal_().Tex_only_());
Add(trie, Make("\\nabla").Literal_().Tex_only_());
Add(trie, Make("\\natural").Literal_().Tex_only_());
Add(trie, Make("\\ncong").Literal_().Tex_only_());
Add(trie, Make("\\nearrow").Literal_().Tex_only_());
Add(trie, Make("\\neg").Literal_().Tex_only_());
Add(trie, Make("\\neq").Literal_().Tex_only_());
Add(trie, Make("\\nexists").Literal_().Tex_only_());
Add(trie, Make("\\ngeq").Literal_().Tex_only_());
Add(trie, Make("\\ngeqq").Literal_().Tex_only_());
Add(trie, Make("\\ngeqslant").Literal_().Tex_only_());
Add(trie, Make("\\ngtr").Literal_().Tex_only_());
Add(trie, Make("\\ni").Literal_().Tex_only_());
Add(trie, Make("\\nleftarrow").Literal_().Tex_only_());
Add(trie, Make("\\nLeftarrow").Literal_().Tex_only_());
Add(trie, Make("\\nleftrightarrow").Literal_().Tex_only_());
Add(trie, Make("\\nLeftrightarrow").Literal_().Tex_only_());
Add(trie, Make("\\nleq").Literal_().Tex_only_());
Add(trie, Make("\\nleqq").Literal_().Tex_only_());
Add(trie, Make("\\nleqslant").Literal_().Tex_only_());
Add(trie, Make("\\nless").Literal_().Tex_only_());
Add(trie, Make("\\nmid").Literal_().Tex_only_());
Add(trie, Make("\\nolimits").Literal_().Tex_only_());
Add(trie, Make("\\not").Literal_().Tex_only_());
Add(trie, Make("\\notin").Literal_().Tex_only_());
Add(trie, Make("\\nparallel").Literal_().Tex_only_());
Add(trie, Make("\\nprec").Literal_().Tex_only_());
Add(trie, Make("\\npreceq").Literal_().Tex_only_());
Add(trie, Make("\\nrightarrow").Literal_().Tex_only_());
Add(trie, Make("\\nRightarrow").Literal_().Tex_only_());
Add(trie, Make("\\nshortmid").Literal_().Tex_only_());
Add(trie, Make("\\nshortparallel").Literal_().Tex_only_());
Add(trie, Make("\\nsim").Literal_().Tex_only_());
Add(trie, Make("\\nsubseteq").Literal_().Tex_only_());
Add(trie, Make("\\nsubseteqq").Literal_().Tex_only_());
Add(trie, Make("\\nsucc").Literal_().Tex_only_());
Add(trie, Make("\\nsucceq").Literal_().Tex_only_());
Add(trie, Make("\\nsupseteq").Literal_().Tex_only_());
Add(trie, Make("\\nsupseteqq").Literal_().Tex_only_());
Add(trie, Make("\\ntriangleleft").Literal_().Tex_only_());
Add(trie, Make("\\ntrianglelefteq").Literal_().Tex_only_());
Add(trie, Make("\\ntriangleright").Literal_().Tex_only_());
Add(trie, Make("\\ntrianglerighteq").Literal_().Tex_only_());
Add(trie, Make("\\nu").Literal_().Tex_only_());
Add(trie, Make("\\nvdash").Literal_().Tex_only_());
Add(trie, Make("\\nVdash").Literal_().Tex_only_());
Add(trie, Make("\\nvDash").Literal_().Tex_only_());
Add(trie, Make("\\nVDash").Literal_().Tex_only_());
Add(trie, Make("\\nwarrow").Literal_().Tex_only_());
Add(trie, Make("\\odot").Literal_().Tex_only_());
Add(trie, Make("\\oint").Literal_().Tex_only_());
Add(trie, Make("\\omega").Literal_().Tex_only_());
Add(trie, Make("\\Omega").Literal_().Tex_only_());
Add(trie, Make("\\ominus").Literal_().Tex_only_());
Add(trie, Make("\\oplus").Literal_().Tex_only_());
Add(trie, Make("\\oslash").Literal_().Tex_only_());
Add(trie, Make("\\otimes").Literal_().Tex_only_());
Add(trie, Make("\\overbrace").Literal_().Tex_only_());
Add(trie, Make("\\overleftarrow").Literal_().Tex_only_());
Add(trie, Make("\\overleftrightarrow").Literal_().Tex_only_());
Add(trie, Make("\\overline").Literal_().Tex_only_());
Add(trie, Make("\\overrightarrow").Literal_().Tex_only_());
Add(trie, Make("\\P").Literal_().Tex_only_());
Add(trie, Make("\\pagecolor").Literal_().Tex_only_());
Add(trie, Make("\\parallel").Literal_().Tex_only_());
Add(trie, Make("\\partial").Literal_().Tex_only_());
Add(trie, Make("\\perp").Literal_().Tex_only_());
Add(trie, Make("\\phi").Literal_().Tex_only_());
Add(trie, Make("\\Phi").Literal_().Tex_only_());
Add(trie, Make("\\pi").Literal_().Tex_only_());
Add(trie, Make("\\Pi").Literal_().Tex_only_());
Add(trie, Make("\\pitchfork").Literal_().Tex_only_());
Add(trie, Make("\\pm").Literal_().Tex_only_());
Add(trie, Make("\\prec").Literal_().Tex_only_());
Add(trie, Make("\\precapprox").Literal_().Tex_only_());
Add(trie, Make("\\preccurlyeq").Literal_().Tex_only_());
Add(trie, Make("\\preceq").Literal_().Tex_only_());
Add(trie, Make("\\precnapprox").Literal_().Tex_only_());
Add(trie, Make("\\precneqq").Literal_().Tex_only_());
Add(trie, Make("\\precnsim").Literal_().Tex_only_());
Add(trie, Make("\\precsim").Literal_().Tex_only_());
Add(trie, Make("\\prime").Literal_().Tex_only_());
Add(trie, Make("\\prod").Literal_().Tex_only_());
Add(trie, Make("\\projlim").Literal_().Tex_only_());
Add(trie, Make("\\propto").Literal_().Tex_only_());
Add(trie, Make("\\psi").Literal_().Tex_only_());
Add(trie, Make("\\Psi").Literal_().Tex_only_());
Add(trie, Make("\\qquad").Literal_().Tex_only_());
Add(trie, Make("\\quad").Literal_().Tex_only_());
Add(trie, Make("\\Re").Literal_().Tex_only_());
Add(trie, Make("\\rho").Literal_().Tex_only_());
Add(trie, Make("\\rightarrow").Literal_().Tex_only_());
Add(trie, Make("\\Rightarrow").Literal_().Tex_only_());
Add(trie, Make("\\rightarrowtail").Literal_().Tex_only_());
Add(trie, Make("\\rightharpoondown").Literal_().Tex_only_());
Add(trie, Make("\\rightharpoonup").Literal_().Tex_only_());
Add(trie, Make("\\rightleftarrows").Literal_().Tex_only_());
Add(trie, Make("\\rightrightarrows").Literal_().Tex_only_());
Add(trie, Make("\\rightsquigarrow").Literal_().Tex_only_());
Add(trie, Make("\\rightthreetimes").Literal_().Tex_only_());
Add(trie, Make("\\risingdotseq").Literal_().Tex_only_());
Add(trie, Make("\\Rrightarrow").Literal_().Tex_only_());
Add(trie, Make("\\Rsh").Literal_().Tex_only_());
Add(trie, Make("\\rtimes").Literal_().Tex_only_());
Add(trie, Make("\\rVert").Literal_().Tex_only_());
Add(trie, Make("\\S").Literal_().Tex_only_());
Add(trie, Make("\\scriptscriptstyle").Literal_().Tex_only_());
Add(trie, Make("\\scriptstyle").Literal_().Tex_only_());
Add(trie, Make("\\searrow").Literal_().Tex_only_());
Add(trie, Make("\\setminus").Literal_().Tex_only_());
Add(trie, Make("\\sharp").Literal_().Tex_only_());
Add(trie, Make("\\shortmid").Literal_().Tex_only_());
Add(trie, Make("\\shortparallel").Literal_().Tex_only_());
Add(trie, Make("\\sigma").Literal_().Tex_only_());
Add(trie, Make("\\Sigma").Literal_().Tex_only_());
Add(trie, Make("\\sim").Literal_().Tex_only_());
Add(trie, Make("\\simeq").Literal_().Tex_only_());
Add(trie, Make("\\smallfrown").Literal_().Tex_only_());
Add(trie, Make("\\smallsetminus").Literal_().Tex_only_());
Add(trie, Make("\\smallsmile").Literal_().Tex_only_());
Add(trie, Make("\\smile").Literal_().Tex_only_());
Add(trie, Make("\\spadesuit").Literal_().Tex_only_());
Add(trie, Make("\\sphericalangle").Literal_().Tex_only_());
Add(trie, Make("\\sqcap").Literal_().Tex_only_());
Add(trie, Make("\\sqcup").Literal_().Tex_only_());
Add(trie, Make("\\sqsubset").Literal_().Tex_only_());
Add(trie, Make("\\sqsubseteq").Literal_().Tex_only_());
Add(trie, Make("\\sqsupset").Literal_().Tex_only_());
Add(trie, Make("\\sqsupseteq").Literal_().Tex_only_());
Add(trie, Make("\\square").Literal_().Tex_only_());
Add(trie, Make("\\star").Literal_().Tex_only_());
Add(trie, Make("\\subset").Literal_().Tex_only_());
Add(trie, Make("\\Subset").Literal_().Tex_only_());
Add(trie, Make("\\subseteq").Literal_().Tex_only_());
Add(trie, Make("\\subseteqq").Literal_().Tex_only_());
Add(trie, Make("\\subsetneq").Literal_().Tex_only_());
Add(trie, Make("\\subsetneqq").Literal_().Tex_only_());
Add(trie, Make("\\succ").Literal_().Tex_only_());
Add(trie, Make("\\succapprox").Literal_().Tex_only_());
Add(trie, Make("\\succcurlyeq").Literal_().Tex_only_());
Add(trie, Make("\\succeq").Literal_().Tex_only_());
Add(trie, Make("\\succnapprox").Literal_().Tex_only_());
Add(trie, Make("\\succneqq").Literal_().Tex_only_());
Add(trie, Make("\\succnsim").Literal_().Tex_only_());
Add(trie, Make("\\succsim").Literal_().Tex_only_());
Add(trie, Make("\\sum").Literal_().Tex_only_());
Add(trie, Make("\\supset").Literal_().Tex_only_());
Add(trie, Make("\\Supset").Literal_().Tex_only_());
Add(trie, Make("\\supseteq").Literal_().Tex_only_());
Add(trie, Make("\\supseteqq").Literal_().Tex_only_());
Add(trie, Make("\\supsetneq").Literal_().Tex_only_());
Add(trie, Make("\\supsetneqq").Literal_().Tex_only_());
Add(trie, Make("\\surd").Literal_().Tex_only_());
Add(trie, Make("\\swarrow").Literal_().Tex_only_());
Add(trie, Make("\\tau").Literal_().Tex_only_());
Add(trie, Make("\\textstyle").Literal_().Tex_only_());
Add(trie, Make("\\textvisiblespace").Literal_().Tex_only_());
Add(trie, Make("\\therefore").Literal_().Tex_only_());
Add(trie, Make("\\theta").Literal_().Tex_only_());
Add(trie, Make("\\Theta").Literal_().Tex_only_());
Add(trie, Make("\\thickapprox").Literal_().Tex_only_());
Add(trie, Make("\\thicksim").Literal_().Tex_only_());
Add(trie, Make("\\times").Literal_().Tex_only_());
Add(trie, Make("\\to").Literal_().Tex_only_());
Add(trie, Make("\\top").Literal_().Tex_only_());
Add(trie, Make("\\triangle").Literal_().Tex_only_());
Add(trie, Make("\\triangledown").Literal_().Tex_only_());
Add(trie, Make("\\triangleleft").Literal_().Tex_only_());
Add(trie, Make("\\trianglelefteq").Literal_().Tex_only_());
Add(trie, Make("\\triangleq").Literal_().Tex_only_());
Add(trie, Make("\\triangleright").Literal_().Tex_only_());
Add(trie, Make("\\trianglerighteq").Literal_().Tex_only_());
Add(trie, Make("\\underbrace").Literal_().Tex_only_());
Add(trie, Make("\\underline").Literal_().Tex_only_());
Add(trie, Make("\\upharpoonleft").Literal_().Tex_only_());
Add(trie, Make("\\upharpoonright").Literal_().Tex_only_());
Add(trie, Make("\\uplus").Literal_().Tex_only_());
Add(trie, Make("\\upsilon").Literal_().Tex_only_());
Add(trie, Make("\\Upsilon").Literal_().Tex_only_());
Add(trie, Make("\\upuparrows").Literal_().Tex_only_());
Add(trie, Make("\\varepsilon").Literal_().Tex_only_());
Add(trie, Make("\\varinjlim").Literal_().Tex_only_());
Add(trie, Make("\\varkappa").Literal_().Tex_only_());
Add(trie, Make("\\varliminf").Literal_().Tex_only_());
Add(trie, Make("\\varlimsup").Literal_().Tex_only_());
Add(trie, Make("\\varnothing").Literal_().Tex_only_());
Add(trie, Make("\\varphi").Literal_().Tex_only_());
Add(trie, Make("\\varpi").Literal_().Tex_only_());
Add(trie, Make("\\varprojlim").Literal_().Tex_only_());
Add(trie, Make("\\varpropto").Literal_().Tex_only_());
Add(trie, Make("\\varrho").Literal_().Tex_only_());
Add(trie, Make("\\varsigma").Literal_().Tex_only_());
Add(trie, Make("\\varsubsetneq").Literal_().Tex_only_());
Add(trie, Make("\\varsubsetneqq").Literal_().Tex_only_());
Add(trie, Make("\\varsupsetneq").Literal_().Tex_only_());
Add(trie, Make("\\varsupsetneqq").Literal_().Tex_only_());
Add(trie, Make("\\vartheta").Literal_().Tex_only_());
Add(trie, Make("\\vartriangle").Literal_().Tex_only_());
Add(trie, Make("\\vartriangleleft").Literal_().Tex_only_());
Add(trie, Make("\\vartriangleright").Literal_().Tex_only_());
Add(trie, Make("\\vdash").Literal_().Tex_only_());
Add(trie, Make("\\Vdash").Literal_().Tex_only_());
Add(trie, Make("\\vDash").Literal_().Tex_only_());
Add(trie, Make("\\vdots").Literal_().Tex_only_());
Add(trie, Make("\\vee").Literal_().Tex_only_());
Add(trie, Make("\\veebar").Literal_().Tex_only_());
Add(trie, Make("\\vline").Literal_().Tex_only_());
Add(trie, Make("\\Vvdash").Literal_().Tex_only_());
Add(trie, Make("\\wedge").Literal_().Tex_only_());
Add(trie, Make("\\widehat").Literal_().Tex_only_());
Add(trie, Make("\\widetilde").Literal_().Tex_only_());
Add(trie, Make("\\wp").Literal_().Tex_only_());
Add(trie, Make("\\wr").Literal_().Tex_only_());
Add(trie, Make("\\xi").Literal_().Tex_only_());
Add(trie, Make("\\Xi").Literal_().Tex_only_());
Add(trie, Make("\\zeta").Literal_().Tex_only_());
Add(trie, Make("\\big").Big_());
Add(trie, Make("\\Big").Big_());
Add(trie, Make("\\bigg").Big_());
Add(trie, Make("\\Bigg").Big_());
Add(trie, Make("\\biggl").Big_());
Add(trie, Make("\\Biggl").Big_());
Add(trie, Make("\\biggr").Big_());
Add(trie, Make("\\Biggr").Big_());
Add(trie, Make("\\bigl").Big_());
Add(trie, Make("\\Bigl").Big_());
Add(trie, Make("\\bigr").Big_());
Add(trie, Make("\\Bigr").Big_());
Add(trie, Make("\\backslash").Delimiter_().Tex_only_());
Add(trie, Make("\\downarrow").Delimiter_().Tex_only_());
Add(trie, Make("\\Downarrow").Delimiter_().Tex_only_());
Add(trie, Make("\\langle").Delimiter_().Tex_only_());
Add(trie, Make("\\lbrace").Delimiter_().Tex_only_());
Add(trie, Make("\\lceil").Delimiter_().Tex_only_());
Add(trie, Make("\\lfloor").Delimiter_().Tex_only_());
Add(trie, Make("\\llcorner").Delimiter_().Tex_only_());
Add(trie, Make("\\lrcorner").Delimiter_().Tex_only_());
Add(trie, Make("\\rangle").Delimiter_().Tex_only_());
Add(trie, Make("\\rbrace").Delimiter_().Tex_only_());
Add(trie, Make("\\rceil").Delimiter_().Tex_only_());
Add(trie, Make("\\rfloor").Delimiter_().Tex_only_());
Add(trie, Make("\\rightleftharpoons").Delimiter_().Tex_only_());
Add(trie, Make("\\twoheadleftarrow").Delimiter_().Tex_only_());
Add(trie, Make("\\twoheadrightarrow").Delimiter_().Tex_only_());
Add(trie, Make("\\ulcorner").Delimiter_().Tex_only_());
Add(trie, Make("\\uparrow").Delimiter_().Tex_only_());
Add(trie, Make("\\Uparrow").Delimiter_().Tex_only_());
Add(trie, Make("\\updownarrow").Delimiter_().Tex_only_());
Add(trie, Make("\\Updownarrow").Delimiter_().Tex_only_());
Add(trie, Make("\\urcorner").Delimiter_().Tex_only_());
Add(trie, Make("\\Vert").Delimiter_().Tex_only_());
Add(trie, Make("\\vert").Delimiter_().Tex_only_());
Add(trie, Make("\\lbrack").Delimiter_().Tex_only_());
Add(trie, Make("\\rbrack").Delimiter_().Tex_only_());
Add(trie, Make("\\acute").Fun_ar1_());
Add(trie, Make("\\bar").Fun_ar1_());
Add(trie, Make("\\bcancel").Fun_ar1_());
Add(trie, Make("\\bmod").Fun_ar1_());
Add(trie, Make("\\boldsymbol").Fun_ar1_());
Add(trie, Make("\\breve").Fun_ar1_());
Add(trie, Make("\\cancel").Fun_ar1_());
Add(trie, Make("\\check").Fun_ar1_());
Add(trie, Make("\\ddot").Fun_ar1_());
Add(trie, Make("\\dot").Fun_ar1_());
Add(trie, Make("\\emph").Fun_ar1_());
Add(trie, Make("\\grave").Fun_ar1_());
Add(trie, Make("\\hat").Fun_ar1_());
Add(trie, Make("\\mathbb").Fun_ar1_());
Add(trie, Make("\\mathbf").Fun_ar1_());
Add(trie, Make("\\mathbin").Fun_ar1_());
Add(trie, Make("\\mathcal").Fun_ar1_());
Add(trie, Make("\\mathclose").Fun_ar1_());
Add(trie, Make("\\mathfrak").Fun_ar1_());
Add(trie, Make("\\mathit").Fun_ar1_());
Add(trie, Make("\\mathop").Fun_ar1_());
Add(trie, Make("\\mathopen").Fun_ar1_());
Add(trie, Make("\\mathord").Fun_ar1_());
Add(trie, Make("\\mathpunct").Fun_ar1_());
Add(trie, Make("\\mathrel").Fun_ar1_());
Add(trie, Make("\\mathrm").Fun_ar1_());
Add(trie, Make("\\mathsf").Fun_ar1_());
Add(trie, Make("\\mathtt").Fun_ar1_());
Add(trie, Make("\\operatorname").Fun_ar1_());
Add(trie, Make("\\pmod").Fun_ar1_());
Add(trie, Make("\\sqrt").Fun_ar1_());
Add(trie, Make("\\textbf").Fun_ar1_());
Add(trie, Make("\\textit").Fun_ar1_());
Add(trie, Make("\\textrm").Fun_ar1_());
Add(trie, Make("\\textsf").Fun_ar1_());
Add(trie, Make("\\texttt").Fun_ar1_());
Add(trie, Make("\\tilde").Fun_ar1_());
Add(trie, Make("\\vec").Fun_ar1_());
Add(trie, Make("\\xcancel").Fun_ar1_());
Add(trie, Make("\\xleftarrow").Fun_ar1_());
Add(trie, Make("\\xrightarrow").Fun_ar1_());
Add(trie, Make("\\binom").Fun_ar2_());
Add(trie, Make("\\cancelto").Fun_ar2_());
Add(trie, Make("\\cfrac").Fun_ar2_());
Add(trie, Make("\\dbinom").Fun_ar2_());
Add(trie, Make("\\dfrac").Fun_ar2_());
Add(trie, Make("\\frac").Fun_ar2_());
Add(trie, Make("\\overset").Fun_ar2_());
Add(trie, Make("\\stackrel").Fun_ar2_());
Add(trie, Make("\\tbinom").Fun_ar2_());
Add(trie, Make("\\tfrac").Fun_ar2_());
Add(trie, Make("\\underset").Fun_ar2_());
Add(trie, Make("\\atop").Fun_infix_());
Add(trie, Make("\\choose").Fun_infix_());
Add(trie, Make("\\over").Fun_infix_());
Add(trie, Make("\\Coppa").Literal_().Tex_only_().Manual_("\\mbox{~0}"));
Add(trie, Make("\\coppa").Literal_().Tex_only_().Manual_("\\mbox{~0}"));
Add(trie, Make("\\Digamma").Literal_().Tex_only_().Manual_("\\mbox{~0}"));
Add(trie, Make("\\euro").Literal_().Tex_only_().Manual_("\\mbox{~0}"));
Add(trie, Make("\\geneuro").Literal_().Tex_only_().Manual_("\\mbox{~0}"));
Add(trie, Make("\\geneuronarrow").Literal_().Tex_only_().Manual_("\\mbox{~0}"));
Add(trie, Make("\\geneurowide").Literal_().Tex_only_().Manual_("\\mbox{~0}"));
Add(trie, Make("\\Koppa").Literal_().Tex_only_().Manual_("\\mbox{~0}"));
Add(trie, Make("\\koppa").Literal_().Tex_only_().Manual_("\\mbox{~0}"));
Add(trie, Make("\\officialeuro").Literal_().Tex_only_().Manual_("\\mbox{~0}"));
Add(trie, Make("\\Sampi").Literal_().Tex_only_().Manual_("\\mbox{~0}"));
Add(trie, Make("\\sampi").Literal_().Tex_only_().Manual_("\\mbox{~0}"));
Add(trie, Make("\\Stigma").Literal_().Tex_only_().Manual_("\\mbox{~0}"));
Add(trie, Make("\\stigma").Literal_().Tex_only_().Manual_("\\mbox{~0}"));
Add(trie, Make("\\varstigma").Literal_().Tex_only_().Manual_("\\mbox{~0}"));
Add(trie, Make("\\C").Literal_().Tex_only_().Manual_("\\mathbb{C}"));
Add(trie, Make("\\H").Literal_().Tex_only_().Manual_("\\mathbb{H}"));
Add(trie, Make("\\N").Literal_().Tex_only_().Manual_("\\mathbb{N}"));
Add(trie, Make("\\Q").Literal_().Tex_only_().Manual_("\\mathbb{Q}"));
Add(trie, Make("\\R").Literal_().Tex_only_().Manual_("\\mathbb{R}"));
Add(trie, Make("\\Z").Literal_().Tex_only_().Manual_("\\mathbb{Z}"));
Add(trie, Make("\\darr").Delimiter_().Tex_only_().Manual_("\\downarrow"));
Add(trie, Make("\\dArr").Delimiter_().Tex_only_().Manual_("\\Downarrow"));
Add(trie, Make("\\Darr").Delimiter_().Tex_only_().Manual_("\\Downarrow"));
Add(trie, Make("\\lang").Delimiter_().Tex_only_().Manual_("\\langle"));
Add(trie, Make("\\rang").Delimiter_().Tex_only_().Manual_("\\rangle"));
Add(trie, Make("\\uarr").Delimiter_().Tex_only_().Manual_("\\uparrow"));
Add(trie, Make("\\uArr").Delimiter_().Tex_only_().Manual_("\\Uparrow"));
Add(trie, Make("\\Uarr").Delimiter_().Tex_only_().Manual_("\\Uparrow"));
Add(trie, Make("\\Bbb").Fun_ar1_().Manual_("\\mathbb"));
Add(trie, Make("\\bold").Fun_ar1_().Manual_("\\mathbf"));
Add(trie, Make("\\alef").Literal_().Tex_only_().Manual_("\\aleph"));
Add(trie, Make("\\alefsym").Literal_().Tex_only_().Manual_("\\aleph"));
Add(trie, Make("\\Alpha").Literal_().Tex_only_().Manual_("\\mathrm{A}"));
Add(trie, Make("\\and").Literal_().Tex_only_().Manual_("\\land"));
Add(trie, Make("\\ang").Literal_().Tex_only_().Manual_("\\angle"));
Add(trie, Make("\\Beta").Literal_().Tex_only_().Manual_("\\mathrm{B}"));
Add(trie, Make("\\bull").Literal_().Tex_only_().Manual_("\\bullet"));
Add(trie, Make("\\Chi").Literal_().Tex_only_().Manual_("\\mathrm{X}"));
Add(trie, Make("\\clubs").Literal_().Tex_only_().Manual_("\\clubsuit"));
Add(trie, Make("\\cnums").Literal_().Tex_only_().Manual_("\\mathbb{C}"));
Add(trie, Make("\\Complex").Literal_().Tex_only_().Manual_("\\mathbb{C}"));
Add(trie, Make("\\Dagger").Literal_().Tex_only_().Manual_("\\ddagger"));
Add(trie, Make("\\diamonds").Literal_().Tex_only_().Manual_("\\diamondsuit"));
Add(trie, Make("\\Doteq").Literal_().Tex_only_().Manual_("\\doteqdot"));
Add(trie, Make("\\doublecap").Literal_().Tex_only_().Manual_("\\Cap"));
Add(trie, Make("\\doublecup").Literal_().Tex_only_().Manual_("\\Cup"));
Add(trie, Make("\\empty").Literal_().Tex_only_().Manual_("\\emptyset"));
Add(trie, Make("\\Epsilon").Literal_().Tex_only_().Manual_("\\mathrm{E}"));
Add(trie, Make("\\Eta").Literal_().Tex_only_().Manual_("\\mathrm{H}"));
Add(trie, Make("\\exist").Literal_().Tex_only_().Manual_("\\exists"));
Add(trie, Make("\\ge").Literal_().Tex_only_().Manual_("\\geq"));
Add(trie, Make("\\gggtr").Literal_().Tex_only_().Manual_("\\ggg"));
Add(trie, Make("\\hAar").Literal_().Tex_only_().Manual_("\\Leftrightarrow"));
Add(trie, Make("\\harr").Literal_().Tex_only_().Manual_("\\leftrightarrow"));
Add(trie, Make("\\Harr").Literal_().Tex_only_().Manual_("\\Leftrightarrow"));
Add(trie, Make("\\hearts").Literal_().Tex_only_().Manual_("\\heartsuit"));
Add(trie, Make("\\image").Literal_().Tex_only_().Manual_("\\Im"));
Add(trie, Make("\\infin").Literal_().Tex_only_().Manual_("\\infty"));
Add(trie, Make("\\Iota").Literal_().Tex_only_().Manual_("\\mathrm{I}"));
Add(trie, Make("\\isin").Literal_().Tex_only_().Manual_("\\in"));
Add(trie, Make("\\Kappa").Literal_().Tex_only_().Manual_("\\mathrm{K}"));
Add(trie, Make("\\larr").Literal_().Tex_only_().Manual_("\\leftarrow"));
Add(trie, Make("\\Larr").Literal_().Tex_only_().Manual_("\\Leftarrow"));
Add(trie, Make("\\lArr").Literal_().Tex_only_().Manual_("\\Leftarrow"));
Add(trie, Make("\\le").Literal_().Tex_only_().Manual_("\\leq"));
Add(trie, Make("\\lrarr").Literal_().Tex_only_().Manual_("\\leftrightarrow"));
Add(trie, Make("\\Lrarr").Literal_().Tex_only_().Manual_("\\Leftrightarrow"));
Add(trie, Make("\\lrArr").Literal_().Tex_only_().Manual_("\\Leftrightarrow"));
Add(trie, Make("\\Mu").Literal_().Tex_only_().Manual_("\\mathrm{M}"));
Add(trie, Make("\\natnums").Literal_().Tex_only_().Manual_("\\mathbb{N}"));
Add(trie, Make("\\ne").Literal_().Tex_only_().Manual_("\\neq"));
Add(trie, Make("\\Nu").Literal_().Tex_only_().Manual_("\\mathrm{N}"));
Add(trie, Make("\\O").Literal_().Tex_only_().Manual_("\\emptyset"));
Add(trie, Make("\\omicron").Literal_().Tex_only_().Manual_("\\mathrm{o}"));
Add(trie, Make("\\Omicron").Literal_().Tex_only_().Manual_("\\mathrm{O}"));
Add(trie, Make("\\or").Literal_().Tex_only_().Manual_("\\lor"));
Add(trie, Make("\\part").Literal_().Tex_only_().Manual_("\\partial"));
Add(trie, Make("\\plusmn").Literal_().Tex_only_().Manual_("\\pm"));
Add(trie, Make("\\rarr").Literal_().Tex_only_().Manual_("\\rightarrow"));
Add(trie, Make("\\Rarr").Literal_().Tex_only_().Manual_("\\Rightarrow"));
Add(trie, Make("\\rArr").Literal_().Tex_only_().Manual_("\\Rightarrow"));
Add(trie, Make("\\real").Literal_().Tex_only_().Manual_("\\Re"));
Add(trie, Make("\\reals").Literal_().Tex_only_().Manual_("\\mathbb{R}"));
Add(trie, Make("\\Reals").Literal_().Tex_only_().Manual_("\\mathbb{R}"));
Add(trie, Make("\\restriction").Literal_().Tex_only_().Manual_("\\upharpoonright"));
Add(trie, Make("\\Rho").Literal_().Tex_only_().Manual_("\\mathrm{P}"));
Add(trie, Make("\\sdot").Literal_().Tex_only_().Manual_("\\cdot"));
Add(trie, Make("\\sect").Literal_().Tex_only_().Manual_("\\S"));
Add(trie, Make("\\spades").Literal_().Tex_only_().Manual_("\\spadesuit"));
Add(trie, Make("\\sub").Literal_().Tex_only_().Manual_("\\subset"));
Add(trie, Make("\\sube").Literal_().Tex_only_().Manual_("\\subseteq"));
Add(trie, Make("\\supe").Literal_().Tex_only_().Manual_("\\supseteq"));
Add(trie, Make("\\Tau").Literal_().Tex_only_().Manual_("\\mathrm{T}"));
Add(trie, Make("\\thetasym").Literal_().Tex_only_().Manual_("\\vartheta"));
Add(trie, Make("\\varcoppa").Literal_().Tex_only_().Manual_("\\mbox{coppa}"));
Add(trie, Make("\\weierp").Literal_().Tex_only_().Manual_("\\wp"));
Add(trie, Make("\\Zeta").Literal_().Tex_only_().Manual_("\\mathrm{Z}"));
Add(trie, Make("\\rm").Declh_().Fontforce_rm_());
Add(trie, Make("\\it").Declh_().Fontforce_rm_());
Add(trie, Make("\\cal").Declh_().Fontforce_rm_());
Add(trie, Make("\\bf").Declh_().Fontforce_rm_());
Add(trie, Make("\\sideset").Fun_ar2nb_().Manual_("\\sideset "));
Add(trie, Make("\\left").Left_());
Add(trie, Make("\\right").Right_());
Add(trie, Make("\\text").Fail_());
Add(trie, Make("\\mbox").Fail_());
Add(trie, Make("\\vbox").Fail_());
Add(trie, Make("\\hbox").Fail_());
Add(trie, Make("\\arccos").Type_latex_());
Add(trie, Make("\\arcsin").Type_latex_());
Add(trie, Make("\\arctan").Type_latex_());
Add(trie, Make("\\arg").Type_latex_());
Add(trie, Make("\\cos").Type_latex_());
Add(trie, Make("\\cosh").Type_latex_());
Add(trie, Make("\\cot").Type_latex_());
Add(trie, Make("\\coth").Type_latex_());
Add(trie, Make("\\csc").Type_latex_());
Add(trie, Make("\\deg").Type_latex_());
Add(trie, Make("\\det").Type_latex_());
Add(trie, Make("\\dim").Type_latex_());
Add(trie, Make("\\exp").Type_latex_());
Add(trie, Make("\\gcd").Type_latex_());
Add(trie, Make("\\hom").Type_latex_());
Add(trie, Make("\\inf").Type_latex_());
Add(trie, Make("\\ker").Type_latex_());
Add(trie, Make("\\lg").Type_latex_());
Add(trie, Make("\\lim").Type_latex_());
Add(trie, Make("\\liminf").Type_latex_());
Add(trie, Make("\\limsup").Type_latex_());
Add(trie, Make("\\ln").Type_latex_());
Add(trie, Make("\\log").Type_latex_());
Add(trie, Make("\\max").Type_latex_());
Add(trie, Make("\\min").Type_latex_());
Add(trie, Make("\\Pr").Type_latex_());
Add(trie, Make("\\sec").Type_latex_());
Add(trie, Make("\\sin").Type_latex_());
Add(trie, Make("\\sinh").Type_latex_());
Add(trie, Make("\\sup").Type_latex_());
Add(trie, Make("\\tan").Type_latex_());
Add(trie, Make("\\tanh").Type_latex_());
Add(trie, Make("\\arccot").Type_mw_());
Add(trie, Make("\\arcsec").Type_mw_());
Add(trie, Make("\\arccsc").Type_mw_());
Add(trie, Make("\\sgn").Type_mw_());
Add(trie, Make("\\sen").Type_mw_());
return trie;
}
private Mwm_tkn__func Make(String key) {return new Mwm_tkn__func(Bry_.new_a7(key));} // NOTE: TEX func names are ASCII
private void Add(Btrie_slim_mgr trie, Mwm_tkn__func tkn) {trie.Add_obj(tkn.Key(), tkn);}
}

View File

@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.xtns.math.parsers; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.math.*;
class Mwm_tkn__leaf implements Mwm_tkn {
class Mwm_tkn__leaf_raw implements Mwm_tkn {
public Mwm_tkn Init(Mwm_tkn__root root, int tid, int uid, int src_bgn, int src_end) {
this.root = root;
this.tid = tid;
@@ -26,7 +26,7 @@ class Mwm_tkn__leaf implements Mwm_tkn {
return this;
}
public Mwm_tkn__root Root() {return root;} private Mwm_tkn__root root;
public int Tid() {return tid;} private int tid;
@gplx.Virtual public int Tid() {return tid;} private int tid;
public int Uid() {return uid;} private int uid;
public int Src_bgn() {return src_bgn;} private int src_bgn;
public int Src_end() {return src_end;} private int src_end;

View File

@@ -0,0 +1,44 @@
/*
XOWA: the XOWA Offline Wiki Application
Copyright (C) 2012 gnosygnu@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.xtns.math.parsers; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.math.*;
class Mwm_tkn__leaf_repl implements Mwm_tkn {
private final byte[] repl;
public Mwm_tkn__leaf_repl(int tid, byte[] repl) {
this.tid = tid;
this.repl = repl;
}
public Mwm_tkn Init(Mwm_tkn__root root, int tid, int uid, int src_bgn, int src_end) {
this.root = root;
this.uid = uid;
this.src_bgn = src_bgn;
this.src_end = src_end;
return this;
}
public Mwm_tkn__root Root() {return root;} private Mwm_tkn__root root;
public int Tid() {return tid;} private final int tid;
public int Uid() {return uid;} private int uid;
public int Src_bgn() {return src_bgn;} private int src_bgn;
public int Src_end() {return src_end;} private int src_end;
public void Src_end_(int v) {this.src_end = v;}
public int Subs__len() {return 0;}
public Mwm_tkn Subs__get_at(int i) {throw Err_.new_unsupported();}
public void To_bry(Bry_bfr bfr, int indent) {
Mwm_tkn_.Tkn_to_bry__bgn(bfr, indent, this);
Mwm_tkn_.Tkn_to_bry__end_head(bfr);
}
}

View File

@@ -20,19 +20,19 @@ class Mwm_tkn__root implements Mwm_tkn {
private final Mwm_root_reg root_reg;
private final Mwm_root_ary root_ary = new Mwm_root_ary();
private final Mwm_root_sub root_sub = new Mwm_root_sub();
public Mwm_tkn__root(Mwm_tkn_mkr tkn_mkr) {
this.tkn_mkr = tkn_mkr;
private Mwm_tkn_mkr tkn_mkr;
public Mwm_tkn__root() {
this.root_reg = new Mwm_root_reg(this);
}
public Mwm_tkn__root Root() {return this;}
public Mwm_tkn_mkr Tkn_mkr() {return tkn_mkr;} private final Mwm_tkn_mkr tkn_mkr;
public int Tid() {return Mwm_tkn_.Tid__root;}
public int Uid() {return Mwm_tkn_.Uid__root;}
public int Src_bgn() {return src_bgn;} private int src_bgn;
public int Src_end() {return src_end;} private int src_end;
public void Src_end_(int v) {this.src_end = v;}
public Mwm_tkn Init(Mwm_tkn__root root, int tid, int uid, int src_bgn, int src_end) {throw Err_.new_unsupported();}
public Mwm_tkn Init_as_root(int src_bgn, int src_end) {
public Mwm_tkn Init_as_root(Mwm_tkn_mkr tkn_mkr, int src_bgn, int src_end) {
this.tkn_mkr = tkn_mkr;
this.src_bgn = src_bgn; this.src_end = src_end;
int expd_len = (src_end - src_bgn) / 5;
root_reg.Init(expd_len);

View File

@@ -17,16 +17,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.xtns.math.parsers; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.math.*;
class Mwm_tkn_mkr {
private final Mwm_tkn__leaf tmp_leaf = new Mwm_tkn__leaf();
private final Mwm_tkn[] leaf_protos = new Mwm_tkn[Mwm_tkn_.Tid_len];
public void Reg_leaf(int tid, Mwm_tkn tkn) {
leaf_protos[tid] = tkn;
}
public Mwm_tkn Make_leaf(Mwm_tkn__root root, int tid, int uid, int bgn, int end) {
synchronized (tmp_leaf) {
tmp_leaf.Init(root, tid, uid, bgn, end);
return tmp_leaf;
}
Mwm_tkn proto = leaf_protos[tid];
return proto == null ? null : proto.Init(root, tid, uid, bgn, end);
}
public Mwm_tkn Make_func(Mwm_tkn__root root, int uid, int bgn, int end) {
Mwm_tkn__node rv = new Mwm_tkn__node();
rv.Init(root, Mwm_tkn_.Tid__func, uid, bgn, end);
rv.Init(root, Mwm_tkn_.Tid__fnc, uid, bgn, end);
return rv;
}
public Mwm_tkn Make_curly(Mwm_tkn__root root, int uid, int bgn, int end) {