// Generated by Haxe 4.3.3
package haxe.root;

import haxe.root.*;

@SuppressWarnings(value={"rawtypes", "unchecked"})
public class EReg extends haxe.lang.HxObject
{
	public EReg(haxe.lang.EmptyObject empty)
	{
	}
	
	
	public EReg(java.lang.String r, java.lang.String opt)
	{
		//line 33 "/usr/share/haxe/std/java/_std/EReg.hx"
		haxe.root.EReg.__hx_ctor__EReg(this, r, opt);
	}
	
	
	protected static void __hx_ctor__EReg(haxe.root.EReg __hx_this, java.lang.String r, java.lang.String opt)
	{
		//line 34 "/usr/share/haxe/std/java/_std/EReg.hx"
		int flags = 0;
		//line 35 "/usr/share/haxe/std/java/_std/EReg.hx"
		{
			//line 35 "/usr/share/haxe/std/java/_std/EReg.hx"
			int _g = 0;
			//line 35 "/usr/share/haxe/std/java/_std/EReg.hx"
			int _g1 = opt.length();
			//line 35 "/usr/share/haxe/std/java/_std/EReg.hx"
			while (( _g < _g1 ))
			{
				//line 35 "/usr/share/haxe/std/java/_std/EReg.hx"
				int i = _g++;
				//line 36 "/usr/share/haxe/std/java/_std/EReg.hx"
				switch (( (( i < opt.length() )) ? (((int) (((java.lang.String) (((java.lang.Object) (opt) )) ).charAt(i)) )) : (-1) ))
				{
					case 103:
					{
						//line 44 "/usr/share/haxe/std/java/_std/EReg.hx"
						__hx_this.isGlobal = true;
						//line 44 "/usr/share/haxe/std/java/_std/EReg.hx"
						break;
					}
					
					
					case 105:
					{
						//line 38 "/usr/share/haxe/std/java/_std/EReg.hx"
						flags |= java.util.regex.Pattern.CASE_INSENSITIVE;
						//line 38 "/usr/share/haxe/std/java/_std/EReg.hx"
						break;
					}
					
					
					case 109:
					{
						//line 40 "/usr/share/haxe/std/java/_std/EReg.hx"
						flags |= java.util.regex.Pattern.MULTILINE;
						//line 40 "/usr/share/haxe/std/java/_std/EReg.hx"
						break;
					}
					
					
					case 115:
					{
						//line 42 "/usr/share/haxe/std/java/_std/EReg.hx"
						flags |= java.util.regex.Pattern.DOTALL;
						//line 42 "/usr/share/haxe/std/java/_std/EReg.hx"
						break;
					}
					
					
				}
				
			}
			
		}
		
		//line 48 "/usr/share/haxe/std/java/_std/EReg.hx"
		flags |= java.util.regex.Pattern.UNICODE_CASE;
		//line 50 "/usr/share/haxe/std/java/_std/EReg.hx"
		flags |= java.util.regex.Pattern.UNICODE_CHARACTER_CLASS;
		//line 52 "/usr/share/haxe/std/java/_std/EReg.hx"
		__hx_this.matcher = java.util.regex.Pattern.compile(haxe.lang.Runtime.toString(haxe.root.EReg.convert(r)), ((int) (flags) )).matcher(((java.lang.CharSequence) ("") ));
		//line 53 "/usr/share/haxe/std/java/_std/EReg.hx"
		__hx_this.pattern = r;
	}
	
	
	public static java.lang.String convert(java.lang.String r)
	{
		//line 81 "/usr/share/haxe/std/java/_std/EReg.hx"
		return r;
	}
	
	
	public java.lang.String pattern;
	
	public java.util.regex.Matcher matcher;
	
	public java.lang.String cur;
	
	public boolean isGlobal;
	
