None of these isAdhoc flags are needed. Instead of looking to this flag to detect a parameterized limit or offset, take a closer look at the "value" node to see if it was the result of parameterization. Parameterization conveniently marks its results with:

            node.attributes.put("isparam", "true");
            node.attributes.put("isplannergenerated", "true");