Ejemplo n.º 1
0
        public override void doLayout()
        {
            unchecked
            {
                base.doLayout();
                if ((this.index == 0))
                {
                    this.stave.topSpacing    = 5;
                    this.stave.bottomSpacing = 5;
                }

                {
                    double x = this.stave.staveGroup.layout.renderer.renderingResources.wordsFont.getSize();
                    this.height = ((int)(x));
                }

                global::haxe.root.StringBuf endingsString = new global::haxe.root.StringBuf();
                {
                    int _g = 0;
                    global::haxe.root.Array <int> _g1 = this._endings;
                    while ((_g < _g1.length))
                    {
                        int e = _g1[_g];
                        ++_g;
                        endingsString.b.Append(((object)(global::Std.@string((e + 1)))));
                        endingsString.b.Append(((object)(". ")));
                    }
                }

                this._endingsString = endingsString.toString();
            }
        }
Ejemplo n.º 2
0
        public string @join(string sep)
        {
            unchecked
            {
                global::haxe.root.StringBuf buf = new global::haxe.root.StringBuf();
                int  i      = -1;
                bool first  = true;
                int  length = this.length;
                while ((++i < length))
                {
                    if (first)
                    {
                        first = false;
                    }
                    else
                    {
                        buf.b.Append(((object)(global::Std.@string(sep))));
                    }

                    buf.b.Append(((object)(global::Std.@string(this.__a[i]))));
                }

                return(buf.toString());
            }
        }
Ejemplo n.º 3
0
        public static string generate()
        {
            unchecked
            {
                global::haxe.root.StringBuf result = new global::haxe.root.StringBuf();
                {
                    int _g = 0;
                    while ((_g < 32))
                    {
                        int j = _g++;
                        if (((((j == 8) || (j == 12)) || (j == 16)) || (j == 20)))
                        {
                            result.b.Append(((object)("-")));
                        }

                        {
                            int __temp_stmt621 = default(int);
                            {
                                double v = (global::Math.rand.NextDouble() * 16);
                                {
                                    double x1 = global::System.Math.Floor(((double)(v)));
                                    __temp_stmt621 = ((int)(x1));
                                }
                            }

                            object x = global::haxe.root.StringTools.hex(__temp_stmt621, default(global::haxe.lang.Null <int>));
                            result.b.Append(((object)(global::Std.@string(x))));
                        }
                    }
                }

                return(result.toString().ToUpper());
            }
        }
Ejemplo n.º 4
0
        public string toString()
        {
            unchecked
            {
                global::haxe.root.StringBuf ret = new global::haxe.root.StringBuf();
                T[] a = this.__a;
                ret.b.Append(((object)("[")));
                bool first = true;
                {
                    int _g1 = 0;
                    int _g  = this.length;
                    while ((_g1 < _g))
                    {
                        int i = _g1++;
                        if (first)
                        {
                            first = false;
                        }
                        else
                        {
                            ret.b.Append(((object)(",")));
                        }

                        ret.b.Append(((object)(global::Std.@string(a[i]))));
                    }
                }

                ret.b.Append(((object)("]")));
                return(ret.toString());
            }
        }
Ejemplo n.º 5
0
        public virtual void nextToken()
        {
            unchecked
            {
                global::haxe.root.StringBuf token = new global::haxe.root.StringBuf();
                string c        = default(string);
                bool   skipChar = default(bool);
                do
                {
                    c        = this.nextChar();
                    skipChar = (global::alphatab.rendering.utils.SvgPathParser.isWhiteSpace(c) || string.Equals(c, ","));
                }while ((!(this.eof()) && skipChar));
                if ((!(this.eof()) || !(skipChar)))
                {
                    token.b.Append(((object)(global::Std.@string(c))));
                    if (global::alphatab.rendering.utils.SvgPathParser.isNumber(c, default(global::haxe.lang.Null <bool>)))
                    {
                        c = this.peekChar();
                        while ((!(this.eof()) && ((global::alphatab.rendering.utils.SvgPathParser.isNumber(c, new global::haxe.lang.Null <bool>(false, true)) || string.Equals(c, ".")))))
                        {
                            {
                                object x = this.nextChar();
                                token.b.Append(((object)(global::Std.@string(x))));
                            }

                            c = this.peekChar();
                        }
                    }
                    else
                    {
                        this.lastCommand = token.toString();
                    }
                }

                this.currentToken = token.toString();
            }
        }
Ejemplo n.º 6
0
        public virtual string toString()
        {
            unchecked
            {
                global::haxe.lang.Function ts = ((global::haxe.lang.Function)(global::haxe.lang.Runtime.getField(this, "toString", 946786476, false)));
                if ((ts != default(global::haxe.lang.Function)))
                {
                    return(global::haxe.lang.Runtime.toString(ts.__hx_invoke0_o()));
                }

                global::haxe.root.StringBuf ret = new global::haxe.root.StringBuf();
                ret.b.Append(((object)("{")));
                bool first = true;
                {
                    int _g = 0;
                    global::haxe.root.Array <object> _g1 = global::haxe.root.Reflect.fields(this);
                    while ((_g < _g1.length))
                    {
                        string f = global::haxe.lang.Runtime.toString(_g1[_g]);
                        ++_g;
                        if (first)
                        {
                            first = false;
                        }
                        else
                        {
                            ret.b.Append(((object)(",")));
                        }

                        ret.b.Append(((object)(" ")));
                        ret.b.Append(((object)(global::Std.@string(f))));
                        ret.b.Append(((object)(" : ")));
                        {
                            object x = global::haxe.root.Reflect.field(this, f);
                            ret.b.Append(((object)(global::Std.@string(x))));
                        }
                    }
                }

                if (!(first))
                {
                    ret.b.Append(((object)(" ")));
                }

                ret.b.Append(((object)("}")));
                return(ret.toString());
            }
        }
Ejemplo n.º 7
0
        public virtual string toString()
        {
            unchecked
            {
                if (((this.@params == default(global::haxe.root.Array <object>)) || ([email protected] == 0)))
                {
                    return(this.getTag());
                }

                global::haxe.root.StringBuf ret = new global::haxe.root.StringBuf();
                {
                    object x = this.getTag();
                    ret.b.Append(((object)(global::Std.@string(x))));
                }

                ret.b.Append(((object)("(")));
                bool first = true;
                {
                    int _g = 0;
                    global::haxe.root.Array <object> _g1 = this.@params;
                    while ((_g < _g1.length))
                    {
                        object p = _g1[_g];
                        ++_g;
                        if (first)
                        {
                            first = false;
                        }
                        else
                        {
                            ret.b.Append(((object)(",")));
                        }

                        ret.b.Append(((object)(global::Std.@string(p))));
                    }
                }

                ret.b.Append(((object)(")")));
                return(ret.toString());
            }
        }
Ejemplo n.º 8
0
        public virtual string getString(global::haxe.io.Bytes data, int offset, int length)
        {
            unchecked
            {
                global::haxe.root.StringBuf buf = new global::haxe.root.StringBuf();
                {
                    int _g = 0;
                    while ((_g < length))
                    {
                        int i    = _g++;
                        int code = (((int)(data.b[(offset + i)])) & 255);
                        if ((code == 0))
                        {
                            break;
                        }

                        buf.b.Append(((char)(code)));
                    }
                }

                return(buf.toString());
            }
        }
Ejemplo n.º 9
0
        public virtual string toCssString()
        {
            unchecked
            {
                global::haxe.root.StringBuf buf = new global::haxe.root.StringBuf();
                if ((((this.getStyle() & 1)) != 0))
                {
                    buf.b.Append(((object)("bold ")));
                }

                if ((((this.getStyle() & 2)) != 0))
                {
                    buf.b.Append(((object)("italic ")));
                }

                buf.b.Append(((object)(global::Std.@string(this._size))));
                buf.b.Append(((object)("px")));
                buf.b.Append(((object)("\'")));
                buf.b.Append(((object)(global::Std.@string(this._family))));
                buf.b.Append(((object)("\'")));
                return(buf.toString());
            }
        }
