Page 1 of 1

Escape forward slashes in ggg?

Posted: Tue Oct 05, 2021 2:01 pm
by WarpedWartWars
I.e., I want to make the Math Expressions example also emit powers, like this:

k3bcp + y4 ÷ z4(-2)e84-2-2 + i + doy

I got it working, mostly. But I can't have the forward slashes for [/sup], because ggg has a special use for them. My current workaround is to use backslashes, and replace them with forward slashes outside of ggg.

An example output is this:

Code: Select all

((j[sup](8)[\sup]) × mt × d[sup]-0[sup]m[sup]1[\sup][\sup][\sup][sup]-8[\sup] - r6[sup]3[sup]2[\sup][sup]j7[\sup][\sup](-5 × nn))[sup]ekj[\sup] × u[sup]1[\sup]
Turning the backslashes into forward slashes corrects it:

((j(8)) × mt × d-0m1-8 - r632j7(-5 × nn))ekj × u1

(Definitely not as simplified as it can be.)

If you want the rules for it, here they are:

Code: Select all

S=A
A=L|A O A|B|A[sup]A[\sup]
B=D|(A)|-D|A(A)
O=-|+|÷|×
L=E|EE|EEE|ED
E=a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z
D=DD|0|1|2|3|4|5|6|7|8|9|D.F
F=FF|0|1|2|3|4|5|6|7|8|9
Oh and make sure to have "Allow optional symbols with ()" unchecked.

Re: Escape forward slashes in ggg?

Posted: Tue Oct 05, 2021 2:35 pm
by WarpedWartWars
ca(o) - (dl × -9hnr)i

Complex numbers generated by

Code: Select all

S=A
A=L|A O A|B|A[sup]A[\sup]|(A) P (A)i
P=+|-
B=D|(A)|-D|A(A)
O=-|+|÷|×
L=E|EE|EEE|ED
E=a|b|c|d|e|f|g|h|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z
D=DD|0|1|2|3|4|5|6|7|8|9|D.F
F=FF|0|1|2|3|4|5|6|7|8|9