public void DecompileBytecode(StatementList statements, TextBuilder result, bool createControlStatements) { var labelTableStatement = statements.Find(s => s.Token is LabelTableToken); var labelTable = (LabelTableToken)labelTableStatement?.Token; result.HasErrors = statements.HasErrors(); if (createControlStatements) { try { statements.CreateControlStatements(); } catch (Exception) { ProblemRegistry.RegisterIncompleteControlFlow(this); } if (statements.IsIncompleteControlFlow()) { ProblemRegistry.RegisterIncompleteControlFlow(this); } statements.RemoveRedundantReturns(); } statements.Print(result, labelTable, !createControlStatements); }
protected virtual void PrintChildren(TextBuilder result, LabelTableToken labelTable, bool showStartOffsets) { _children.Print(result, labelTable, showStartOffsets); }