Ejemplo n.º 10
0
		public static   string generate()
		{
			unchecked 
			{
				global::haxe.root.StringBuf result = new global::haxe.root.StringBuf();
				{
					int _g = 0;
					while (( _g < 32 ))
					{
						int j = _g++;
						if (( ( ( ( j == 8 ) || ( j == 12 ) ) || ( j == 16 ) ) || ( j == 20 ) )) 
						{
							result.b.Append(((object) ("-") ));
						}
						
						{
							int __temp_stmt621 = default(int);
							{
								double v = ( global::Math.rand.NextDouble() * 16 );
								{
									double x1 = global::System.Math.Floor(((double) (v) ));
									__temp_stmt621 = ((int) (x1) );
								}
								
							}
							
							object x = global::haxe.root.StringTools.hex(__temp_stmt621, default(global::haxe.lang.Null<int>));
							result.b.Append(((object) (global::Std.@string(x)) ));
						}
						
					}
					
				}
				
				return result.toString().ToUpper();
			}
		}
Ejemplo n.º 11
0
		public virtual   string toString()
		{
			unchecked 
			{
				global::haxe.lang.Function ts = ((global::haxe.lang.Function) (global::haxe.lang.Runtime.getField(this, "toString", 946786476, false)) );
				if (( ts != default(global::haxe.lang.Function) )) 
				{
					return global::haxe.lang.Runtime.toString(ts.__hx_invoke0_o());
				}
				
				global::haxe.root.StringBuf ret = new global::haxe.root.StringBuf();
				ret.b.Append(((object) ("{") ));
				bool first = true;
				{
					int _g = 0;
					global::haxe.root.Array<object> _g1 = global::haxe.root.Reflect.fields(this);
					while (( _g < _g1.length ))
					{
						string f = global::haxe.lang.Runtime.toString(_g1[_g]);
						 ++ _g;
						if (first) 
						{
							first = false;
						}
						 else 
						{
							ret.b.Append(((object) (",") ));
						}
						
						ret.b.Append(((object) (" ") ));
						ret.b.Append(((object) (global::Std.@string(f)) ));
						ret.b.Append(((object) (" : ") ));
						{
							object x = global::haxe.root.Reflect.field(this, f);
							ret.b.Append(((object) (global::Std.@string(x)) ));
						}
						
					}
					
				}
				
				if ( ! (first) ) 
				{
					ret.b.Append(((object) (" ") ));
				}
				
				ret.b.Append(((object) ("}") ));
				return ret.toString();
			}
		}
Ejemplo n.º 12
0
		public virtual   void readScoreInformation()
		{
			unchecked 
			{
				this._score.title = this.readStringIntUnused();
				this._score.subTitle = this.readStringIntUnused();
				this._score.artist = this.readStringIntUnused();
				this._score.album = this.readStringIntUnused();
				this._score.words = this.readStringIntUnused();
				if (( this._versionNumber >= 500 )) 
				{
					this._score.music = this.readStringIntUnused();
				}
				 else 
				{
					this._score.music = this._score.words;
				}
				
				this._score.copyright = this.readStringIntUnused();
				this._score.tab = this.readStringIntUnused();
				this._score.instructions = this.readStringIntUnused();
				int noticeLines = this.readInt32();
				global::haxe.root.StringBuf notice = new global::haxe.root.StringBuf();
				{
					int _g = 0;
					while (( _g < ((int) (noticeLines) ) ))
					{
						int i = _g++;
						if (( i > 0 )) 
						{
							notice.b.Append(((object) ("\n") ));
						}
						
						{
							object x = this.readStringIntUnused();
							notice.b.Append(((object) (global::Std.@string(x)) ));
						}
						
					}
					
				}
				
				this._score.notices = notice.toString();
			}
		}
		public override   void doLayout()
		{
			unchecked 
			{
				base.doLayout();
				if (( this.index == 0 )) 
				{
					this.stave.topSpacing = 5;
					this.stave.bottomSpacing = 5;
				}
				
				{
					double x = this.stave.staveGroup.layout.renderer.renderingResources.wordsFont.getSize();
					this.height = ((int) (x) );
				}
				
				global::haxe.root.StringBuf endingsString = new global::haxe.root.StringBuf();
				{
					int _g = 0;
					global::haxe.root.Array<int> _g1 = this._endings;
					while (( _g < _g1.length ))
					{
						int e = _g1[_g];
						 ++ _g;
						endingsString.b.Append(((object) (global::Std.@string(( e + 1 ))) ));
						endingsString.b.Append(((object) (". ") ));
					}
					
				}
				
				this._endingsString = endingsString.toString();
			}
		}
Ejemplo n.º 14
0
		public virtual   void nextToken()
		{
			unchecked 
			{
				global::haxe.root.StringBuf token = new global::haxe.root.StringBuf();
				string c = default(string);
				bool skipChar = default(bool);
				do 
				{
					c = this.nextChar();
					skipChar = ( global::alphatab.rendering.utils.SvgPathParser.isWhiteSpace(c) || string.Equals(c, ",") );
				}
				while ((  ! (this.eof())  && skipChar ));
				if ((  ! (this.eof())  ||  ! (skipChar)  )) 
				{
					token.b.Append(((object) (global::Std.@string(c)) ));
					if (global::alphatab.rendering.utils.SvgPathParser.isNumber(c, default(global::haxe.lang.Null<bool>))) 
					{
						c = this.peekChar();
						while ((  ! (this.eof())  && (( global::alphatab.rendering.utils.SvgPathParser.isNumber(c, new global::haxe.lang.Null<bool>(false, true)) || string.Equals(c, ".") )) ))
						{
							{
								object x = this.nextChar();
								token.b.Append(((object) (global::Std.@string(x)) ));
							}
							
							c = this.peekChar();
						}
						
					}
					 else 
					{
						this.lastCommand = token.toString();
					}
					
				}
				
				this.currentToken = token.toString();
			}
		}
