Mercurial > octave-nkf
diff libinterp/corefcn/oct-tex-symbols.in @ 17327:fe6518a1d87c
Move TeX symbol decoding into the lexer (bug #39831).
* libinterp/Makefile.am (BUILT_SOURCES): Add corefcn/oct-tex-symbols.cc.
(BUILT_DISTFILES): Add corefcn/oct-tex-lexer.ll and
corefcn/oct-tex-symbols.cc.
(EXTRA_DIST): Add corefcn/oct-tex-lexer.in.ll and
corefcn/oct-tex-symbols.in.
(ULT_DIST_SRC): Filter out corefcn/oct-tex-lexer.ll from DIST_SRC and
add corefcn/oct-tex-lexer.in.ll instead.
(CLEAN_FILES): Add corefcn/oct-tex-parser.output.
* libinterp/corefcn/modules.mk (corefcn/oct-tex-lexer.ll,
corefcn/oct-tex-symbols.cc): New rules to build the TeX lexer.
(corefcn/txt-eng.cc): Add dependency on corefcn/oct-tex-symbols.cc.
* libinterp/corefcn/oct-tex-lexer.in.ll: Renamed from oct-tex.lexer.ll.
Remove COMMAND state. Remove ID regex. Replace rules for symbols with
tag @SYMBOL_RULES@.
* libinterp/corefcn/oct-tex-parser.yy (ID, CMD, identifier): Remove
tokens.
(SYM, sym): New token and value.
(symbol_element): Build from SYM.
* libinterp/corefcn/oct-tex-symbols.in: New file with supported TeX
symbols and corresponding codes (unicode and MS symbols).
* libinterp/corefcn/txt-eng.h (class text_element_symbol): Make it
inherit from text_element.
(text_element_symbol::code): Removed member.
(text_element_symbol::symbol): New member.
(text_element_symbol::text_element_symbol): Adapt constructor.
(text_element_symbol::get_symbol): New method.
(text_element_symbol::get_symbol_code): Make const.
* libinterp/corefcn/txt-eng.cc (symbol_names, symbol_codes): Remove
static variables, now auto-generated from oct-tex-symbols.in.
(oct-tex-symbols.cc): New include.
(text_element_symbol::get_symbol_code): Change implementation to simply
index into auto-generated symbol_codes array.
* libinterp/corefcn/txt-eng-ft.cc
(ft_render::visit(text_element_symbol)): Don't use
text_element_symbol::string_value(), use
text_element_symbol::get_symbol() instead.
author | Michael Goffioul <michael.goffioul@gmail.com> |
---|---|
date | Sat, 24 Aug 2013 14:27:09 -0400 |
parents | |
children | 4daf633100db |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libinterp/corefcn/oct-tex-symbols.in Sat Aug 24 14:27:09 2013 -0400 @@ -0,0 +1,110 @@ +# List of supported symbols for the TeX interpreter +# (http://www.mathworks.com/help/matlab/ref/text_props.html): +# - symbol name +# - Unicode code +# - MS symbol code (http://www.kostis.net/charsets/symbol.htm) + +alpha 0x03B1 0xF061 +angle 0x2220 0xF0D0 +ast 0x2217 0xF02A +beta 0x03B2 0xF062 +gamma 0x03B3 0xF067 +delta 0x03B4 0xF064 +epsilon 0x03B5 0xF065 +zeta 0x03B6 0xF07A +eta 0x03B7 0xF068 +theta 0x03B8 0xF071 +vartheta 0x03D1 0xF04A +iota 0x03B9 0xF069 +kappa 0x03BA 0xF06B +lambda 0x03BB 0xF06C +mu 0x03BC 0xF06D +nu 0x03BD 0xF06E +xi 0x03BE 0xF078 +pi 0x03C0 0xF070 +rho 0x03C1 0xF072 +sigma 0x03C3 0xF073 +varsigma 0x03C2 0xF056 +tau 0x03C4 0xF074 +equiv 0x2261 0xF0BA +Im 0x2111 0xF0C1 +otimes 0x2297 0xF0C4 +cap 0x2229 0xF0C7 +supset 0x2283 0xF0C9 +int 0x222B 0xF0F2 +rfloor 0x230B 0xF0FB +lfloor 0x230A 0xF0EB +perp 0x22A5 0xF05E +wedge 0x2227 0xF0D9 +rceil 0x2309 0xF0F9 +vee 0x2228 0xF0DA +langle 0x27E8 0xF0E1 + +upsilon 0x03C5 0xF075 +phi 0x03C6 0xF066 +chi 0x03C7 0xF063 +psi 0x03C8 0xF079 +omega 0x03C9 0xF077 +Gamma 0x0393 0xF047 +Delta 0x0394 0xF044 +Theta 0x0398 0xF051 +Lambda 0x039B 0xF04C +Xi 0x039E 0xF058 +Pi 0x03A0 0xF050 +Sigma 0x03A3 0xF053 +Upsilon 0x03D2 0xF055 +Phi 0x03A6 0xF046 +Psi 0x03A8 0xF059 +Omega 0x03A9 0xF057 +forall 0x2200 0xF022 +exists 0x2203 0xF024 +ni 0x220B 0xF027 +cong 0x2245 0xF040 +approx 0x2248 0xF0BB +Re 0x211C 0xF0C2 +oplus 0x2295 0xF0C5 +cup 0x222A 0xF0C8 +subseteq 0x2286 0xF0CD +in 0x2208 0xF0CE +lceil 0x2308 0xF0E9 +cdot 0x22C5 0xF0D7 +neg 0x00AC 0xF0D8 +times 0x00D7 0xF0B4 +surd 0x221A 0xF0D6 +varpi 0x03D6 0xF076 +rangle 0x27E9 0xF0F1 + +sim 0x223C 0xF07E +leq 0x2264 0xF0A3 +infty 0x221E 0xF0A5 +clubsuit 0x2663 0xF0A7 +diamondsuit 0x2666 0xF0A8 +heartsuit 0x2665 0xF0A9 +spadesuit 0x2660 0xF0AA +leftrightarrow 0x2194 0xF0AB +leftarrow 0x2190 0xF0AC +Leftarrow 0x21D0 0xF0DC +uparrow 0x2191 0xF0AD +rightarrow 0x2192 0xF0AE +Rightarrow 0x21D2 0xF0DE +downarrow 0x2193 0xF0AF +circ 0x25CB 0xF0B0 +pm 0x00B1 0xF0B1 +geq 0x2265 0xF0B3 +propto 0x221D 0xF0B5 +partial 0x2202 0xF0B6 +bullet 0x2022 0xF0B7 +div 0x00F7 0xF0B8 +neq 0x2260 0xF0B9 +aleph 0x2135 0xF0C0 +wp 0x2118 0xF0C3 +oslash 0x2298 0xF0C6 +supseteq 0x2287 0xF0CA +subset 0x2282 0xF0CC +o 0x03BF 0xF0B0 +nabla 0x2207 0xF0D1 +ldots 0x2026 0xF0BC +prime 0x2032 0xF0A2 +0 0x2205 0xF0C6 +mid 0x2223 0xF0BD +copyright 0x00A9 0xF0E3