Add function constants, mapping and parsing
parent
01c9203bac
commit
7c345c83ec
@ -0,0 +1,119 @@
|
||||
use crate::tokens::{FontCommand, Greek};
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub enum Literal {
|
||||
Plus,
|
||||
Minus,
|
||||
CDot,
|
||||
Ast,
|
||||
Star,
|
||||
Slash,
|
||||
Backslash,
|
||||
Times,
|
||||
Div,
|
||||
LTimes,
|
||||
RTimes,
|
||||
Bowtie,
|
||||
Circ,
|
||||
OPlus,
|
||||
OTimes,
|
||||
ODot,
|
||||
Wedge,
|
||||
BidWedge,
|
||||
Vee,
|
||||
Cap,
|
||||
BigCap,
|
||||
Cup,
|
||||
BigCup,
|
||||
Del,
|
||||
Grad,
|
||||
PlusMinus,
|
||||
EmptySet,
|
||||
Infty,
|
||||
Aleph,
|
||||
Therefore,
|
||||
Because,
|
||||
LDots,
|
||||
CDots,
|
||||
VDots,
|
||||
DDots,
|
||||
EPipes,
|
||||
Quad,
|
||||
Angle,
|
||||
Frown,
|
||||
Triangle,
|
||||
Diamond,
|
||||
Square,
|
||||
LFloor,
|
||||
RFloor,
|
||||
LCeiling,
|
||||
RCeiling,
|
||||
Complex,
|
||||
Natural,
|
||||
Rational,
|
||||
Real,
|
||||
Integer,
|
||||
Eq,
|
||||
Ne,
|
||||
Lt,
|
||||
Gt,
|
||||
Le,
|
||||
Ge,
|
||||
Prec,
|
||||
PrecEq,
|
||||
Succ,
|
||||
SuccEq,
|
||||
In,
|
||||
NotIn,
|
||||
Subset,
|
||||
SupSet,
|
||||
SubSetEq,
|
||||
SupSetEq,
|
||||
Equiv,
|
||||
Cong,
|
||||
Approx,
|
||||
PropTo,
|
||||
And,
|
||||
Or,
|
||||
Not,
|
||||
Implies,
|
||||
If,
|
||||
ForAll,
|
||||
Exists,
|
||||
Bot,
|
||||
Top,
|
||||
VDash,
|
||||
Models,
|
||||
UpArrow,
|
||||
DownArrow,
|
||||
RightArrow,
|
||||
To,
|
||||
RightArrowTail,
|
||||
TwoHeadRightArrrow,
|
||||
MapsTo,
|
||||
LeftArrow,
|
||||
LeftRightArrow,
|
||||
BigRightArrow,
|
||||
BigLeftArrow,
|
||||
BigLeftRightArrow,
|
||||
Text(TextNode),
|
||||
Symbol(SymbolNode),
|
||||
Number(NumberNode),
|
||||
Greek(Greek),
|
||||
FontCommand(FontCommand),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct TextNode {
|
||||
text: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct SymbolNode {
|
||||
symbol: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct NumberNode {
|
||||
number: String,
|
||||
}
|
@ -1,2 +1,5 @@
|
||||
pub mod literal;
|
||||
pub mod enclosing;
|
||||
pub mod special;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum Element {}
|
||||
|
@ -0,0 +1,6 @@
|
||||
use crate::elements::Element;
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct Root {
|
||||
children: Vec<Element>,
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
pub mod tokenizer;
|
||||
pub mod tree_parser;
|
@ -0,0 +1,5 @@
|
||||
use crate::tokens::Token;
|
||||
|
||||
pub struct TreeParser {
|
||||
tokens: Vec<Token>,
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
pub const F_SIN: &str = "sin";
|
||||
pub const F_COS: &str = "cos";
|
||||
pub const F_TAN: &str = "tan";
|
||||
pub const F_SEC: &str = "sec";
|
||||
pub const F_CSC: &str = "csc";
|
||||
pub const F_COT: &str = "cot";
|
||||
pub const F_ARCSIN: &str = "arcsin";
|
||||
pub const F_ARCCOS: &str = "arccos";
|
||||
pub const F_ARCTAN: &str = "arctan";
|
||||
pub const F_SINH: &str = "sinh";
|
||||
pub const F_COSH: &str = "cosh";
|
||||
pub const F_TANH: &str = "tanh";
|
||||
pub const F_SECH: &str = "sech";
|
||||
pub const F_CSCH: &str = "csch";
|
||||
pub const F_COTH: &str = "coth";
|
||||
pub const F_EXP: &str = "exp";
|
||||
pub const F_LOG: &str = "log";
|
||||
pub const F_LN: &str = "ln";
|
||||
pub const F_DET: &str = "det";
|
||||
pub const F_DIM: &str = "dim";
|
||||
pub const F_MOD: &str = "mod";
|
||||
pub const F_GCD: &str = "gcd";
|
||||
pub const F_LCM: &str = "lcm";
|
||||
pub const F_LUB: &str = "lub";
|
||||
pub const F_GLB: &str = "glb";
|
||||
pub const F_MIN: &str = "min";
|
||||
pub const F_MAX: &str = "max";
|
||||
pub const F_F: &str = "f";
|
||||
pub const F_G: &str = "g";
|
Loading…
Reference in New Issue