Ejemplo n.º 15
0
		public virtual   string toString()
		{
			unchecked 
			{
				if (( this.nodeType == global::haxe.root.Xml.PCData )) 
				{
					return global::haxe.root.StringTools.htmlEscape(this._nodeValue, default(global::haxe.lang.Null<bool>));
				}
				
				if (( this.nodeType == global::haxe.root.Xml.CData )) 
				{
					return global::haxe.lang.Runtime.concat(global::haxe.lang.Runtime.concat("<![CDATA[", this._nodeValue), "]]>");
				}
				
				if (( this.nodeType == global::haxe.root.Xml.Comment )) 
				{
					return global::haxe.lang.Runtime.concat(global::haxe.lang.Runtime.concat("<!--", this._nodeValue), "-->");
				}
				
				if (( this.nodeType == global::haxe.root.Xml.DocType )) 
				{
					return global::haxe.lang.Runtime.concat(global::haxe.lang.Runtime.concat("<!DOCTYPE ", this._nodeValue), ">");
				}
				
				if (( this.nodeType == global::haxe.root.Xml.ProcessingInstruction )) 
				{
					return global::haxe.lang.Runtime.concat(global::haxe.lang.Runtime.concat("<?", this._nodeValue), "?>");
				}
				
				global::haxe.root.StringBuf s = new global::haxe.root.StringBuf();
				if (( this.nodeType == global::haxe.root.Xml.Element )) 
				{
					s.b.Append(((object) ("<") ));
					s.b.Append(((object) (global::Std.@string(this._nodeName)) ));
					{
						object __temp_iterator301 = this._attributes.keys();
						while (((bool) (global::haxe.lang.Runtime.callField(__temp_iterator301, "hasNext", 407283053, default(global::haxe.root.Array))) ))
						{
							string k = global::haxe.lang.Runtime.toString(global::haxe.lang.Runtime.callField(__temp_iterator301, "next", 1224901875, default(global::haxe.root.Array)));
							s.b.Append(((object) (" ") ));
							s.b.Append(((object) (global::Std.@string(k)) ));
							s.b.Append(((object) ("=\"") ));
							{
								object x = global::haxe.lang.Runtime.toString(this._attributes.@get(k).@value);
								s.b.Append(((object) (global::Std.@string(x)) ));
							}
							
							s.b.Append(((object) ("\"") ));
						}
						
					}
					
					if (( this._children.length == 0 )) 
					{
						s.b.Append(((object) ("/>") ));
						return s.toString();
					}
					
					s.b.Append(((object) (">") ));
				}
				
				{
					object __temp_iterator302 = this.iterator();
					while (((bool) (global::haxe.lang.Runtime.callField(__temp_iterator302, "hasNext", 407283053, default(global::haxe.root.Array))) ))
					{
						global::haxe.root.Xml x1 = ((global::haxe.root.Xml) (global::haxe.lang.Runtime.callField(__temp_iterator302, "next", 1224901875, default(global::haxe.root.Array))) );
						object x2 = x1.toString();
						s.b.Append(((object) (global::Std.@string(x2)) ));
					}
					
				}
				
				if (( this.nodeType == global::haxe.root.Xml.Element )) 
				{
					s.b.Append(((object) ("</") ));
					s.b.Append(((object) (global::Std.@string(this._nodeName)) ));
					s.b.Append(((object) (">") ));
				}
				
				return s.toString();
			}
		}
Ejemplo n.º 16
0
		public virtual   string toSvg(bool includeWrapper, string className)
		{
			unchecked 
			{
				global::haxe.root.StringBuf buf = new global::haxe.root.StringBuf();
				if (includeWrapper) 
				{
					buf.b.Append(((object) ("<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" width=\"") ));
					buf.b.Append(((object) (global::Std.@string(this._width)) ));
					buf.b.Append(((object) ("px\" height=\"") ));
					buf.b.Append(((object) (global::Std.@string(this._height)) ));
					buf.b.Append(((object) ("px\"") ));
					if ( ! (string.Equals(className, default(string))) ) 
					{
						buf.b.Append(((object) (" class=\"") ));
						buf.b.Append(((object) (global::Std.@string(className)) ));
						buf.b.Append(((object) ("\"") ));
					}
					
					buf.b.Append(((object) (">\n") ));
				}
				
				buf.b.Append(((object) (global::Std.@string(this._buffer)) ));
				if (includeWrapper) 
				{
					buf.b.Append(((object) ("</svg>") ));
				}
				
				return buf.toString();
			}
		}
