44 Result = this.ParseDocument(Parser);
45 return !(Result is
null);
51 int Start = Parser.
Start;
60 while ((ch = Parser.
NextChar()) !=
'?' && ch != 0)
66 if (ProcessingInstructions is
null)
104 string ElementName = ParseName(Parser);
141 LastWildCard.Next = NewChild;
154 if (ParseName(Parser) != ElementName)
155 throw Parser.
SyntaxError(
"Expected end of element " + ElementName);
185 throw Parser.
SyntaxError(
"Unterminated CDATA construct.");
194 throw Parser.
SyntaxError(
"Expected <!-- or <![CDATA[");
235 if (LastWildCard is
null)
240 Element.Add(NewChild = this.ParseElement(Parser));
244 if (!(LastWildCard is
null) && !(NewChild is
null) && !NewChild.
IsWhitespace)
246 LastWildCard.Next = NewChild;
260 else if (
char.IsLetter(ch) || ch ==
'_' || ch ==
':')
262 int AttributeStart = Parser.
Position;
263 string AttributeName = ParseName(Parser);
270 Parser.CanSkipWhitespace =
false;
272 Parser.CanSkipWhitespace = Bak;
276 ElementValue = Constant.Constant;
288 if (AttributeName ==
"xmlns")
292 if (Attributes is
null)
295 Attributes.
Add(Attribute);
300 int AttributeStart = Parser.
Position;
303 if (Attributes is
null)
309 else if (
char.IsWhiteSpace(ch))
323 if (!(
char.IsLetter(ch) || ch ==
'_' || ch ==
':'))
330 if (
char.IsLetterOrDigit(ch) ||
char.IsDigit(ch) ||
331 ch ==
'.' || ch ==
'-' || ch ==
'_' || ch ==
':')
A chunked list is a linked list of chunks of objects of type T .
void Add(T Item)
Adds an item to the collection.
Base class for all types of elements.
string Script
Original script string.
Represents a constant element value.
Base class for all nodes in a parsed script tree.
int Length
Length of expression covered by node.
Expression Expression
Expression of which the node is a part.
int Start
Start position in script expression.
Script parser, for custom parsers.
SyntaxException SyntaxError(string Message)
Returns a Syntax Error Exception object.
ScriptNode ParsePowers()
Parses powers.
bool IsNextChars(string Token)
If the next characters to be parsed is a given token.
int Start
Start position in expression
int Position
Current parsing position.
Expression Expression
Expression being parsed.
void UndoChar()
Undoes a character in the parsing of an expression.
string PeekNextChars(int NrChars)
Returns the next given number of characters to be parsed, without moving the position forward one cha...
void SkipChars(int NrChars)
Skips a predefined number of characters.
char PeekNextChar()
Returns the next character to be parsed, without moving the position forward one character....
bool CanSkipWhitespace
If whitespace can be skipped (true), or if it has semantic meaning to the custom parser (false).
void SkipWhiteSpace()
If current position is whitespace, moves the current position forward to the first non-whitespace cha...
char NextChar()
Returns the next character to be parsed, and moves the position forward one character....
ScriptNode ParseSequence()
Parses a sequence of statements.
Abstract base class for XML Script attribute nodes.
XML Script attribute node, whose value is defined by script.
XML Script attribute node, whose value is defined by script.
XML Script attribute wildcard node, used in pattern matching to match any attribute or sequence of at...
Represents an script-based XML document.
Base class for all XML Script nodes in a parsed script tree.
static string EvaluateString(ScriptNode Node, Variables Variables)
Evaluates a script node to a string.
virtual bool IsWhitespace
If the node represents whitespace.
XML Script processing instruction node.
XML Script wildcard node.
bool TryParse(ScriptParser Parser, out ScriptNode Result)
Tries to parse a script node.
string[] Aliases
Keyword aliases, if available, null if none.
string KeyWord
Keyword associated with custom parser.
string[] InternalKeywords
Any keywords used internally by the custom parser.
XmlParser()
Parses an XML document
Basic interface for all types of elements.
Interface for keywords with custom parsing.