Example #1
0
 public TypedAtom(SourceSpan source, Atom atom, TexAtomType leftType, TexAtomType rightType)
     : base(source)
 {
     this.Atom      = atom;
     this.LeftType  = leftType;
     this.RightType = rightType;
 }
Example #2
0
File: Glue.cs Project: Civa/Zenith
 public static Box CreateBox(TexAtomType leftAtomType, TexAtomType rightAtomType, TexEnvironment environment)
 {
     leftAtomType = leftAtomType > TexAtomType.Inner ? TexAtomType.Ordinary : leftAtomType;
     rightAtomType = rightAtomType > TexAtomType.Inner ? TexAtomType.Ordinary : rightAtomType;
     var glueType = glueRules[(int)leftAtomType, (int)rightAtomType, (int)environment.Style / 2];
     return glueTypes[glueType].CreateBox(environment);
 }
Example #3
0
 public SymbolAtom(string name, TexAtomType type, bool isDelimeter)
     : base()
 {
     this.Type = type;
     this.Name = name;
     this.IsDelimeter = isDelimeter;
 }
Example #4
0
 public AlphaNumericAtom(SourceSpan source,
                         string alphanumericsymbol, string defaultalphanumericsymbol = null,
                         TexAtomType type = TexAtomType.Ordinary) : base(source, type)
 {
     AlphanumericSymbol        = alphanumericsymbol;
     DefaultAlphanumericSymbol = defaultalphanumericsymbol ?? alphanumericsymbol;
 }
Example #5
0
 public SymbolAtom(string name, TexAtomType type, bool isDelimeter)
     : base()
 {
     this.Type        = type;
     this.Name        = name;
     this.IsDelimeter = isDelimeter;
 }
        public static Box CreateBox(TexAtomType leftAtomType, TexAtomType rightAtomType, TexEnvironment environment)
        {
            leftAtomType  = leftAtomType > TexAtomType.Inner ? TexAtomType.Ordinary : leftAtomType;
            rightAtomType = rightAtomType > TexAtomType.Inner ? TexAtomType.Ordinary : rightAtomType;
            var glueType = glueRules[(int)leftAtomType, (int)rightAtomType, (int)environment.Style / 2];

            return(glueTypes[glueType].CreateBox(environment));
        }
Example #7
0
 public SymbolAtom(SymbolAtom symbolAtom, TexAtomType type) : base(type)
 {
     if (!validSymbolTypes[(int)type])
     {
         throw new ArgumentException("The specified type is not a valid symbol type.", nameof(type));
     }
     this.Name        = symbolAtom.Name;
     this.IsDelimeter = symbolAtom.IsDelimeter;
 }
Example #8
0
 public SymbolAtom(SymbolAtom symbolAtom, TexAtomType type)
     : base()
 {
     if (!validSymbolTypes[(int)type])
         throw new ArgumentException("The specified type is not a valid symbol type.", "type");
     this.Type = type;
     this.Name = symbolAtom.Name;
     this.IsDelimeter = symbolAtom.IsDelimeter;
 }
Example #9
0
 public void SetFixedTypes(TexAtomType leftType, TexAtomType rightType)
 {
     this.Formula.RootAtom = new TypedAtom(this.Formula.RootAtom, leftType, rightType);
 }
Example #10
0
 public void AddSymbol(string name, TexAtomType type)
 {
     this.Add(new SymbolAtom(null, SymbolAtom.GetAtom(name, null), type));
 }
Example #11
0
 protected CharSymbol(SourceSpan source, TexAtomType type = TexAtomType.Ordinary)
     : base(source, type)
 {
     this.IsTextSymbol = false;
 }
Example #12
0
 public void AddSymbol(string name, TexAtomType type)
 {
     Add(new SymbolAtom(SymbolAtom.GetAtom(name), type));
 }
Example #13
0
 public TypedAtom(Atom atom, TexAtomType leftType, TexAtomType rightType)
 {
     Atom      = atom;
     LeftType  = leftType;
     RightType = rightType;
 }
Example #14
0
 public TypedAtom(Atom atom, TexAtomType leftType, TexAtomType rightType)
 {
     this.Atom      = atom;
     this.LeftType  = leftType;
     this.RightType = rightType;
 }
Example #15
0
 public SymbolAtom(SourceSpan source, string name, TexAtomType type, bool isDelimeter)
     : base(source, type)
 {
     this.Name        = name;
     this.IsDelimeter = isDelimeter;
 }
Example #16
0
 public void SetFixedTypes(TexAtomType leftType, TexAtomType rightType)
 {
     this.Formula.RootAtom = new TypedAtom(this.Formula.RootAtom, leftType, rightType);
 }
Example #17
0
 public SymbolAtom(string name, TexAtomType type, bool isDelimeter)
 {
     Type        = type;
     Name        = name;
     IsDelimeter = isDelimeter;
 }
Example #18
0
 public TypedAtom(Atom atom, TexAtomType leftType, TexAtomType rightType)
 {
     this.Atom = atom;
     this.LeftType = leftType;
     this.RightType = rightType;
 }
Example #19
0
 public NullAtom(SourceSpan source = null, TexAtomType type = TexAtomType.Ordinary) : base(source, type)
 {
 }
Example #20
0
 protected CharSymbol(TexAtomType type) : base(type)
 {
     this.IsTextSymbol = false;
 }
Example #21
0
 public DummyAtom WithType(TexAtomType type) =>
 new DummyAtom(type, this.Atom, this.IsTextSymbol);
Example #22
0
 public void AddSymbol(string name, TexAtomType type)
 {
     Add(new SymbolAtom(SymbolAtom.GetAtom(name), type));
 }
Example #23
0
 public DummyAtom(TexAtomType type, Atom atom, bool isTextSymbol)
     : base(atom.Source, type)
 {
     this.Atom         = atom;
     this.IsTextSymbol = isTextSymbol;
 }
Example #24
0
 protected Atom(SourceSpan source, TexAtomType type = TexAtomType.Ordinary)
 {
     this.Source = source;
     this.Type   = type;
 }
Example #25
0
 protected Atom(TexAtomType type)
 {
     this.Type = type;
 }
Example #26
0
 public VVMatrixAtom(SourceSpan source, Atom atom, TexAtomType type = TexAtomType.Ordinary) : base(source, type)
 {
     this.BaseAtom = atom;
 }
Example #27
0
 public AugmentedMatrixAtom(SourceSpan source, Atom leftatom, Atom rightatom, TexAtomType type = TexAtomType.Ordinary) : base(source, type)
 {
     this.LeftBaseAtom  = leftatom;
     this.RightBaseAtom = rightatom;
 }