Ejemplo n.º 17
0
		public static   int doParse(string str, global::haxe.lang.Null<int> p, global::haxe.root.Xml parent)
		{
			unchecked 
			{
				int __temp_p294 = ( (global::haxe.lang.Runtime.eq((p).toDynamic(), (default(global::haxe.lang.Null<int>)).toDynamic())) ? (((int) (0) )) : (p.@value) );
				global::haxe.root.Xml xml = default(global::haxe.root.Xml);
				int state = 1;
				int next = 1;
				string aname = default(string);
				int start = 0;
				int nsubs = 0;
				int nbrackets = 0;
				int c = default(int);
				if (( ((uint) (__temp_p294) ) < str.Length )) 
				{
					c = ((int) (global::haxe.lang.Runtime.toInt(str[__temp_p294])) );
				}
				 else 
				{
					c = -1;
				}
				
				global::haxe.root.StringBuf buf = new global::haxe.root.StringBuf();
				while ( ! ((( c == -1 ))) )
				{
					switch (state)
					{
						case 0:
						{
							switch (c)
							{
								case 10:case 13:case 9:case 32:
								{
									{
									}
									
									break;
								}
								
								
								default:
								{
									state = next;
									continue;
								}
								
							}
							
							break;
						}
						
						
						case 1:
						{
							switch (c)
							{
								case 60:
								{
									state = 0;
									next = 2;
									break;
								}
								
								
								default:
								{
									start = __temp_p294;
									state = 13;
									continue;
								}
								
							}
							
							break;
						}
						
						
						case 13:
						{
							if (( c == 60 )) 
							{
								global::haxe.root.Xml child = global::haxe.root.Xml.createPCData(global::haxe.lang.Runtime.concat(buf.toString(), global::haxe.lang.StringExt.substr(str, start, new global::haxe.lang.Null<int>(( __temp_p294 - start ), true))));
								buf = new global::haxe.root.StringBuf();
								parent.addChild(child);
								nsubs++;
								state = 0;
								next = 2;
							}
							 else 
							{
								if (( c == 38 )) 
								{
									buf.addSub(str, start, new global::haxe.lang.Null<int>(( __temp_p294 - start ), true));
									state = 18;
									next = 13;
									start = ( __temp_p294 + 1 );
								}
								
							}
							
							break;
						}
						
						
						case 17:
						{
							bool __temp_boolv627 = ( c == 93 );
							bool __temp_boolv626 = false;
							bool __temp_boolv625 = false;
							if (__temp_boolv627) 
							{
								int __temp_stmt628 = default(int);
								{
									int index = ( __temp_p294 + 1 );
									__temp_stmt628 = ( (( ((uint) (index) ) < str.Length )) ? (((int) (global::haxe.lang.Runtime.toInt(str[index])) )) : (-1) );
								}
								
								__temp_boolv626 = ( __temp_stmt628 == 93 );
								if (__temp_boolv626) 
								{
									int __temp_stmt629 = default(int);
									{
										int index1 = ( __temp_p294 + 2 );
										__temp_stmt629 = ( (( ((uint) (index1) ) < str.Length )) ? (((int) (global::haxe.lang.Runtime.toInt(str[index1])) )) : (-1) );
									}
									
									__temp_boolv625 = ( __temp_stmt629 == 62 );
								}
								
							}
							
							bool __temp_stmt624 = ( ( __temp_boolv627 && __temp_boolv626 ) && __temp_boolv625 );
							if (__temp_stmt624) 
							{
								global::haxe.root.Xml child1 = global::haxe.root.Xml.createCData(global::haxe.lang.StringExt.substr(str, start, new global::haxe.lang.Null<int>(( __temp_p294 - start ), true)));
								parent.addChild(child1);
								nsubs++;
								__temp_p294 += 2;
								state = 1;
							}
							
							break;
						}
						
						
						case 2:
						{
							switch (c)
							{
								case 33:
								{
									int __temp_stmt630 = default(int);
									{
										int index2 = ( __temp_p294 + 1 );
										__temp_stmt630 = ( (( ((uint) (index2) ) < str.Length )) ? (((int) (global::haxe.lang.Runtime.toInt(str[index2])) )) : (-1) );
									}
									
									if (( __temp_stmt630 == 91 )) 
									{
										__temp_p294 += 2;
										if ( ! (string.Equals(global::haxe.lang.StringExt.substr(str, __temp_p294, new global::haxe.lang.Null<int>(6, true)).ToUpper(), "CDATA[")) ) 
										{
											throw global::haxe.lang.HaxeException.wrap("Expected <![CDATA[");
										}
										
										__temp_p294 += 5;
										state = 17;
										start = ( __temp_p294 + 1 );
									}
									 else 
									{
										int __temp_stmt633 = default(int);
										{
											int index3 = ( __temp_p294 + 1 );
											__temp_stmt633 = ( (( ((uint) (index3) ) < str.Length )) ? (((int) (global::haxe.lang.Runtime.toInt(str[index3])) )) : (-1) );
										}
										
										bool __temp_stmt632 = ( __temp_stmt633 == 68 );
										bool __temp_boolv634 = false;
										if ( ! (__temp_stmt632) ) 
										{
											int __temp_stmt635 = default(int);
											{
												int index4 = ( __temp_p294 + 1 );
												__temp_stmt635 = ( (( ((uint) (index4) ) < str.Length )) ? (((int) (global::haxe.lang.Runtime.toInt(str[index4])) )) : (-1) );
											}
											
											__temp_boolv634 = ( __temp_stmt635 == 100 );
										}
										
										bool __temp_stmt631 = ( __temp_stmt632 || __temp_boolv634 );
										if (__temp_stmt631) 
										{
											if ( ! (string.Equals(global::haxe.lang.StringExt.substr(str, ( __temp_p294 + 2 ), new global::haxe.lang.Null<int>(6, true)).ToUpper(), "OCTYPE")) ) 
											{
												throw global::haxe.lang.HaxeException.wrap("Expected <!DOCTYPE");
											}
											
											__temp_p294 += 8;
											state = 16;
											start = ( __temp_p294 + 1 );
										}
										 else 
										{
											int __temp_stmt638 = default(int);
											{
												int index5 = ( __temp_p294 + 1 );
												__temp_stmt638 = ( (( ((uint) (index5) ) < str.Length )) ? (((int) (global::haxe.lang.Runtime.toInt(str[index5])) )) : (-1) );
											}
											
											bool __temp_stmt637 = ( __temp_stmt638 != 45 );
											bool __temp_boolv639 = false;
											if ( ! (__temp_stmt637) ) 
											{
												int __temp_stmt640 = default(int);
												{
													int index6 = ( __temp_p294 + 2 );
													__temp_stmt640 = ( (( ((uint) (index6) ) < str.Length )) ? (((int) (global::haxe.lang.Runtime.toInt(str[index6])) )) : (-1) );
												}
												
												__temp_boolv639 = ( __temp_stmt640 != 45 );
											}
											
											bool __temp_stmt636 = ( __temp_stmt637 || __temp_boolv639 );
											if (__temp_stmt636) 
											{
												throw global::haxe.lang.HaxeException.wrap("Expected <!--");
											}
											 else 
											{
												__temp_p294 += 2;
												state = 15;
												start = ( __temp_p294 + 1 );
											}
											
										}
										
									}
									
									break;
								}
								
								
								case 63:
								{
									state = 14;
									start = __temp_p294;
									break;
								}
								
								
								case 47:
								{
									if (( parent == default(global::haxe.root.Xml) )) 
									{
										throw global::haxe.lang.HaxeException.wrap("Expected node name");
									}
									
									start = ( __temp_p294 + 1 );
									state = 0;
									next = 10;
									break;
								}
								
								
								default:
								{
									state = 3;
									start = __temp_p294;
									continue;
								}
								
							}
							
							break;
						}
						
						
						case 3:
						{
							if ( ! ((( ( ( ( ( ( ( ( c >= 97 ) && ( c <= 122 ) ) || ( ( c >= 65 ) && ( c <= 90 ) ) ) || ( ( c >= 48 ) && ( c <= 57 ) ) ) || ( c == 58 ) ) || ( c == 46 ) ) || ( c == 95 ) ) || ( c == 45 ) ))) ) 
							{
								if (( __temp_p294 == start )) 
								{
									throw global::haxe.lang.HaxeException.wrap("Expected node name");
								}
								
								xml = global::haxe.root.Xml.createElement(global::haxe.lang.StringExt.substr(str, start, new global::haxe.lang.Null<int>(( __temp_p294 - start ), true)));
								parent.addChild(xml);
								state = 0;
								next = 4;
								continue;
							}
							
							break;
						}
						
						
						case 4:
						{
							switch (c)
							{
								case 47:
								{
									state = 11;
									nsubs++;
									break;
								}
								
								
								case 62:
								{
									state = 9;
									nsubs++;
									break;
								}
								
								
								default:
								{
									state = 5;
									start = __temp_p294;
									continue;
								}
								
							}
							
							break;
						}
						
						
						case 5:
						{
							if ( ! ((( ( ( ( ( ( ( ( c >= 97 ) && ( c <= 122 ) ) || ( ( c >= 65 ) && ( c <= 90 ) ) ) || ( ( c >= 48 ) && ( c <= 57 ) ) ) || ( c == 58 ) ) || ( c == 46 ) ) || ( c == 95 ) ) || ( c == 45 ) ))) ) 
							{
								string tmp = default(string);
								if (( start == __temp_p294 )) 
								{
									throw global::haxe.lang.HaxeException.wrap("Expected attribute name");
								}
								
								tmp = global::haxe.lang.StringExt.substr(str, start, new global::haxe.lang.Null<int>(( __temp_p294 - start ), true));
								aname = tmp;
								if (xml.exists(aname)) 
								{
									throw global::haxe.lang.HaxeException.wrap("Duplicate attribute");
								}
								
								state = 0;
								next = 6;
								continue;
							}
							
							break;
						}
						
						
						case 6:
						{
							switch (c)
							{
								case 61:
								{
									state = 0;
									next = 7;
									break;
								}
								
								
								default:
								{
									throw global::haxe.lang.HaxeException.wrap("Expected =");
								}
								
							}
							
							break;
						}
						
						
						case 7:
						{
							switch (c)
							{
								case 34:case 39:
								{
									state = 8;
									start = __temp_p294;
									break;
								}
								
								
								default:
								{
									throw global::haxe.lang.HaxeException.wrap("Expected \"");
								}
								
							}
							
							break;
						}
						
						
						case 8:
						{
							if (( c == (( (( ((uint) (start) ) < str.Length )) ? (((int) (global::haxe.lang.Runtime.toInt(str[start])) )) : (-1) )) )) 
							{
								string val = global::haxe.lang.StringExt.substr(str, ( start + 1 ), new global::haxe.lang.Null<int>(( ( __temp_p294 - start ) - 1 ), true));
								xml.@set(aname, val);
								state = 0;
								next = 4;
							}
							
							break;
						}
						
						
						case 9:
						{
							__temp_p294 = global::haxe.xml.Parser.doParse(str, new global::haxe.lang.Null<int>(__temp_p294, true), xml);
							start = __temp_p294;
							state = 1;
							break;
						}
						
						
						case 11:
						{
							switch (c)
							{
								case 62:
								{
									state = 1;
									break;
								}
								
								
								default:
								{
									throw global::haxe.lang.HaxeException.wrap("Expected >");
								}
								
							}
							
							break;
						}
						
						
						case 12:
						{
							switch (c)
							{
								case 62:
								{
									if (( nsubs == 0 )) 
									{
										parent.addChild(global::haxe.root.Xml.createPCData(""));
									}
									
									return __temp_p294;
								}
								
								
								default:
								{
									throw global::haxe.lang.HaxeException.wrap("Expected >");
								}
								
							}
							
						}
						
						
						case 10:
						{
							if ( ! ((( ( ( ( ( ( ( ( c >= 97 ) && ( c <= 122 ) ) || ( ( c >= 65 ) && ( c <= 90 ) ) ) || ( ( c >= 48 ) && ( c <= 57 ) ) ) || ( c == 58 ) ) || ( c == 46 ) ) || ( c == 95 ) ) || ( c == 45 ) ))) ) 
							{
								if (( start == __temp_p294 )) 
								{
									throw global::haxe.lang.HaxeException.wrap("Expected node name");
								}
								
								string v = global::haxe.lang.StringExt.substr(str, start, new global::haxe.lang.Null<int>(( __temp_p294 - start ), true));
								if ( ! (string.Equals(v, parent._get_nodeName())) ) 
								{
									throw global::haxe.lang.HaxeException.wrap(global::haxe.lang.Runtime.concat(global::haxe.lang.Runtime.concat("Expected </", parent._get_nodeName()), ">"));
								}
								
								state = 0;
								next = 12;
								continue;
							}
							
							break;
						}
						
						
						case 15:
						{
							bool __temp_boolv644 = ( c == 45 );
							bool __temp_boolv643 = false;
							bool __temp_boolv642 = false;
							if (__temp_boolv644) 
							{
								int __temp_stmt645 = default(int);
								{
									int index7 = ( __temp_p294 + 1 );
									__temp_stmt645 = ( (( ((uint) (index7) ) < str.Length )) ? (((int) (global::haxe.lang.Runtime.toInt(str[index7])) )) : (-1) );
								}
								
								__temp_boolv643 = ( __temp_stmt645 == 45 );
								if (__temp_boolv643) 
								{
									int __temp_stmt646 = default(int);
									{
										int index8 = ( __temp_p294 + 2 );
										__temp_stmt646 = ( (( ((uint) (index8) ) < str.Length )) ? (((int) (global::haxe.lang.Runtime.toInt(str[index8])) )) : (-1) );
									}
									
									__temp_boolv642 = ( __temp_stmt646 == 62 );
								}
								
							}
							
							bool __temp_stmt641 = ( ( __temp_boolv644 && __temp_boolv643 ) && __temp_boolv642 );
							if (__temp_stmt641) 
							{
								parent.addChild(global::haxe.root.Xml.createComment(global::haxe.lang.StringExt.substr(str, start, new global::haxe.lang.Null<int>(( __temp_p294 - start ), true))));
								__temp_p294 += 2;
								state = 1;
							}
							
							break;
						}
						
						
						case 16:
						{
							if (( c == 91 )) 
							{
								nbrackets++;
							}
							 else 
							{
								if (( c == 93 )) 
								{
									nbrackets--;
								}
								 else 
								{
									if (( ( c == 62 ) && ( nbrackets == 0 ) )) 
									{
										parent.addChild(global::haxe.root.Xml.createDocType(global::haxe.lang.StringExt.substr(str, start, new global::haxe.lang.Null<int>(( __temp_p294 - start ), true))));
										state = 1;
									}
									
								}
								
							}
							
							break;
						}
						
						
						case 14:
						{
							bool __temp_boolv649 = ( c == 63 );
							bool __temp_boolv648 = false;
							if (__temp_boolv649) 
							{
								int __temp_stmt650 = default(int);
								{
									int index9 = ( __temp_p294 + 1 );
									__temp_stmt650 = ( (( ((uint) (index9) ) < str.Length )) ? (((int) (global::haxe.lang.Runtime.toInt(str[index9])) )) : (-1) );
								}
								
								__temp_boolv648 = ( __temp_stmt650 == 62 );
							}
							
							bool __temp_stmt647 = ( __temp_boolv649 && __temp_boolv648 );
							if (__temp_stmt647) 
							{
								__temp_p294++;
								string str1 = global::haxe.lang.StringExt.substr(str, ( start + 1 ), new global::haxe.lang.Null<int>(( ( __temp_p294 - start ) - 2 ), true));
								parent.addChild(global::haxe.root.Xml.createProcessingInstruction(str1));
								state = 1;
							}
							
							break;
						}
						
						
						case 18:
						{
							if (( c == 59 )) 
							{
								string s = global::haxe.lang.StringExt.substr(str, start, new global::haxe.lang.Null<int>(( __temp_p294 - start ), true));
								if (( (( (( ((uint) (0) ) < s.Length )) ? (((int) (global::haxe.lang.Runtime.toInt(s[0])) )) : (-1) )) == 35 )) 
								{
									global::haxe.lang.Null<int> i = default(global::haxe.lang.Null<int>);
									if (( (( (( ((uint) (1) ) < s.Length )) ? (((int) (global::haxe.lang.Runtime.toInt(s[1])) )) : (-1) )) == 120 )) 
									{
										i = new global::haxe.lang.Null<int>(global::Std.parseInt(global::haxe.lang.Runtime.concat("0", global::haxe.lang.StringExt.substr(s, 1, new global::haxe.lang.Null<int>(( s.Length - 1 ), true)))).@value, true);
									}
									 else 
									{
										i = new global::haxe.lang.Null<int>(global::Std.parseInt(global::haxe.lang.StringExt.substr(s, 1, new global::haxe.lang.Null<int>(( s.Length - 1 ), true))).@value, true);
									}
									
									{
										object x = new string(((char) (i.@value) ), 1);
										buf.b.Append(((object) (global::Std.@string(x)) ));
									}
									
								}
								 else 
								{
									if ( ! (global::haxe.xml.Parser.escapes.exists(s)) ) 
									{
										buf.b.Append(((object) (global::Std.@string(global::haxe.lang.Runtime.concat(global::haxe.lang.Runtime.concat("&", s), ";"))) ));
									}
									 else 
									{
										object x1 = global::haxe.lang.Runtime.toString(global::haxe.xml.Parser.escapes.@get(s).@value);
										buf.b.Append(((object) (global::Std.@string(x1)) ));
									}
									
								}
								
								start = ( __temp_p294 + 1 );
								state = next;
							}
							
							break;
						}
						
						
					}
					
					{
						int index10 =  ++ __temp_p294;
						if (( ((uint) (index10) ) < str.Length )) 
						{
							c = ((int) (global::haxe.lang.Runtime.toInt(str[index10])) );
						}
						 else 
						{
							c = -1;
						}
						
					}
					
				}
				
				if (( state == 1 )) 
				{
					start = __temp_p294;
					state = 13;
				}
				
				if (( state == 13 )) 
				{
					if (( ( __temp_p294 != start ) || ( nsubs == 0 ) )) 
					{
						parent.addChild(global::haxe.root.Xml.createPCData(global::haxe.lang.Runtime.concat(buf.toString(), global::haxe.lang.StringExt.substr(str, start, new global::haxe.lang.Null<int>(( __temp_p294 - start ), true)))));
					}
					
					return __temp_p294;
				}
				
				throw global::haxe.lang.HaxeException.wrap("Unexpected end");
			}
		}
