void ValueNodeTextBox_LabelChanged(object sender, LabelEventArgs e) { NodeTextBox box = sender as NodeTextBox; if (box.Parent.CurrentNode == null) { return; } VariableNode node = box.Parent.CurrentNode.Tag as VariableNode; node.IsEditing = false; try { var debugManager = PluginMain.debugManager; var flashInterface = debugManager.FlashInterface; IASTBuilder b = new ASTBuilder(false); ValueExp exp = b.parse(new java.io.StringReader(node.GetVariablePath())); var ctx = new ExpressionContext(flashInterface.Session, flashInterface.GetFrames()[debugManager.CurrentFrame]); var obj = exp.evaluate(ctx); node.Variable = (Variable)obj; if (!watchMode) { PanelsHelper.watchUI.UpdateElements(); } if (ValueChanged != null) { ValueChanged(this, EventArgs.Empty); } } catch (Exception ex) { ErrorManager.ShowError(TextHelper.GetString("Error.Reevaluate"), ex); } }
void generateSet(EmitExpContext context, Exp valueExpr) { EmitHelper.LoadVar(IL, listSymbol.VarBuilder); EmitHelper.LoadVar(IL, indexSymbol.VarBuilder); ValueExp.Generate(context); EmitHelper.CallDynamic(IL, setMethod, ExProperty.IsSelf); }
public virtual Object evaluate(ValueExp e) { // evaluate away... ExpressionContext c = new ExpressionContext(this); return(e.evaluate(c)); }
public BreakPointInfo(string fileFullPath, int line, string exp, Boolean bDeleted, Boolean bEnabled) { m_FileFullPath = fileFullPath; m_Line = line; m_bDeleted = bDeleted; m_bEnabled = bEnabled; m_ParsedExpression = null; Exp = exp; }
public BreakPointInfo() { m_FileFullPath = ""; m_Line = 0; m_ConditionalExpression = ""; m_bDeleted = false; m_bEnabled = false; m_ParsedExpression = null; }
public override string ToString() { if (IsAssignTo) { return(ValueExp.ToString() + "=>" + ToExp.ToString()); } else { return(ToExp.ToString() + "=" + ValueExp.ToString()); } }
public override Exp Analy( ) { if (this.IsAnalyed) { return(this); } ValueExp = ValueExp.Analy(); RetType = ValueExp.RetType; IsAnalyed = true; return(this); }
private void Manager_OnMouseHover(ScintillaControl sci, Int32 position) { DebuggerManager debugManager = PluginMain.debugManager; FlashInterface flashInterface = debugManager.FlashInterface; if (!PluginBase.MainForm.EditorMenu.Visible && flashInterface != null && flashInterface.isDebuggerStarted && flashInterface.isDebuggerSuspended) { if (debugManager.CurrentLocation != null && debugManager.CurrentLocation.File != null) { String localPath = debugManager.GetLocalPath(debugManager.CurrentLocation.File); if (localPath == null || localPath != PluginBase.MainForm.CurrentDocument.FileName) { return; } } else { return; } Point dataTipPoint = Control.MousePosition; Rectangle rect = new Rectangle(m_ToolTip.Location, m_ToolTip.Size); if (m_ToolTip.Visible && rect.Contains(dataTipPoint)) { return; } position = sci.WordEndPosition(position, true); String leftword = GetWordAtPosition(sci, position); if (leftword != String.Empty) { try { ASTBuilder builder = new ASTBuilder(true); ValueExp exp = builder.parse(new System.IO.StringReader(leftword)); ExpressionContext context = new ExpressionContext(flashInterface.Session); context.Depth = debugManager.CurrentFrame; Object obj = exp.evaluate(context); Show(dataTipPoint, (Variable)obj); } catch (Exception e) { } } } }
public Expression OnValue(ValueExp exp) { if (token.Accepts(exp)) { return(Expression.Empty); } else { return(Expression.NotAllowed); } }
public override bool Accepts(ValueExp exp) { object o = exp.dt.CreateValue(literal, context); if (o == null) { return(false); } // System.Diagnostics.Trace.WriteLine( // string.Format("value compare:{0}:{1}",o,exp.value)); return(exp.dt.SameValue(o, exp.value)); }
public override string ToCode() { string valueCode = ValueExp == null ? "" : ValueExp.ToCode(); string toCode = ToExp == null ? "" : ToExp.ToCode(); if (IsAssignTo) { return(string.Format("{0}{1} => {2} ;", getStmtPrefix(), valueCode, toCode)); } else { return(string.Format("{0}{1} = {2} ;", getStmtPrefix(), toCode, valueCode)); } }
public static void Main(String[] args) { ASTBuilder ab = new ASTBuilder(true); try { ab.addLong(5); ab.addOp(Operator.ARITH_SUB); ab.addLong(6); ValueExp exp1 = ab.done(); ab.addLong(5); ab.addOp(Operator.ARITH_ADD); ab.addOp(Operator.OPEN_PAREN); ab.addLong(6); ab.addOp(Operator.ARITH_DIV); ab.addLong(4); ab.addOp(Operator.ARITH_MULT); ab.addLong(7); ab.addOp(Operator.CLOSE_PAREN); ab.addOp(Operator.BITWISE_RSHIFT); ab.addLong(2); ValueExp exp2 = ab.done(); ValueExp exp3 = ab.parse(new StringReader("5-6")); //$NON-NLS-1$ ValueExp exp4 = ab.parse(new StringReader("5 +(6/4*7 )>>2")); //$NON-NLS-1$ ValueExp exp5 = ab.parse(new StringReader(" 4 == 2")); //$NON-NLS-1$ Object o1 = exp1.evaluate(null); Object o2 = exp2.evaluate(null); Object o3 = exp3.evaluate(null); Object o4 = exp4.evaluate(null); Object o5 = exp5.evaluate(null); Console.Out.WriteLine("=" + o1 + "," + o2); //$NON-NLS-1$ //$NON-NLS-2$ Console.Out.WriteLine("=" + o3 + "," + o4); //$NON-NLS-1$ //$NON-NLS-2$ Console.Out.WriteLine("=" + o5); //$NON-NLS-1$ } catch (Exception e) { if (Trace.error) { Console.Error.Write(e.StackTrace); Console.Error.Flush(); } } }
private string processExpr(string expr) { IASTBuilder builder = new ASTBuilder(true); ValueExp exp = builder.parse(new java.io.StringReader(expr)); var ctx = new ExpressionContext(PluginMain.debugManager.FlashInterface.Session, PluginMain.debugManager.FlashInterface.GetFrames()[PluginMain.debugManager.CurrentFrame]); var obj = exp.evaluate(ctx); if (obj is Variable) { return(ctx.FormatValue(((Variable)obj).getValue())); } if (obj is Value) { return(ctx.FormatValue((Value)obj)); } return(obj.toString()); }
private DataNode GetExpressionNode(string item) { DataNode node; try { if (!PluginMain.debugManager.FlashInterface.isDebuggerStarted || !PluginMain.debugManager.FlashInterface.isDebuggerSuspended) { return(new ErrorNode(item, new Exception(""))); } IASTBuilder builder = new ASTBuilder(false); ValueExp exp = builder.parse(new java.io.StringReader(item)); var ctx = new ExpressionContext(PluginMain.debugManager.FlashInterface.Session, PluginMain.debugManager.FlashInterface.GetFrames()[PluginMain.debugManager.CurrentFrame]); var obj = exp.evaluate(ctx); if (obj is Variable) { node = new VariableNode((Variable)obj) { HideClassId = PluginMain.settingObject.HideClassIds, HideFullClasspath = PluginMain.settingObject.HideFullClasspaths }; } else if (obj is Value) { node = new ValueNode(item, (Value)obj) { HideClassId = PluginMain.settingObject.HideClassIds, HideFullClasspath = PluginMain.settingObject.HideFullClasspaths }; } else { node = new ScalarNode(item, obj.toString()); } node.Tag = item; } catch (Exception ex) { node = new ErrorNode(item, ex); } node.Text = item; return(node); }
private String Path(ValueExp exp) { StringBuilder sb = new StringBuilder(); if (exp is DotExp) { sb.Append(Path((exp as DotExp).m_left)); sb.Append('.'); sb.Append(Path((exp as DotExp).m_right)); } else if (exp is VariableExp) { sb.Append((exp as VariableExp).m_name); } else { sb.Append(exp.ToString()); } return(sb.ToString()); }
private String Path(ValueExp exp) { StringBuilder sb = new StringBuilder(); if (exp is DotExp) { sb.Append(Path((exp as DotExp).m_left)); sb.Append('.'); sb.Append(Path((exp as DotExp).m_right)); } else if (exp is VariableExp) { sb.Append((exp as VariableExp).m_name); } else { sb.Append(exp.ToString()); } return sb.ToString(); }
/// <summary> The front-end has finished so we pop the /// stack until it empty /// </summary> private ValueExp done() { while (m_opStack.Count > 0) { popOperation(); } /* should only have one entry on the expression stack */ ValueExp tree = (ValueExp)m_expStack.Pop(); if (m_expStack.Count != 0 || m_opStack.Count != 0) { /* clear the stacks */ m_expStack.Clear(); m_opStack.Clear(); throw new IncompleteExpressionException(); } return(tree); }
public void UpdateElements() { treeControl.Tree.BeginUpdate(); treeControl.Nodes.Clear(); foreach (String item in watches) { DataNode node = new DataNode(item); // todo, introduce new Node types. try { IASTBuilder builder = new ASTBuilder(false); ValueExp exp = builder.parse(new java.io.StringReader(item)); var ctx = new ExpressionContext(PluginMain.debugManager.FlashInterface.Session, PluginMain.debugManager.FlashInterface.Session.getFrames()[PluginMain.debugManager.CurrentFrame]); var obj = exp.evaluate(ctx); node = new DataNode((Variable)obj); } catch { } node.Text = item; treeControl.AddNode(node); } treeControl.Tree.EndUpdate(); treeControl.Enabled = true; }
public void UpdateElements() { treeControl.Tree.BeginUpdate(); treeControl.Nodes.Clear(); foreach (String item in watches) { DataNode node = new DataNode(item); // todo, introduce new Node types. try { ASTBuilder builder = new ASTBuilder(true); ValueExp exp = builder.parse(new System.IO.StringReader(item)); ExpressionContext context = new ExpressionContext(PluginMain.debugManager.FlashInterface.Session); context.Depth = PluginMain.debugManager.CurrentFrame; Object obj = exp.evaluate(context); node = new DataNode((Variable)obj); } catch { } node.Text = item; treeControl.AddNode(node); } treeControl.Tree.EndUpdate(); treeControl.Enabled = true; }
public void OnValue(ValueExp exp) { }
public virtual Expression OnValue(ValueExp exp) { return(exp); }
public override Expression OnValue(ValueExp exp) { return(Expression.NotAllowed); }
/* * Evaluate the given expression */ internal virtual Object evalExpression(ValueExp expr) { return evalExpression(expr, true); }
public override string ToString() { return(NameToken.Text + ":" + ValueExp.ToString()); }
public virtual Object evaluate(ValueExp e) { // evaluate away... ExpressionContext c = new ExpressionContext(this); return e.evaluate(c); }
public override void Emit() { ValueExp.Emit(); }
void TreeExpanding(Object sender, TreeViewAdvEventArgs e) { if (e.Node.Index >= 0) { DataNode node = e.Node.Tag as DataNode; if (node.Nodes.Count == 0 && node.Variable != null) { FlashInterface flashInterface = PluginMain.debugManager.FlashInterface; List <DataNode> nodes = new List <DataNode>(); List <DataNode> inherited = new List <DataNode>(); List <DataNode> statics = new List <DataNode>(); int tmpLimit = node.ChildrenShowLimit; foreach (Variable member in node.Variable.getValue().getMembers(flashInterface.Session)) { DataNode memberNode = new DataNode(member); if (member.isAttributeSet(VariableAttribute_.IS_STATIC)) { statics.Add(memberNode); } else if (member.getLevel() > 0) { inherited.Add(memberNode); } else { nodes.Add(memberNode); } } if (inherited.Count > 0) { DataNode inheritedNode = new DataNode("[inherited]"); inherited.Sort(); foreach (DataNode item in inherited) { inheritedNode.Nodes.Add(item); } node.Nodes.Add(inheritedNode); } if (statics.Count > 0) { DataNode staticNode = new DataNode("[static]"); statics.Sort(); foreach (DataNode item in statics) { staticNode.Nodes.Add(item); } node.Nodes.Add(staticNode); } //test children foreach (String ch in node.Variable.getValue().getClassHierarchy(false)) { if (ch.Equals("flash.display::DisplayObjectContainer")) { double numChildren = ((java.lang.Double)node.Variable.getValue().getMemberNamed(flashInterface.Session, "numChildren").getValue().getValueAsObject()).doubleValue(); DataNode childrenNode = new DataNode("[children]"); for (int i = 0; i < numChildren; i++) { try { IASTBuilder b = new ASTBuilder(false); string cmd = GetVariablePath(node) + ".getChildAt(" + i + ")"; ValueExp exp = b.parse(new java.io.StringReader(cmd)); var ctx = new ExpressionContext(flashInterface.Session, flashInterface.Session.getFrames()[PluginMain.debugManager.CurrentFrame]); var obj = exp.evaluate(ctx); if (obj is flash.tools.debugger.concrete.DValue) { obj = new flash.tools.debugger.concrete.DVariable("getChildAt(" + i + ")", (flash.tools.debugger.concrete.DValue)obj); } DataNode childNode = new DataNode((Variable)obj); childNode.Text = "child_" + i; childrenNode.Nodes.Add(childNode); } catch (Exception) { } } node.Nodes.Add(childrenNode); } else if (ch.Equals("flash.events::EventDispatcher")) { Variable list = node.Variable.getValue().getMemberNamed(flashInterface.Session, "listeners"); var omg = list.getName(); /* * double numChildren = ((java.lang.Double)node.Variable.getValue().getMemberNamed(flashInterface.Session, "numChildren").getValue().getValueAsObject()).doubleValue(); * DataNode childrenNode = new DataNode("[children]"); * for (int i = 0; i < numChildren; i++) * { * try * { * * IASTBuilder b = new ASTBuilder(false); * string cmd = GetVariablePath(node) + ".getChildAt(" + i + ")"; * ValueExp exp = b.parse(new java.io.StringReader(cmd)); * var ctx = new ExpressionContext(flashInterface.Session, flashInterface.Session.getFrames()[PluginMain.debugManager.CurrentFrame]); * var obj = exp.evaluate(ctx); * if (obj is flash.tools.debugger.concrete.DValue) obj = new flash.tools.debugger.concrete.DVariable("child_" + i, (flash.tools.debugger.concrete.DValue)obj); * DataNode childNode = new DataNode((Variable)obj); * childrenNode.Nodes.Add(childNode); * } * catch (Exception) { } * } * node.Nodes.Add(childrenNode); * */ } } //test children nodes.Sort(); _tree.BeginUpdate(); foreach (DataNode item in nodes) { if (0 == tmpLimit--) { break; } node.Nodes.Add(item); } if (tmpLimit == -1) { DataNode moreNode = new DataNode("..."); node.Nodes.Add(moreNode); } _tree.EndUpdate(); } } }
public override void Execute() { DataSourceBase DataSource = null; string outVal = ""; foreach (DataSourceBase ds in DSList) { if (DSName == null) { string[] Token = ValueExp.Split(new[] { "{DS Name=", " " }, StringSplitOptions.None); DSName = Token[1]; } if (ds.Name == DSName) { DataSource = ds; } } if (DataSource.DSType == DataSourceBase.eDSType.LiteDataBase) { GingerCoreNET.DataSource.GingerLiteDB liteDB = new GingerCoreNET.DataSource.GingerLiteDB(); string Query = ValueExp.Substring(ValueExp.IndexOf("QUERY=") + 6, ValueExp.Length - (ValueExp.IndexOf("QUERY=") + 7)); liteDB.FileFullPath = WorkSpace.Instance.SolutionRepository.ConvertSolutionRelativePath(DataSource.FileFullPath); liteDB.Execute(this, Query); } else if (DataSource.DSType == DataSourceBase.eDSType.MSAccess) { switch (ControlAction) { case eControlAction.GetValue: ValueExpression VE = new ValueExpression(RunOnEnvironment, RunOnBusinessFlow, DSList); VE.Value = ValueExp; AddOrUpdateReturnParamActual("Output", VE.ValueCalculated); break; case eControlAction.SetValue: ValueExpression SVE = new ValueExpression(RunOnEnvironment, RunOnBusinessFlow, DSList); SVE.Value = this.Value; ValueExpression VEUpdate = new ValueExpression(RunOnEnvironment, RunOnBusinessFlow, DSList, true, SVE.ValueCalculated); VEUpdate.Value = ValueExp; outVal = VEUpdate.ValueCalculated; break; case eControlAction.MarkAsDone: ValueExpression VEMAD = new ValueExpression(RunOnEnvironment, RunOnBusinessFlow, DSList); VEMAD.Value = ValueExp; outVal = VEMAD.ValueCalculated; break; case eControlAction.RowCount: case eControlAction.AvailableRowCount: ValueExpression VERC = new ValueExpression(RunOnEnvironment, RunOnBusinessFlow, DSList); VERC.Value = ValueExp; AddOrUpdateReturnParamActual("Output", VERC.ValueCalculated); break; case eControlAction.ExportToExcel: ValueExpression VEETE = new ValueExpression(RunOnEnvironment, RunOnBusinessFlow, DSList); VEETE.Value = ExcelPath; string ExcelFilePath = VEETE.ValueCalculated; if (ExcelFilePath.ToLower().EndsWith(".xlsx")) { DataSource.ExporttoExcel(DSTableName, ExcelFilePath, ExcelSheetName); } else { this.Status = Amdocs.Ginger.CoreNET.Execution.eRunStatus.Failed; Error = "The Export Excel can be *.xlsx only"; } break; case eControlAction.DeleteRow: ValueExpression veDel = new ValueExpression(RunOnEnvironment, RunOnBusinessFlow, DSList); veDel.Value = ValueExp; outVal = veDel.ValueCalculated; int rowCount = 0; if (!string.IsNullOrEmpty(outVal) && !int.TryParse(outVal, out rowCount)) { this.Status = Amdocs.Ginger.CoreNET.Execution.eRunStatus.Failed; Error = outVal; } break; case eControlAction.AddRow: DataSourceTable DSTable = null; ObservableList <DataSourceTable> dstTables = DataSource.GetTablesList(); foreach (DataSourceTable dst in dstTables) { if (dst.Name == DSTableName) { DSTable = dst; DSTable.DataTable = dst.DSC.GetTable(DSTableName); break; } } if (DSTable != null) { List <string> mColumnNames = DataSource.GetColumnList(DSTableName); DataSource.AddRow(mColumnNames, DSTable); DataSource.SaveTable(DSTable.DataTable); //Get GingerId DataTable dt = DataSource.GetTable(DSTableName); DataRow row = dt.Rows[dt.Rows.Count - 1]; string GingerId = Convert.ToString(row["GINGER_ID"]); AddOrUpdateReturnParamActual("GINGER_ID", GingerId); } else { Error = "No table present in the DataSource with the name =" + DSTableName; } break; default: ValueExpression VEDR = new ValueExpression(RunOnEnvironment, RunOnBusinessFlow, DSList); VEDR.Value = ValueExp; outVal = VEDR.ValueCalculated; break; } } return; }
public override void SetParent(Exp parentExp) { ParentExp = parentExp; ValueExp.SetParent(this); }
public override void Execute() { DataSourceBase DataSource = null; string outVal = ""; foreach (DataSourceBase ds in DSList) { if (DSName == null) { string[] Token = ValueExp.Split(new[] { "{DS Name=", " " }, StringSplitOptions.None); DSName = Token[1]; } if (ds.Name == DSName) { DataSource = ds; } } if (DataSource.DSType == DataSourceBase.eDSType.LiteDataBase) { GingerCoreNET.DataSource.GingerLiteDB liteDB = new GingerCoreNET.DataSource.GingerLiteDB(); string Query = ValueExp.Substring(ValueExp.IndexOf("QUERY=") + 6, ValueExp.Length - (ValueExp.IndexOf("QUERY=") + 7)); liteDB.FileFullPath = WorkSpace.Instance.SolutionRepository.ConvertSolutionRelativePath(DataSource.FileFullPath); liteDB.Execute(this, Query); } else if (DataSource.DSType == DataSourceBase.eDSType.MSAccess) { switch (ControlAction) { case eControlAction.GetValue: ValueExpression VE = new ValueExpression(RunOnEnvironment, RunOnBusinessFlow, DSList); VE.Value = ValueExp; AddOrUpdateReturnParamActual("Output", VE.ValueCalculated); break; case eControlAction.SetValue: ValueExpression SVE = new ValueExpression(RunOnEnvironment, RunOnBusinessFlow, DSList); SVE.Value = this.Value; ValueExpression VEUpdate = new ValueExpression(RunOnEnvironment, RunOnBusinessFlow, DSList, true, SVE.ValueCalculated); VEUpdate.Value = ValueExp; outVal = VEUpdate.ValueCalculated; break; case eControlAction.MarkAsDone: ValueExpression VEMAD = new ValueExpression(RunOnEnvironment, RunOnBusinessFlow, DSList); VEMAD.Value = ValueExp; outVal = VEMAD.ValueCalculated; break; case eControlAction.RowCount: case eControlAction.AvailableRowCount: ValueExpression VERC = new ValueExpression(RunOnEnvironment, RunOnBusinessFlow, DSList); VERC.Value = ValueExp; AddOrUpdateReturnParamActual("Output", VERC.ValueCalculated); break; case eControlAction.ExportToExcel: ValueExpression EVE = new ValueExpression(RunOnEnvironment, RunOnBusinessFlow, DSList); EVE.Value = this.Value; ValueExpression ETERC = new ValueExpression(RunOnEnvironment, RunOnBusinessFlow, DSList, false, EVE.ValueCalculated); ETERC.Value = ValueExp; if (ETERC.ValueCalculated == "The Export Excel can be *.xlsx only") { this.Status = Amdocs.Ginger.CoreNET.Execution.eRunStatus.Failed; Error = "The Export Excel can be *.xlsx only"; } else { outVal = ETERC.ValueCalculated; } break; case eControlAction.DeleteRow: ValueExpression veDel = new ValueExpression(RunOnEnvironment, RunOnBusinessFlow, DSList); veDel.Value = ValueExp; outVal = veDel.ValueCalculated; int rowCount = 0; if (!string.IsNullOrEmpty(outVal) && !int.TryParse(outVal, out rowCount)) { this.Status = Amdocs.Ginger.CoreNET.Execution.eRunStatus.Failed; Error = outVal; } break; default: ValueExpression VEDR = new ValueExpression(RunOnEnvironment, RunOnBusinessFlow, DSList); VEDR.Value = ValueExp; outVal = VEDR.ValueCalculated; break; } } return; }
public void ListChildItems(ValueNode node) { if (node != null && node.Nodes.Count == 0 && node.PlayerValue != null) { FlashInterface flashInterface = PluginMain.debugManager.FlashInterface; List <VariableNode> nodes = new List <VariableNode>(); List <VariableNode> inherited = new List <VariableNode>(); List <VariableNode> statics = new List <VariableNode>(); int tmpLimit = node.ChildrenShowLimit; foreach (Variable member in node.PlayerValue.getMembers(flashInterface.Session)) { VariableNode memberNode = new VariableNode(member) { HideClassId = PluginMain.settingObject.HideClassIds, HideFullClasspath = PluginMain.settingObject.HideFullClasspaths }; if (member.isAttributeSet(VariableAttribute_.IS_STATIC)) { statics.Add(memberNode); } else if (member.getLevel() > 0) { inherited.Add(memberNode); } else { nodes.Add(memberNode); } } // inherited vars if (inherited.Count > 0) { if (PluginMain.settingObject.CombineInherited) { // list inherited alongside main class members foreach (DataNode item in inherited) { node.Nodes.Add(item); } } else { // list inherited in a [inherited] group ValueNode inheritedNode = new ValueNode("[inherited]"); inherited.Sort(); foreach (DataNode item in inherited) { inheritedNode.Nodes.Add(item); } node.Nodes.Add(inheritedNode); } } // static vars if (!PluginMain.settingObject.HideStaticMembers && statics.Count > 0) { DataNode staticNode = new ValueNode("[static]"); statics.Sort(); foreach (DataNode item in statics) { staticNode.Nodes.Add(item); } node.Nodes.Add(staticNode); } // test children foreach (String ch in node.PlayerValue.getClassHierarchy(false)) { if (ch.Equals("flash.display::DisplayObjectContainer")) { double numChildren = ((java.lang.Double)node.PlayerValue.getMemberNamed(flashInterface.Session, "numChildren").getValue().getValueAsObject()).doubleValue(); DataNode childrenNode = new ValueNode("[children]"); for (int i = 0; i < numChildren; i++) { try { IASTBuilder b = new ASTBuilder(false); string cmd = node.GetVariablePath() + ".getChildAt(" + i + ")"; ValueExp exp = b.parse(new java.io.StringReader(cmd)); var ctx = new ExpressionContext(flashInterface.Session, flashInterface.GetFrames()[PluginMain.debugManager.CurrentFrame]); var obj = exp.evaluate(ctx); if (obj is flash.tools.debugger.concrete.DValue) { obj = new flash.tools.debugger.concrete.DVariable("getChildAt(" + i + ")", (flash.tools.debugger.concrete.DValue)obj, ((flash.tools.debugger.concrete.DValue)obj).getIsolateId()); } DataNode childNode = new VariableNode((Variable)obj) { HideClassId = PluginMain.settingObject.HideClassIds, HideFullClasspath = PluginMain.settingObject.HideFullClasspaths }; childNode.Text = "child_" + i; childrenNode.Nodes.Add(childNode); } catch (Exception) { } } node.Nodes.Add(childrenNode); } else if (ch.Equals("flash.events::EventDispatcher")) { Variable list = node.PlayerValue.getMemberNamed(flashInterface.Session, "listeners"); var omg = list.getName(); /* * double numChildren = ((java.lang.Double)node.Variable.getValue().getMemberNamed(flashInterface.Session, "numChildren").getValue().getValueAsObject()).doubleValue(); * DataNode childrenNode = new DataNode("[children]"); * for (int i = 0; i < numChildren; i++) * { * try * { * * IASTBuilder b = new ASTBuilder(false); * string cmd = GetVariablePath(node) + ".getChildAt(" + i + ")"; * ValueExp exp = b.parse(new java.io.StringReader(cmd)); * var ctx = new ExpressionContext(flashInterface.Session, flashInterface.Session.getFrames()[PluginMain.debugManager.CurrentFrame]); * var obj = exp.evaluate(ctx); * if (obj is flash.tools.debugger.concrete.DValue) obj = new flash.tools.debugger.concrete.DVariable("child_" + i, (flash.tools.debugger.concrete.DValue)obj); * DataNode childNode = new DataNode((Variable)obj); * childrenNode.Nodes.Add(childNode); * } * catch (Exception) { } * } * node.Nodes.Add(childrenNode); */ } } //test children nodes.Sort(); // add child items _tree.BeginUpdate(); foreach (DataNode item in nodes) { if (0 == tmpLimit--) { break; } node.Nodes.Add(item); } if (tmpLimit == -1) { DataNode moreNode = new ContinuedDataNode(); node.Nodes.Add(moreNode); } _tree.EndUpdate(); } }
internal virtual Object evalExpression(ValueExp expr, bool displayExceptions) { /* now we go off and evaluate the expression */ Object result = null; try { result = m_exprCache.evaluate(expr); } catch (NoSuchVariableException nsv) { if (displayExceptions) { System.Collections.IDictionary args = new System.Collections.Hashtable(); args["variable"] = nsv.Message; //$NON-NLS-1$ err(LocalizationManager.getLocalizedTextString("variableUnknown", args)); //$NON-NLS-1$ } } catch (FormatException nfe) { if (displayExceptions) { System.Collections.IDictionary args = new System.Collections.Hashtable(); args["value"] = nfe.Message; //$NON-NLS-1$ err(LocalizationManager.getLocalizedTextString("couldNotConvertToNumber", args)); //$NON-NLS-1$ } } catch (PlayerFaultException pfe) { if (displayExceptions) { err(pfe.Message); } } // NullPointerException if parse failed and expr is null (we should really have some more info for the user! if (result == null) throw new NullReferenceException(); return result; }
public virtual bool Accepts(ValueExp exp) { return(false); }