public async override Task <Types.Variable> Exec(CefPreter.IBrowser Browser = null) { Types.Variable result = null; if (Parameters[0].Type == CefType.NumberLiteral && Parameters[1].Type == CefType.NumberLiteral) { if (Convert.ToInt32(Parameters[0].Name) == Convert.ToInt32(Parameters[1].Name)) { result = new Types.Number(this.GetType().Name, 1); } else { result = new Types.Number(this.GetType().Name, 0); } } else if (Parameters[0].Type == CefType.StringLiteral && Parameters[1].Type == CefType.StringLiteral) { if (String.Compare(Parameters[0].Name, Parameters[1].Name) == 0) { result = new Types.Number(this.GetType().Name, 1); } else { result = new Types.Number(this.GetType().Name, 0); } } else { throw new CefTypeException("Can't convert " + Parameters[0].Type.ToString() + " to String"); } return(result); }
public static TypeMeta Get(Types.Variable var, Types.Type type) { TypeMeta v = new TypeMeta(var); type.Accept(v); return(v); }
public Log(Types.Bean bean, System.IO.StreamWriter sw, Types.Variable var, string prefix) { this.bean = bean; this.sw = sw; this.var = var; this.prefix = prefix; }
public static string GetDefault(Types.Variable var) { Default def = new Default(var); var.VariableType.Accept(def); return(def.Value); }
public async override Task <Types.Variable> Exec(CefPreter.IBrowser Browser = null) { Types.Variable result = null; if (Parameters[0].Type == CefType.NumberLiteral || Parameters[0].Type == CefType.StringLiteral) { result = new Types.String(this.GetType().Name, Parameters[0].ToString()); } else { throw new CefTypeException("Can't convert " + Parameters[0].Type.ToString() + " to String"); } return(result); }
public async override Task <Types.Variable> Exec(CefPreter.IBrowser Browser = null) { Types.Variable result = null; if (Parameters[0].Type == CefType.StringLiteral) { string a = Regex.Match(Parameters[0].ToString(), @"(\d+)").Groups[1].Value; int r = Convert.ToInt32(a); result = new Types.Number(this.GetType().Name, r); } else if (Parameters[0].Type == CefType.NumberLiteral) { result = new Types.Number(this.GetType().Name, Convert.ToInt32(Parameters[0])); } else { throw new CefTypeException("Can't convert " + Parameters[0].Type.ToString() + " to String"); } return(result); }
public async override Task <Types.Variable> Exec(CefPreter.IBrowser Browser = null) { Types.Variable res = null; if (Parameters[0].Type == CefType.NumberLiteral) { int parami = 0; try { parami = Convert.ToInt32(Parameters[0].Name); } catch { } if (parami == 0) { res = Types.Variable.Create(this.GetType().Name, 0); } else { res = res = Types.Variable.Create(this.GetType().Name, 1); } } else if (Parameters[0].Type == CefType.StringLiteral) { if (System.String.IsNullOrWhiteSpace(Parameters[0].ToString())) { res = Types.Variable.Create(this.GetType().Name, 0); } else { res = res = Types.Variable.Create(this.GetType().Name, 1); } } else { throw new CefTypeException(Parameters[0].Name + " is not a number/string " + this.ToString()); } return(res); }
public Property(System.IO.StreamWriter sw, Types.Variable var, string prefix) { this.sw = sw; this.var = var; this.prefix = prefix; }
public Equal(Variable var, string another, bool isEquals) { this.var = var; this.another = another; this.isEquals = isEquals; }
public Construct(System.IO.StreamWriter sw, Types.Variable variable, String prefix) { this.sw = sw; this.variable = variable; this.prefix = prefix; }
private Default(Types.Variable var) { this.variable = var; }