Ejemplo n.º 18
0
		public virtual   string toString()
		{
			unchecked 
			{
				if (( ( this.@params == default(global::haxe.root.Array<object>) ) || ( [email protected] == 0 ) )) 
				{
					return this.getTag();
				}
				
				global::haxe.root.StringBuf ret = new global::haxe.root.StringBuf();
				{
					object x = this.getTag();
					ret.b.Append(((object) (global::Std.@string(x)) ));
				}
				
				ret.b.Append(((object) ("(") ));
				bool first = true;
				{
					int _g = 0;
					global::haxe.root.Array<object> _g1 = this.@params;
					while (( _g < _g1.length ))
					{
						object p = _g1[_g];
						 ++ _g;
						if (first) 
						{
							first = false;
						}
						 else 
						{
							ret.b.Append(((object) (",") ));
						}
						
						ret.b.Append(((object) (global::Std.@string(p)) ));
					}
					
				}
				
				ret.b.Append(((object) (")") ));
				return ret.toString();
			}
		}
Ejemplo n.º 19
0
		public virtual   string getString(global::haxe.io.Bytes data, int offset, int length)
		{
			unchecked 
			{
				global::haxe.root.StringBuf buf = new global::haxe.root.StringBuf();
				{
					int _g = 0;
					while (( _g < length ))
					{
						int i = _g++;
						int code = ( ((int) (data.b[( offset + i )]) ) & 255 );
						if (( code == 0 )) 
						{
							break;
						}
						
						buf.b.Append(((char) (code) ));
					}
					
				}
				
				return buf.toString();
			}
		}
