Ejemplo n.º 1
0
        public override bool ProtectedIsAcceptedUsingOracle(CstNode node)
        {
            var pName = node.SafeParent().FirstChild.Name;

            if (pName == "If")
            {
                return(true);
            }
            if (pName == "While")
            {
                return(true);
            }
            if (pName == "Do")
            {
                return(true);
            }
            if (node.SafeParent().Name == "commaList" &&
                node.SafeParent().SafeParent().Name == "forCondition" &&
                !node.NextsFromSelf().Any())
            {
                return(true);
            }
            if (node.SafeParent().Name == "commaList" &&
                node.SafeParent().SafeParent().Name == "simpleStatement" &&
                node.SafeParent().SafeParent().FirstChild.Name == "Echo" &&
                node.Prev == null)
            {
                return(true);
            }
            return(false);
        }
Ejemplo n.º 2
0
 public override bool ProtectedIsAcceptedUsingOracle(CstNode node)
 {
     if (node.SafeParent().Name == "commaList" &&
         node.SafeParent().SafeParent().Name == "forCondition" &&
         !node.NextsFromSelf().Any())
     {
         return(true);
     }
     return(false);
 }
Ejemplo n.º 3
0
 public override bool ProtectedIsAcceptedUsingOracle(CstNode node) {
     var pName = node.SafeParent().FirstChild.Name;
     if (pName == "If") {
         return node.TokenText.ToLower() != "true";
     }
     if (pName == "While") {
         return node.TokenText.ToLower() != "true";
     }
     if (pName == "Do") {
         return node.TokenText.ToLower() != "true";
     }
     if (pName == "Switch") {
         return true;
     }
     if (node.Name == "casestatement" || node.Name == "defaultcase") {
         return true;
     }
     if (node.SafeParent().Name == "commaList"
         && node.SafeParent().SafeParent().Name == "forCondition"
         && !node.NextsFromSelf().Any()) {
         return node.TokenText.ToLower() != "true";
     }
     if (node.SafeParent().Name == "commaList"
         && node.SafeParent().SafeParent().Name == "simpleStatement"
         && node.SafeParent().SafeParent().FirstChild.Name == "Echo"
         && node.Prev == null) {
         return node.TokenText.ToLower() != "true";
     }
     return false;
 }
Ejemplo n.º 4
0
 public override bool ProtectedIsAcceptedUsingOracle(CstNode node) {
     if (node.SafeParent().Name == "commaList"
         && node.SafeParent().SafeParent().Name == "forCondition"
         && !node.NextsFromSelf().Any()) {
         return true;
     }
     return false;
 }