Пример #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);
        }
Пример #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);
        }
Пример #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;
 }
Пример #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;
 }