Ejemplo n.º 1
0
        public void Analyze(Function f)
        {
            bool changes = true;

            while (changes)
            {
                changes = false;
                for (int i = 0; i < f.Instructions.Count - 5; i++)
                {
                    if (f.Instructions[i] is Assignment a && a.Left.Count == 1 &&
                        f.Instructions[i + 1] is Jump {
                        Conditional: true
                    } j&&
                        f.Instructions[i + 2] is Assignment a2 && a2.Left.Count == 1 &&
                        f.Instructions[i + 3] is Label l && l == j.Dest)
                    {
                        IdentifierReference ir   = null;
                        BinOperationType    type = BinOperationType.None;
                        if (j.Condition is UnaryOp uo && uo.OperationType == UnOperationType.OpNot &&
                            uo.Expression is IdentifierReference ir2)
                        {
                            ir   = ir2;
                            type = BinOperationType.OpOr;
                        }
Ejemplo n.º 2
0
 public BinOp(IExpression left, IExpression right, BinOperationType op)
 {
     Left          = left;
     Right         = right;
     OperationType = op;
 }