Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
NfaContentValidator.cs
Go to the documentation of this file.
2
3namespace System.Xml.Schema;
4
5internal sealed class NfaContentValidator : ContentValidator
6{
7 private readonly BitSet _firstpos;
8
9 private readonly BitSet[] _followpos;
10
11 private readonly SymbolsDictionary _symbols;
12
13 private readonly Positions _positions;
14
15 private readonly int _endMarkerPos;
16
26
27 public override void InitValidation(ValidationState context)
28 {
29 context.CurPos[0] = _firstpos.Clone();
30 context.CurPos[1] = new BitSet(_firstpos.Count);
32 }
33
34 public override object ValidateElement(XmlQualifiedName name, ValidationState context, out int errorCode)
35 {
36 BitSet bitSet = context.CurPos[context.CurrentState.CurPosIndex];
37 int num = (context.CurrentState.CurPosIndex + 1) % 2;
38 BitSet bitSet2 = context.CurPos[num];
39 bitSet2.Clear();
40 int num2 = _symbols[name];
41 object result = null;
42 errorCode = 0;
43 for (int num3 = bitSet.NextSet(-1); num3 != -1; num3 = bitSet.NextSet(num3))
44 {
45 if (num2 == _positions[num3].symbol)
46 {
48 result = _positions[num3].particle;
49 break;
50 }
51 }
52 if (!bitSet2.IsEmpty)
53 {
55 return result;
56 }
57 if (base.IsOpen && bitSet[_endMarkerPos])
58 {
59 return null;
60 }
62 errorCode = -1;
63 return null;
64 }
65
66 public override bool CompleteValidation(ValidationState context)
67 {
68 if (!context.CurPos[context.CurrentState.CurPosIndex][_endMarkerPos])
69 {
70 return false;
71 }
72 return true;
73 }
74
76 {
77 ArrayList arrayList = null;
78 BitSet bitSet = context.CurPos[context.CurrentState.CurPosIndex];
79 for (int num = bitSet.NextSet(-1); num != -1; num = bitSet.NextSet(num))
80 {
81 if (arrayList == null)
82 {
83 arrayList = new ArrayList();
84 }
86 if (xmlSchemaParticle == null)
87 {
88 string text = _symbols.NameOf(_positions[num].symbol);
89 if (text.Length != 0)
90 {
91 arrayList.Add(text);
92 }
93 }
94 else
95 {
96 string nameString = xmlSchemaParticle.NameString;
97 if (!arrayList.Contains(nameString))
98 {
100 }
101 }
102 }
103 return arrayList;
104 }
105
107 {
109 BitSet bitSet = context.CurPos[context.CurrentState.CurPosIndex];
110 for (int num = bitSet.NextSet(-1); num != -1; num = bitSet.NextSet(num))
111 {
113 if (xmlSchemaParticle != null)
114 {
116 }
117 }
118 return arrayList;
119 }
120}
static void AddParticleToExpected(XmlSchemaParticle p, XmlSchemaSet schemaSet, ArrayList particles)
override ArrayList ExpectedParticles(ValidationState context, bool isRequiredOnly, XmlSchemaSet schemaSet)
override bool CompleteValidation(ValidationState context)
override ArrayList ExpectedElements(ValidationState context, bool isRequiredOnly)
NfaContentValidator(BitSet firstpos, BitSet[] followpos, SymbolsDictionary symbols, Positions positions, int endMarkerPos, XmlSchemaContentType contentType, bool isOpen, bool isEmptiable)
override void InitValidation(ValidationState context)
override object ValidateElement(XmlQualifiedName name, ValidationState context, out int errorCode)