Ejemplo n.º 1
0
        public override bool ProtectedIsAcceptedUsingOracle(CstNode node)
        {
            var siblings = node.Siblings().ToList();
            var parent   = node.Parent;

            if (parent.SafeName() == "stat" && siblings[0].TokenText == "if")
            {
                return(node.TokenText != "true");
            }
            if (parent.SafeName() == "stat" && siblings[0].TokenText == "while")
            {
                return(node.TokenText != "true");
            }
            if (parent.SafeName() == "stat" && siblings[0].TokenText == "repeat")
            {
                return(node.TokenText != "true");
            }
            var ppp  = node.SafeParent().SafeParent().SafeParent();
            var pppp = ppp.SafeParent();

            if (pppp.SafeName() == "functioncall" && ppp.Prev != null &&
                ppp.Prev.TokenText == "print")
            {
                return(node.TokenText != "true");
            }
            return(false);
        }
Ejemplo n.º 2
0
        public override bool ProtectedIsAcceptedUsingOracle(CstNode node)
        {
            var siblings = node.Siblings().ToList();
            var parent   = node.Parent;

            if (parent.SafeName() == "stat" && siblings[0].TokenText == "repeat")
            {
                return(true);
            }
            return(false);
        }
Ejemplo n.º 3
0
 public override bool ProtectedIsAcceptedUsingOracle(CstNode node) {
     var siblings = node.Siblings().ToList();
     var parent = node.Parent;
     if (parent.SafeName() == "stat" && siblings[0].TokenText == "repeat") {
         return true;
     }
     return false;
 }
Ejemplo n.º 4
0
 public override bool ProtectedIsAcceptedUsingOracle(CstNode node) {
     var siblings = node.Siblings().ToList();
     var parent = node.Parent;
     if (parent.SafeName() == "stat" && siblings[0].TokenText == "if") {
         return node.TokenText != "true";
     }
     if (parent.SafeName() == "stat" && siblings[0].TokenText == "while") {
         return node.TokenText != "true";
     }
     if (parent.SafeName() == "stat" && siblings[0].TokenText == "repeat") {
         return node.TokenText != "true";
     }
     var ppp = node.SafeParent().SafeParent().SafeParent();
     var pppp = ppp.SafeParent();
     if (pppp.SafeName() == "functioncall" && ppp.Prev != null
         && ppp.Prev.TokenText == "print") {
         return node.TokenText != "true";
     }
     return false;
 }