Ejemplo n.º 20
0
		public virtual   string toCssString()
		{
			unchecked 
			{
				global::haxe.root.StringBuf buf = new global::haxe.root.StringBuf();
				if (( (( this.getStyle() & 1 )) != 0 )) 
				{
					buf.b.Append(((object) ("bold ") ));
				}
				
				if (( (( this.getStyle() & 2 )) != 0 )) 
				{
					buf.b.Append(((object) ("italic ") ));
				}
				
				buf.b.Append(((object) (global::Std.@string(this._size)) ));
				buf.b.Append(((object) ("px") ));
				buf.b.Append(((object) ("\'") ));
				buf.b.Append(((object) (global::Std.@string(this._family)) ));
				buf.b.Append(((object) ("\'") ));
				return buf.toString();
			}
		}
Ejemplo n.º 21
0
		public virtual   string getValue(global::haxe.root.Xml n)
		{
			unchecked 
			{
				if (( ( n.nodeType == global::haxe.root.Xml.Element ) || ( n.nodeType == global::haxe.root.Xml.Document ) )) 
				{
					global::haxe.root.StringBuf txt = new global::haxe.root.StringBuf();
					{
						object __temp_iterator417 = n.iterator();
						while (((bool) (global::haxe.lang.Runtime.callField(__temp_iterator417, "hasNext", 407283053, default(global::haxe.root.Array))) ))
						{
							global::haxe.root.Xml c = ((global::haxe.root.Xml) (global::haxe.lang.Runtime.callField(__temp_iterator417, "next", 1224901875, default(global::haxe.root.Array))) );
							object x = this.getValue(c);
							txt.b.Append(((object) (global::Std.@string(x)) ));
						}
						
					}
					
					{
						string s = txt.toString();
						return s.Trim();
					}
					
				}
				 else 
				{
					return n._get_nodeValue();
				}
				
			}
		}
Ejemplo n.º 22
0
        public virtual string toString()
        {
            unchecked
            {
                if ((this.nodeType == global::haxe.root.Xml.PCData))
                {
                    return(global::haxe.root.StringTools.htmlEscape(this._nodeValue, default(global::haxe.lang.Null <bool>)));
                }

                if ((this.nodeType == global::haxe.root.Xml.CData))
                {
                    return(global::haxe.lang.Runtime.concat(global::haxe.lang.Runtime.concat("<![CDATA[", this._nodeValue), "]]>"));
                }

                if ((this.nodeType == global::haxe.root.Xml.Comment))
                {
                    return(global::haxe.lang.Runtime.concat(global::haxe.lang.Runtime.concat("<!--", this._nodeValue), "-->"));
                }

                if ((this.nodeType == global::haxe.root.Xml.DocType))
                {
                    return(global::haxe.lang.Runtime.concat(global::haxe.lang.Runtime.concat("<!DOCTYPE ", this._nodeValue), ">"));
                }

                if ((this.nodeType == global::haxe.root.Xml.ProcessingInstruction))
                {
                    return(global::haxe.lang.Runtime.concat(global::haxe.lang.Runtime.concat("<?", this._nodeValue), "?>"));
                }

                global::haxe.root.StringBuf s = new global::haxe.root.StringBuf();
                if ((this.nodeType == global::haxe.root.Xml.Element))
                {
                    s.b.Append(((object)("<")));
                    s.b.Append(((object)(global::Std.@string(this._nodeName))));
                    {
                        object __temp_iterator301 = this._attributes.keys();
                        while (((bool)(global::haxe.lang.Runtime.callField(__temp_iterator301, "hasNext", 407283053, default(global::haxe.root.Array)))))
                        {
                            string k = global::haxe.lang.Runtime.toString(global::haxe.lang.Runtime.callField(__temp_iterator301, "next", 1224901875, default(global::haxe.root.Array)));
                            s.b.Append(((object)(" ")));
                            s.b.Append(((object)(global::Std.@string(k))));
                            s.b.Append(((object)("=\"")));
                            {
                                object x = global::haxe.lang.Runtime.toString(this._attributes.@get(k).@value);
                                s.b.Append(((object)(global::Std.@string(x))));
                            }

                            s.b.Append(((object)("\"")));
                        }
                    }

                    if ((this._children.length == 0))
                    {
                        s.b.Append(((object)("/>")));
                        return(s.toString());
                    }

                    s.b.Append(((object)(">")));
                }

                {
                    object __temp_iterator302 = this.iterator();
                    while (((bool)(global::haxe.lang.Runtime.callField(__temp_iterator302, "hasNext", 407283053, default(global::haxe.root.Array)))))
                    {
                        global::haxe.root.Xml x1 = ((global::haxe.root.Xml)(global::haxe.lang.Runtime.callField(__temp_iterator302, "next", 1224901875, default(global::haxe.root.Array))));
                        object x2 = x1.toString();
                        s.b.Append(((object)(global::Std.@string(x2))));
                    }
                }

                if ((this.nodeType == global::haxe.root.Xml.Element))
                {
                    s.b.Append(((object)("</")));
                    s.b.Append(((object)(global::Std.@string(this._nodeName))));
                    s.b.Append(((object)(">")));
                }

                return(s.toString());
            }
        }