	public boolean match(java.lang.String s)
	{
		//line 85 "/usr/share/haxe/std/java/_std/EReg.hx"
		this.cur = s;
		//line 86 "/usr/share/haxe/std/java/_std/EReg.hx"
		this.matcher = this.matcher.reset(((java.lang.CharSequence) (s) ));
		//line 87 "/usr/share/haxe/std/java/_std/EReg.hx"
		return this.matcher.find();
	}
	
	
	public java.lang.String matched(int n)
	{
		//line 91 "/usr/share/haxe/std/java/_std/EReg.hx"
		if (( n == 0 )) 
		{
			//line 92 "/usr/share/haxe/std/java/_std/EReg.hx"
			return this.matcher.group();
		}
		else
		{
			//line 94 "/usr/share/haxe/std/java/_std/EReg.hx"
			return this.matcher.group(((int) (n) ));
		}
		
	}
	
	
	public java.lang.String matchedLeft()
	{
		//line 98 "/usr/share/haxe/std/java/_std/EReg.hx"
		return haxe.lang.StringExt.substring(this.cur, 0, this.matcher.start());
	}
	
	
	public java.lang.String matchedRight()
	{
		//line 102 "/usr/share/haxe/std/java/_std/EReg.hx"
		return haxe.lang.StringExt.substring(this.cur, this.matcher.end(), this.cur.length());
	}
	
	
	public java.lang.String replace(java.lang.String s, java.lang.String by)
	{
		//line 160 "/usr/share/haxe/std/java/_std/EReg.hx"
		this.matcher.reset(((java.lang.CharSequence) (s) ));
		//line 161 "/usr/share/haxe/std/java/_std/EReg.hx"
		by = haxe.root.StringTools.replace(haxe.root.StringTools.replace(by, "\\", "\\\\"), "$$", "\\$");
		//line 162 "/usr/share/haxe/std/java/_std/EReg.hx"
		if (this.isGlobal) 
		{
			//line 162 "/usr/share/haxe/std/java/_std/EReg.hx"
			return this.matcher.replaceAll(haxe.lang.Runtime.toString(by));
		}
		else
		{
			//line 162 "/usr/share/haxe/std/java/_std/EReg.hx"
			return this.matcher.replaceFirst(haxe.lang.Runtime.toString(by));
		}
		
	}
	
	
	@Override public java.lang.Object __hx_setField(java.lang.String field, java.lang.Object value, boolean handleProperties)
	{
		//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
		{
			//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
			boolean __temp_executeDef1 = true;
			//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
			if (( field != null )) 
			{
				//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
				switch (field.hashCode())
				{
					case -568986259:
					{
						//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
						if (field.equals("isGlobal")) 
						{
							//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
							__temp_executeDef1 = false;
							//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
							this.isGlobal = haxe.lang.Runtime.toBool(((java.lang.Boolean) (value) ));
							//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
							return value;
						}
						
						//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
						break;
					}
					
					
					case -791090288:
					{
						//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
						if (field.equals("pattern")) 
						{
							//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
							__temp_executeDef1 = false;
							//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
							this.pattern = haxe.lang.Runtime.toString(value);
							//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
							return value;
						}
						
						//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
						break;
					}
					
					
					case 98880:
					{
						//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
						if (field.equals("cur")) 
						{
							//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
							__temp_executeDef1 = false;
							//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
							this.cur = haxe.lang.Runtime.toString(value);
							//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
							return value;
						}
						
						//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
						break;
					}
					
					
					case 840862002:
					{
						//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
						if (field.equals("matcher")) 
						{
							//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
							__temp_executeDef1 = false;
							//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
							this.matcher = ((java.util.regex.Matcher) (value) );
							//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
							return value;
						}
						
						//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
						break;
					}
					
					
				}
				
			}
			
			//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
			if (__temp_executeDef1) 
			{
				//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
				return super.__hx_setField(field, value, handleProperties);
			}
			else
			{
				//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
				throw null;
			}
			
		}
		
	}
	
	
	@Override public java.lang.Object __hx_getField(java.lang.String field, boolean throwErrors, boolean isCheck, boolean handleProperties)
	{
		//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
		{
			//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
			boolean __temp_executeDef1 = true;
			//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
			if (( field != null )) 
			{
				//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
				switch (field.hashCode())
				{
					case 1094496948:
					{
						//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
						if (field.equals("replace")) 
						{
							//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
							__temp_executeDef1 = false;
							//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
							return ((haxe.lang.Function) (new haxe.lang.Closure(this, "replace")) );
						}
						
						//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
						break;
					}
					
					
					case -791090288:
					{
						//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
						if (field.equals("pattern")) 
						{
							//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
							__temp_executeDef1 = false;
							//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
							return this.pattern;
						}
						
						//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
						break;
					}
					
					
					case 2058510168:
					{
						//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
						if (field.equals("matchedRight")) 
						{
							//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
							__temp_executeDef1 = false;
							//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
							return ((haxe.lang.Function) (new haxe.lang.Closure(this, "matchedRight")) );
						}
						
						//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
						break;
					}
					
					
					case 840862002:
					{
						//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
						if (field.equals("matcher")) 
						{
							//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
							__temp_executeDef1 = false;
							//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
							return this.matcher;
						}
						
						//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
						break;
					}
					
					
					case 2144430923:
					{
						//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
						if (field.equals("matchedLeft")) 
						{
							//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
							__temp_executeDef1 = false;
							//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
							return ((haxe.lang.Function) (new haxe.lang.Closure(this, "matchedLeft")) );
						}
						
						//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
						break;
					}
					
					
					case 98880:
					{
						//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
						if (field.equals("cur")) 
						{
							//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
							__temp_executeDef1 = false;
							//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
							return this.cur;
						}
						
						//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
						break;
					}
					
					
					case 840861988:
					{
						//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
						if (field.equals("matched")) 
						{
							//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
							__temp_executeDef1 = false;
							//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
							return ((haxe.lang.Function) (new haxe.lang.Closure(this, "matched")) );
						}
						
						//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
						break;
					}
					
					
					case -568986259:
					{
						//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
						if (field.equals("isGlobal")) 
						{
							//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
							__temp_executeDef1 = false;
							//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
							return this.isGlobal;
						}
						
						//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
						break;
					}
					
					
					case 103668165:
					{
						//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
						if (field.equals("match")) 
						{
							//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
							__temp_executeDef1 = false;
							//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
							return ((haxe.lang.Function) (new haxe.lang.Closure(this, "match")) );
						}
						
						//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
						break;
					}
					
					
				}
				
			}
			
			//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
			if (__temp_executeDef1) 
			{
				//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
				return super.__hx_getField(field, throwErrors, isCheck, handleProperties);
			}
			else
			{
				//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
				throw null;
			}
			
		}
		
	}
	
	
	@Override public java.lang.Object __hx_invokeField(java.lang.String field, java.lang.Object[] dynargs)
	{
		//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
		{
			//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
			boolean __temp_executeDef1 = true;
			//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
			if (( field != null )) 
			{
				//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
				switch (field.hashCode())
				{
					case 1094496948:
					{
						//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
						if (field.equals("replace")) 
						{
							//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
							__temp_executeDef1 = false;
							//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
							return this.replace(haxe.lang.Runtime.toString(dynargs[0]), haxe.lang.Runtime.toString(dynargs[1]));
						}
						
						//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
						break;
					}
					
					
					case 103668165:
					{
						//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
						if (field.equals("match")) 
						{
							//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
							__temp_executeDef1 = false;
							//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
							return this.match(haxe.lang.Runtime.toString(dynargs[0]));
						}
						
						//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
						break;
					}
					
					
					case 2058510168:
					{
						//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
						if (field.equals("matchedRight")) 
						{
							//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
							__temp_executeDef1 = false;
							//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
							return this.matchedRight();
						}
						
						//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
						break;
					}
					
					
					case 840861988:
					{
						//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
						if (field.equals("matched")) 
						{
							//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
							__temp_executeDef1 = false;
							//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
							return this.matched(((int) (haxe.lang.Runtime.toInt(dynargs[0])) ));
						}
						
						//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
						break;
					}
					
					
					case 2144430923:
					{
						//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
						if (field.equals("matchedLeft")) 
						{
							//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
							__temp_executeDef1 = false;
							//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
							return this.matchedLeft();
						}
						
						//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
						break;
					}
					
					
				}
				
			}
			
			//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
			if (__temp_executeDef1) 
			{
				//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
				return super.__hx_invokeField(field, dynargs);
			}
			else
			{
				//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
				throw null;
			}
			
		}
		
	}
	
	
	@Override public void __hx_getFields(haxe.root.Array<java.lang.String> baseArr)
	{
		//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
		baseArr.push("isGlobal");
		//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
		baseArr.push("cur");
		//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
		baseArr.push("matcher");
		//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
		baseArr.push("pattern");
		//line 27 "/usr/share/haxe/std/java/_std/EReg.hx"
		super.__hx_getFields(baseArr);
	}
	
	
}


