Retrieve the instructions for the rule.
486885
def instructions(self):
        

        if self._instructions is None:
            # Compile the rule into an Instructions instance; we do
            # this lazily to amortize the cost of the compilation,
            # then cache that result for efficiency...
            self._instructions = parser.parse_rule(self.name, self.text)

        return self._instructions
829802
def on_rule(self, *args):
        """"""
        if self.rule is None:
            return
        self.rule.connect(self._listen_to_rule)
531361
public function getRule(){
        $returnValue = (string) '';

        foreach($this->components as $irp){
            $returnValue .= $irp->getRule();
        }
        foreach($this->getCompositionRules() as $rule){
            $returnValue .= $rule->getRule();
        }

        return (string) $returnValue;
    }
324139
public String gaRuleAccessMethodName(final AbstractRule rule) {
    String _gaRuleIdentifyer = this.gaRuleIdentifyer(rule);
    String _plus = ("get" + _gaRuleIdentifyer);
    return (_plus + "Rule");
  }
746104
public static String getRuleName(AbstractRule rule) {
		return org.eclipse.xtext.xtext.generator.parser.antlr.AntlrGrammarGenUtil.getRuleName(rule);
	}
923063
function getRuleReplacementMessage(ruleId) {
		if (ruleId in replacements.rules) {
			var newRules = replacements.rules[ruleId];

			return "Rule \'" + ruleId + "\' was removed and replaced by: " + newRules.join(", ");
		}

		return null;
	}
49151
def get_any_nt_unit_rule(g):
    """"""
    for rule in g.rules:
        if len(rule.rhs) == 1 and isinstance(rule.rhs[0], NT):
            return rule
    return None
506151
private void extractInstructions(InstructionGroup group) {
        for (InstructionGraphNode node : group.getNodes()) {
            if (node != group.getRoot()) {
                AbstractInsnNode insn = node.getInstruction();
                method.instructions.remove(insn);
                group.getInstructions().add(insn);
            }
        }
    }
604984
def _get_rule_cmds(self, sg_id, sg_rule, delete=False):
        """"""
        rule_prefix = ""
        if delete:
            rule_prefix = "no "
        in_rules, eg_rules = self._format_rules_for_eos([sg_rule])
        cmds = []
        if in_rules:
            cmds.append("ip access-list %s dynamic" %
                        self._acl_name(sg_id, n_const.INGRESS_DIRECTION))
            for in_rule in in_rules:
                cmds.append(rule_prefix + in_rule)
            cmds.append("exit")
        if eg_rules:
            cmds.append("ip access-list %s dynamic" %
                        self._acl_name(sg_id, n_const.EGRESS_DIRECTION))
            for eg_rule in eg_rules:
                cmds.append(rule_prefix + eg_rule)
            cmds.append("exit")
        return cmds
861674
private List<Object> getRuleInstances(Object testInstance) throws Exception {
        List<Object> ruleInstances = new ArrayList<Object>();

        List<Field> fieldsWithRuleAnnotation =
            SecurityActions.getFieldsWithAnnotation(testInstance.getClass(), Rule.class);
        if (fieldsWithRuleAnnotation.isEmpty()) {
            List<Method> methodsWithAnnotation =
                SecurityActions.getMethodsWithAnnotation(testInstance.getClass(), Rule.class);
            if (methodsWithAnnotation.isEmpty()) {
                // there isn't any rule in the test class
                return null;
            } else {
                log.warning("Please note that methods annotated with @Rule are not fully supported in Arquillian. "
                    + "Specifically, if you want to enrich a field in your Rule implementation class.");

                return ruleInstances;
            }
        } else {
            for (Field field : fieldsWithRuleAnnotation) {
                Object fieldInstance = field.get(testInstance);
                if (isRule(fieldInstance)) {
                    ruleInstances.add(fieldInstance);
                }
            }
        }
        return ruleInstances;
    }
1175039
protected function getRules()
    {
        if ($this->compiledRules === null) {
            $rules = array();
            foreach ($this->ruleFiles as $file) {
                $rules = array_merge(
                    $rules,
                    $this->parser->parse($file)
                );
            }

            $this->compiledRules = $this->compiler->compile($rules);
        }

        return $this->compiledRules;
    }
1296301
protected void getSAXRules() {

    arrRuleRecords.clear();

    Vector<SAXRule> rules = new Vector<SAXRule>(numRules.intValue());
    rules.addElement(this);

    SAXRule currentRule;

    int processedRules = 0;

    StringBuilder sbCurrentRule = new StringBuilder();

    while (processedRules < rules.size()) {

      currentRule = rules.elementAt(processedRules);

      for (SAXSymbol sym = currentRule.first(); (!sym.isGuard()); sym = sym.n) {
        if (sym.isNonTerminal()) {
          SAXRule referedTo = ((SAXNonTerminal) sym).r;
          if ((rules.size() > referedTo.index) && (rules.elementAt(referedTo.index) == referedTo)) {
            index = referedTo.index;
          }
          else {
            index = rules.size();
            referedTo.index = index;
            rules.addElement(referedTo);
          }
          sbCurrentRule.append('R');
          sbCurrentRule.append(index);
        }
        else {
          sbCurrentRule.append(sym.value);
        }
        sbCurrentRule.append(' ');
      }

      GrammarRuleRecord ruleConteiner = new GrammarRuleRecord();

      ruleConteiner.setRuleNumber(processedRules);
      ruleConteiner.setRuleString(sbCurrentRule.toString());

      ruleConteiner.setRuleLevel(currentRule.getLevel());

      ruleConteiner.setRuleUseFrequency(currentRule.count);
      ruleConteiner.setOccurrences(currentRule.getIndexes());

      arrRuleRecords.add(ruleConteiner);

      sbCurrentRule = new StringBuilder();
      processedRules++;
    }

  }
1242538
def get(self, sched_rule_id):
        """"""
        path = '/'.join(['schedulerule', sched_rule_id])
        return self.rachio.get(path)
148042
def _extract_methods(self):
        """"""
        service = self._service
        all_urls = set()
        urls_with_options = set()
        if not service.http:
            return
        for rule in service.http.rules:
            http_method, url = _detect_pattern_option(rule)
            if not url or not http_method or not rule.selector:
                _logger.error(u'invalid HTTP binding encountered')
                continue

            # Obtain the method info
            method_info = self._get_or_create_method_info(rule.selector)
            if rule.body:
                method_info.body_field_path = rule.body
            if not self._register(http_method, url, method_info):
                continue  # detected an invalid url
            all_urls.add(url)

            if http_method == self._OPTIONS:
                urls_with_options.add(url)

        self._add_cors_options_selectors(all_urls - urls_with_options)
        self._update_usage()
        self._update_system_parameters()
1197009
private String getRuleName(RulesTextProvider textProvider)
    {
		if (!quotedString('"',textProvider))
		{
			return "R"+(textProvider.incrementRuleCount());
		}
    	return textProvider.getLastToken();
    }
928476
def show(self):
        """"""
        for rule in self.rules_list:
            result = ", ".join([str(check) for check, deny in rule])
            print(result)
541106
def _rule_block(self):
        

        name = self._get_token(self.RE_NAME)
        self._expect_token('{')

        # consume additional options if available
        options = []
        while self._lookahead_token() != '}':
            options.append(self._rule_option())

        self._expect_token('}')
        return [name, options]