Ejemplo n.º 23
0
        public static int doParse(string str, global::haxe.lang.Null <int> p, global::haxe.root.Xml parent)
        {
            unchecked
            {
                int __temp_p294           = ((global::haxe.lang.Runtime.eq((p).toDynamic(), (default(global::haxe.lang.Null <int>)).toDynamic())) ? (((int)(0))) : (p.@value));
                global::haxe.root.Xml xml = default(global::haxe.root.Xml);
                int    state     = 1;
                int    next      = 1;
                string aname     = default(string);
                int    start     = 0;
                int    nsubs     = 0;
                int    nbrackets = 0;
                int    c         = default(int);
                if ((((uint)(__temp_p294)) < str.Length))
                {
                    c = ((int)(global::haxe.lang.Runtime.toInt(str[__temp_p294])));
                }
                else
                {
                    c = -1;
                }

                global::haxe.root.StringBuf buf = new global::haxe.root.StringBuf();
                while (!(((c == -1))))
                {
                    switch (state)
                    {
                    case 0:
                    {
                        switch (c)
                        {
                        case 10:
                        case 13:
                        case 9:
                        case 32:
                        {
                            {
                            }

                            break;
                        }


                        default:
                        {
                            state = next;
                            continue;
                        }
                        }

                        break;
                    }


                    case 1:
                    {
                        switch (c)
                        {
                        case 60:
                        {
                            state = 0;
                            next  = 2;
                            break;
                        }


                        default:
                        {
                            start = __temp_p294;
                            state = 13;
                            continue;
                        }
                        }

                        break;
                    }


                    case 13:
                    {
                        if ((c == 60))
                        {
                            global::haxe.root.Xml child = global::haxe.root.Xml.createPCData(global::haxe.lang.Runtime.concat(buf.toString(), global::haxe.lang.StringExt.substr(str, start, new global::haxe.lang.Null <int>((__temp_p294 - start), true))));
                            buf = new global::haxe.root.StringBuf();
                            parent.addChild(child);
                            nsubs++;
                            state = 0;
                            next  = 2;
                        }
                        else
                        {
                            if ((c == 38))
                            {
                                buf.addSub(str, start, new global::haxe.lang.Null <int>((__temp_p294 - start), true));
                                state = 18;
                                next  = 13;
                                start = (__temp_p294 + 1);
                            }
                        }

                        break;
                    }


                    case 17:
                    {
                        bool __temp_boolv627 = (c == 93);
                        bool __temp_boolv626 = false;
                        bool __temp_boolv625 = false;
                        if (__temp_boolv627)
                        {
                            int __temp_stmt628 = default(int);
                            {
                                int index = (__temp_p294 + 1);
                                __temp_stmt628 = (((((uint)(index)) < str.Length)) ? (((int)(global::haxe.lang.Runtime.toInt(str[index])))) : (-1));
                            }

                            __temp_boolv626 = (__temp_stmt628 == 93);
                            if (__temp_boolv626)
                            {
                                int __temp_stmt629 = default(int);
                                {
                                    int index1 = (__temp_p294 + 2);
                                    __temp_stmt629 = (((((uint)(index1)) < str.Length)) ? (((int)(global::haxe.lang.Runtime.toInt(str[index1])))) : (-1));
                                }

                                __temp_boolv625 = (__temp_stmt629 == 62);
                            }
                        }

                        bool __temp_stmt624 = ((__temp_boolv627 && __temp_boolv626) && __temp_boolv625);
                        if (__temp_stmt624)
                        {
                            global::haxe.root.Xml child1 = global::haxe.root.Xml.createCData(global::haxe.lang.StringExt.substr(str, start, new global::haxe.lang.Null <int>((__temp_p294 - start), true)));
                            parent.addChild(child1);
                            nsubs++;
                            __temp_p294 += 2;
                            state        = 1;
                        }

                        break;
                    }


                    case 2:
                    {
                        switch (c)
                        {
                        case 33:
                        {
                            int __temp_stmt630 = default(int);
                            {
                                int index2 = (__temp_p294 + 1);
                                __temp_stmt630 = (((((uint)(index2)) < str.Length)) ? (((int)(global::haxe.lang.Runtime.toInt(str[index2])))) : (-1));
                            }

                            if ((__temp_stmt630 == 91))
                            {
                                __temp_p294 += 2;
                                if (!(string.Equals(global::haxe.lang.StringExt.substr(str, __temp_p294, new global::haxe.lang.Null <int>(6, true)).ToUpper(), "CDATA[")))
                                {
                                    throw global::haxe.lang.HaxeException.wrap("Expected <![CDATA[");
                                }

                                __temp_p294 += 5;
                                state        = 17;
                                start        = (__temp_p294 + 1);
                            }
                            else
                            {
                                int __temp_stmt633 = default(int);
                                {
                                    int index3 = (__temp_p294 + 1);
                                    __temp_stmt633 = (((((uint)(index3)) < str.Length)) ? (((int)(global::haxe.lang.Runtime.toInt(str[index3])))) : (-1));
                                }

                                bool __temp_stmt632  = (__temp_stmt633 == 68);
                                bool __temp_boolv634 = false;
                                if (!(__temp_stmt632))
                                {
                                    int __temp_stmt635 = default(int);
                                    {
                                        int index4 = (__temp_p294 + 1);
                                        __temp_stmt635 = (((((uint)(index4)) < str.Length)) ? (((int)(global::haxe.lang.Runtime.toInt(str[index4])))) : (-1));
                                    }

                                    __temp_boolv634 = (__temp_stmt635 == 100);
                                }

                                bool __temp_stmt631 = (__temp_stmt632 || __temp_boolv634);
                                if (__temp_stmt631)
                                {
                                    if (!(string.Equals(global::haxe.lang.StringExt.substr(str, (__temp_p294 + 2), new global::haxe.lang.Null <int>(6, true)).ToUpper(), "OCTYPE")))
                                    {
                                        throw global::haxe.lang.HaxeException.wrap("Expected <!DOCTYPE");
                                    }

                                    __temp_p294 += 8;
                                    state        = 16;
                                    start        = (__temp_p294 + 1);
                                }
                                else
                                {
                                    int __temp_stmt638 = default(int);
                                    {
                                        int index5 = (__temp_p294 + 1);
                                        __temp_stmt638 = (((((uint)(index5)) < str.Length)) ? (((int)(global::haxe.lang.Runtime.toInt(str[index5])))) : (-1));
                                    }

                                    bool __temp_stmt637  = (__temp_stmt638 != 45);
                                    bool __temp_boolv639 = false;
                                    if (!(__temp_stmt637))
                                    {
                                        int __temp_stmt640 = default(int);
                                        {
                                            int index6 = (__temp_p294 + 2);
                                            __temp_stmt640 = (((((uint)(index6)) < str.Length)) ? (((int)(global::haxe.lang.Runtime.toInt(str[index6])))) : (-1));
                                        }

                                        __temp_boolv639 = (__temp_stmt640 != 45);
                                    }

                                    bool __temp_stmt636 = (__temp_stmt637 || __temp_boolv639);
                                    if (__temp_stmt636)
                                    {
                                        throw global::haxe.lang.HaxeException.wrap("Expected <!--");
                                    }
                                    else
                                    {
                                        __temp_p294 += 2;
                                        state        = 15;
                                        start        = (__temp_p294 + 1);
                                    }
                                }
                            }

                            break;
                        }


                        case 63:
                        {
                            state = 14;
                            start = __temp_p294;
                            break;
                        }


                        case 47:
                        {
                            if ((parent == default(global::haxe.root.Xml)))
                            {
                                throw global::haxe.lang.HaxeException.wrap("Expected node name");
                            }

                            start = (__temp_p294 + 1);
                            state = 0;
                            next  = 10;
                            break;
                        }


                        default:
                        {
                            state = 3;
                            start = __temp_p294;
                            continue;
                        }
                        }

                        break;
                    }


                    case 3:
                    {
                        if (!((((((((((c >= 97) && (c <= 122)) || ((c >= 65) && (c <= 90))) || ((c >= 48) && (c <= 57))) || (c == 58)) || (c == 46)) || (c == 95)) || (c == 45)))))
                        {
                            if ((__temp_p294 == start))
                            {
                                throw global::haxe.lang.HaxeException.wrap("Expected node name");
                            }

                            xml = global::haxe.root.Xml.createElement(global::haxe.lang.StringExt.substr(str, start, new global::haxe.lang.Null <int>((__temp_p294 - start), true)));
                            parent.addChild(xml);
                            state = 0;
                            next  = 4;
                            continue;
                        }

                        break;
                    }


                    case 4:
                    {
                        switch (c)
                        {
                        case 47:
                        {
                            state = 11;
                            nsubs++;
                            break;
                        }


                        case 62:
                        {
                            state = 9;
                            nsubs++;
                            break;
                        }


                        default:
                        {
                            state = 5;
                            start = __temp_p294;
                            continue;
                        }
                        }

                        break;
                    }


                    case 5:
                    {
                        if (!((((((((((c >= 97) && (c <= 122)) || ((c >= 65) && (c <= 90))) || ((c >= 48) && (c <= 57))) || (c == 58)) || (c == 46)) || (c == 95)) || (c == 45)))))
                        {
                            string tmp = default(string);
                            if ((start == __temp_p294))
                            {
                                throw global::haxe.lang.HaxeException.wrap("Expected attribute name");
                            }

                            tmp   = global::haxe.lang.StringExt.substr(str, start, new global::haxe.lang.Null <int>((__temp_p294 - start), true));
                            aname = tmp;
                            if (xml.exists(aname))
                            {
                                throw global::haxe.lang.HaxeException.wrap("Duplicate attribute");
                            }

                            state = 0;
                            next  = 6;
                            continue;
                        }

                        break;
                    }


                    case 6:
                    {
                        switch (c)
                        {
                        case 61:
                        {
                            state = 0;
                            next  = 7;
                            break;
                        }


                        default:
                        {
                            throw global::haxe.lang.HaxeException.wrap("Expected =");
                        }
                        }

                        break;
                    }


                    case 7:
                    {
                        switch (c)
                        {
                        case 34:
                        case 39:
                        {
                            state = 8;
                            start = __temp_p294;
                            break;
                        }


                        default:
                        {
                            throw global::haxe.lang.HaxeException.wrap("Expected \"");
                        }
                        }

                        break;
                    }


                    case 8:
                    {
                        if ((c == ((((((uint)(start)) < str.Length)) ? (((int)(global::haxe.lang.Runtime.toInt(str[start])))) : (-1)))))
                        {
                            string val = global::haxe.lang.StringExt.substr(str, (start + 1), new global::haxe.lang.Null <int>(((__temp_p294 - start) - 1), true));
                            xml.@set(aname, val);
                            state = 0;
                            next  = 4;
                        }

                        break;
                    }


                    case 9:
                    {
                        __temp_p294 = global::haxe.xml.Parser.doParse(str, new global::haxe.lang.Null <int>(__temp_p294, true), xml);
                        start       = __temp_p294;
                        state       = 1;
                        break;
                    }


                    case 11:
                    {
                        switch (c)
                        {
                        case 62:
                        {
                            state = 1;
                            break;
                        }


                        default:
                        {
                            throw global::haxe.lang.HaxeException.wrap("Expected >");
                        }
                        }

                        break;
                    }


                    case 12:
                    {
                        switch (c)
                        {
                        case 62:
                        {
                            if ((nsubs == 0))
                            {
                                parent.addChild(global::haxe.root.Xml.createPCData(""));
                            }

                            return(__temp_p294);
                        }


                        default:
                        {
                            throw global::haxe.lang.HaxeException.wrap("Expected >");
                        }
                        }
                    }


                    case 10:
                    {
                        if (!((((((((((c >= 97) && (c <= 122)) || ((c >= 65) && (c <= 90))) || ((c >= 48) && (c <= 57))) || (c == 58)) || (c == 46)) || (c == 95)) || (c == 45)))))
                        {
                            if ((start == __temp_p294))
                            {
                                throw global::haxe.lang.HaxeException.wrap("Expected node name");
                            }

                            string v = global::haxe.lang.StringExt.substr(str, start, new global::haxe.lang.Null <int>((__temp_p294 - start), true));
                            if (!(string.Equals(v, parent._get_nodeName())))
                            {
                                throw global::haxe.lang.HaxeException.wrap(global::haxe.lang.Runtime.concat(global::haxe.lang.Runtime.concat("Expected </", parent._get_nodeName()), ">"));
                            }

                            state = 0;
                            next  = 12;
                            continue;
                        }

                        break;
                    }


                    case 15:
                    {
                        bool __temp_boolv644 = (c == 45);
                        bool __temp_boolv643 = false;
                        bool __temp_boolv642 = false;
                        if (__temp_boolv644)
                        {
                            int __temp_stmt645 = default(int);
                            {
                                int index7 = (__temp_p294 + 1);
                                __temp_stmt645 = (((((uint)(index7)) < str.Length)) ? (((int)(global::haxe.lang.Runtime.toInt(str[index7])))) : (-1));
                            }

                            __temp_boolv643 = (__temp_stmt645 == 45);
                            if (__temp_boolv643)
                            {
                                int __temp_stmt646 = default(int);
                                {
                                    int index8 = (__temp_p294 + 2);
                                    __temp_stmt646 = (((((uint)(index8)) < str.Length)) ? (((int)(global::haxe.lang.Runtime.toInt(str[index8])))) : (-1));
                                }

                                __temp_boolv642 = (__temp_stmt646 == 62);
                            }
                        }

                        bool __temp_stmt641 = ((__temp_boolv644 && __temp_boolv643) && __temp_boolv642);
                        if (__temp_stmt641)
                        {
                            parent.addChild(global::haxe.root.Xml.createComment(global::haxe.lang.StringExt.substr(str, start, new global::haxe.lang.Null <int>((__temp_p294 - start), true))));
                            __temp_p294 += 2;
                            state        = 1;
                        }

                        break;
                    }


                    case 16:
                    {
                        if ((c == 91))
                        {
                            nbrackets++;
                        }
                        else
                        {
                            if ((c == 93))
                            {
                                nbrackets--;
                            }
                            else
                            {
                                if (((c == 62) && (nbrackets == 0)))
                                {
                                    parent.addChild(global::haxe.root.Xml.createDocType(global::haxe.lang.StringExt.substr(str, start, new global::haxe.lang.Null <int>((__temp_p294 - start), true))));
                                    state = 1;
                                }
                            }
                        }

                        break;
                    }


                    case 14:
                    {
                        bool __temp_boolv649 = (c == 63);
                        bool __temp_boolv648 = false;
                        if (__temp_boolv649)
                        {
                            int __temp_stmt650 = default(int);
                            {
                                int index9 = (__temp_p294 + 1);
                                __temp_stmt650 = (((((uint)(index9)) < str.Length)) ? (((int)(global::haxe.lang.Runtime.toInt(str[index9])))) : (-1));
                            }

                            __temp_boolv648 = (__temp_stmt650 == 62);
                        }

                        bool __temp_stmt647 = (__temp_boolv649 && __temp_boolv648);
                        if (__temp_stmt647)
                        {
                            __temp_p294++;
                            string str1 = global::haxe.lang.StringExt.substr(str, (start + 1), new global::haxe.lang.Null <int>(((__temp_p294 - start) - 2), true));
                            parent.addChild(global::haxe.root.Xml.createProcessingInstruction(str1));
                            state = 1;
                        }

                        break;
                    }


                    case 18:
                    {
                        if ((c == 59))
                        {
                            string s = global::haxe.lang.StringExt.substr(str, start, new global::haxe.lang.Null <int>((__temp_p294 - start), true));
                            if ((((((((uint)(0)) < s.Length)) ? (((int)(global::haxe.lang.Runtime.toInt(s[0])))) : (-1))) == 35))
                            {
                                global::haxe.lang.Null <int> i = default(global::haxe.lang.Null <int>);
                                if ((((((((uint)(1)) < s.Length)) ? (((int)(global::haxe.lang.Runtime.toInt(s[1])))) : (-1))) == 120))
                                {
                                    i = new global::haxe.lang.Null <int>(global::Std.parseInt(global::haxe.lang.Runtime.concat("0", global::haxe.lang.StringExt.substr(s, 1, new global::haxe.lang.Null <int>((s.Length - 1), true)))).@value, true);
                                }
                                else
                                {
                                    i = new global::haxe.lang.Null <int>(global::Std.parseInt(global::haxe.lang.StringExt.substr(s, 1, new global::haxe.lang.Null <int>((s.Length - 1), true))).@value, true);
                                }

                                {
                                    object x = new string(((char)(i.@value)), 1);
                                    buf.b.Append(((object)(global::Std.@string(x))));
                                }
                            }
                            else
                            {
                                if (!(global::haxe.xml.Parser.escapes.exists(s)))
                                {
                                    buf.b.Append(((object)(global::Std.@string(global::haxe.lang.Runtime.concat(global::haxe.lang.Runtime.concat("&", s), ";")))));
                                }
                                else
                                {
                                    object x1 = global::haxe.lang.Runtime.toString(global::haxe.xml.Parser.escapes.@get(s).@value);
                                    buf.b.Append(((object)(global::Std.@string(x1))));
                                }
                            }

                            start = (__temp_p294 + 1);
                            state = next;
                        }

                        break;
                    }
                    }

                    {
                        int index10 = ++__temp_p294;
                        if ((((uint)(index10)) < str.Length))
                        {
                            c = ((int)(global::haxe.lang.Runtime.toInt(str[index10])));
                        }
                        else
                        {
                            c = -1;
                        }
                    }
                }

                if ((state == 1))
                {
                    start = __temp_p294;
                    state = 13;
                }

                if ((state == 13))
                {
                    if (((__temp_p294 != start) || (nsubs == 0)))
                    {
                        parent.addChild(global::haxe.root.Xml.createPCData(global::haxe.lang.Runtime.concat(buf.toString(), global::haxe.lang.StringExt.substr(str, start, new global::haxe.lang.Null <int>((__temp_p294 - start), true)))));
                    }

                    return(__temp_p294);
                }

                throw global::haxe.lang.HaxeException.wrap("Unexpected end");
            }
        }