Examples of Rule


Examples of org.antlr.tool.Rule

                    continue;
                }

                Grammar g = discoveredLexerGrammar;
                if(g != null) {
                    Rule r = g.getRule(Grammar.ARTIFICIAL_TOKENS_RULENAME);
                    NFAState s = (NFAState)r.startState.transition(0).target;
                    if(s == null) {
                        System.err.println("NFAState s is null for rule "+r.name);
                        continue;
                    }
View Full Code Here

Examples of org.antlr.v4.tool.Rule

  /* start->ruleblock->end */
  @NotNull
  @Override
  public Handle rule(@NotNull GrammarAST ruleAST, @NotNull String name, @NotNull Handle blk) {
    Rule r = g.getRule(name);
    RuleStartState start = atn.ruleToStartState[r.index];
    epsilon(start, blk.left);
    RuleStopState stop = atn.ruleToStopState[r.index];
    epsilon(blk.right, stop);
    Handle h = new Handle(start, stop);
View Full Code Here

Examples of org.apache.commons.digester.Rule

     * working.
     */
    private void addOldArgRules(Digester digester) {

        // Create a new rule to process args elements
        Rule rule = new Rule() {
            public void begin(String namespace, String name,
                               Attributes attributes) throws Exception {
                // Create the Arg
                Arg arg = new Arg();
                arg.setKey(attributes.getValue("key"));
View Full Code Here

Examples of org.apache.commons.digester3.Rule

            String segment = currTextSegment.toString();
            List<Rule> parentMatches = getMatches().peek();
            int len = parentMatches.size();
            for ( int i = 0; i < len; ++i )
            {
                Rule r = parentMatches.get( i );
                if ( r instanceof TextSegmentHandler )
                {
                    TextSegmentHandler h = (TextSegmentHandler) r;
                    try
                    {
View Full Code Here

Examples of org.apache.fulcrum.intake.xmlmodel.Rule

                        + "InitableByConstraintMap");
            }
        }

        // field may have been declared as always required in the xml spec
        Rule reqRule = (Rule) field.getRuleMap().get("required");
        if (reqRule != null)
        {
            alwaysRequired = Boolean.valueOf(reqRule.getValue()).booleanValue();
            ifRequiredMessage = reqRule.getMessage();
        }

        Rule maxLengthRule = (Rule) field.getRuleMap().get("maxLength");
        if (maxLengthRule != null)
        {
            maxSize = maxLengthRule.getValue();
        }

        // map the getter and setter methods
        mapToObject = field.getMapToObject();
        String propName = field.getMapToProperty();
View Full Code Here

Examples of org.apache.hivemind.schema.Rule

    {
        Element rules = _document.createElement("rules");

        for (Iterator i = em.getRules().iterator(); i.hasNext();)
        {
            Rule r = (Rule) i.next();

            Element rule = null;

            if (r instanceof CreateObjectRule)
            {
                CreateObjectRule cor = (CreateObjectRule) r;
                rule = _document.createElement("create-object");

                rule.setAttribute("class", cor.getClassName());
            }
            else if (r instanceof InvokeParentRule)
            {
                InvokeParentRule ipr = (InvokeParentRule) r;
                rule = _document.createElement("invoke-parent");

                rule.setAttribute("method", ipr.getMethodName());
                if (ipr.getDepth() != 1)
                    rule.setAttribute("depth", Integer.toString(ipr.getDepth()));
            }
            else if (r instanceof PushAttributeRule)
            {
                PushAttributeRule par = (PushAttributeRule) r;
                rule = _document.createElement("push-attribute");

                rule.setAttribute("attribute", par.getAttributeName());
            }
            else if (r instanceof PushContentRule)
            {             
                rule = _document.createElement("push-content");
            }
            else if (r instanceof ReadAttributeRule)
            {
                ReadAttributeRule rar = (ReadAttributeRule) r;
                rule = _document.createElement("read-attribute");

                rule.setAttribute("property", rar.getPropertyName());
                rule.setAttribute("attribute", rar.getAttributeName());
                if (!rar.getSkipIfNull())
                    rule.setAttribute("skip-if-null", "false");
                if (rar.getTranslator() != null)
                    rule.setAttribute("translator", rar.getTranslator());
            }
            else if (r instanceof ReadContentRule)
            {
                ReadContentRule rcr = (ReadContentRule) r;
                rule = _document.createElement("read-content");

                rule.setAttribute("property", rcr.getPropertyName());
            }
            else if (r instanceof SetModuleRule)
            {
                SetModuleRule smr = (SetModuleRule) r;
                rule = _document.createElement("set-module");

                rule.setAttribute("property", smr.getPropertyName());
            }
            else if (r instanceof SetParentRule)
            {
                SetParentRule spr = (SetParentRule) r;
                rule = _document.createElement("set-parent");

                rule.setAttribute("property", spr.getPropertyName());
            }
            else if (r instanceof SetPropertyRule)
            {
                SetPropertyRule spr = (SetPropertyRule) r;
                rule = _document.createElement("set-property");

                rule.setAttribute("property", spr.getPropertyName());
                rule.setAttribute("value", spr.getValue());
            }
            else if (r instanceof ConversionDescriptor)
            {
                ConversionDescriptor cd = (ConversionDescriptor) r;
                rule = _document.createElement("conversion");

                rule.setAttribute("class", cd.getClassName());
                if (!cd.getParentMethodName().equals("addElement"))
                    rule.setAttribute("parent-method", cd.getParentMethodName());

                for (Iterator j = cd.getAttributeMappings().iterator(); j.hasNext();)
                {
                    AttributeMappingDescriptor amd = (AttributeMappingDescriptor) j.next();

                    Element map = _document.createElement("map");

                    map.setAttribute("attribute", amd.getAttributeName());
                    map.setAttribute("property", amd.getPropertyName());

                    rule.appendChild(map);
                }
            }
            else
            {
                rule = _document.createElement("custom");

                rule.setAttribute("class", r.getClass().getName());
            }

            if (rule != null)
                rules.appendChild(rule);
        }
View Full Code Here

Examples of org.apache.jetspeed.rewriter.rules.Rule

    {
        ruleMap.clear();
        Iterator it = rules.iterator();
        while (it.hasNext())                   
        {
            Rule rule = (Rule)it.next();
            ruleMap.put(rule.getId(), rule);           
        }    
              
        tagMap.clear();       
        it = tags.iterator();
        while (it.hasNext())                   
        {
            Tag tag = (Tag)it.next();
            tagMap.put(tag.getId(), tag);
            Iterator attributes = tag.getAttributes().iterator();
            while (attributes.hasNext())
            {               
                Attribute attribute = (Attribute)attributes.next();               
                if (attribute instanceof AttributeImpl)
                {
                    String ruleId = ((AttributeImpl)attribute).getRuleId();                   
                    Rule rule = (Rule)ruleMap.get(ruleId);                   
                    if (rule != null)
                    {
                        attribute.setRule(rule);
                    }
                }                           
View Full Code Here

Examples of org.apache.log4j.rule.Rule

  public void createCustomExpressionLogPanel(String ident) {
    //collect events matching the rule from all of the tabs
    try {
      List list = new ArrayList();
      Rule rule = ExpressionRule.getRule(ident);
      Iterator iter = identifierPanels.iterator();

      while (iter.hasNext()) {
        LogPanel panel = (LogPanel) iter.next();
        Iterator iter2 = panel.getMatchingEvents(rule).iterator();
View Full Code Here

Examples of org.apache.marmotta.kiwi.reasoner.model.program.Rule

                }
            }
            result.append("    ],");
            result.append("    \"rules\": [\n");
            for(Iterator<Rule> it = justification.getSupportingRules().iterator(); it.hasNext(); ) {
                Rule r = it.next();
                result.append("      \""+r.toString().replace("\"","'")+"\"");
                if(it.hasNext()) {
                    result.append(",\n");
                } else {
                    result.append("\n");
                }
View Full Code Here

Examples of org.apache.pig.experimental.plan.optimizer.Rule

    }
   
    public void testFilterRule() throws Exception  {
        prep();
        // run split filter rule
        Rule r = new SplitFilter("SplitFilter");
        Set<Rule> s = new HashSet<Rule>();
        s.add(r);
        List<Set<Rule>> ls = new ArrayList<Set<Rule>>();
        ls.add(s);
        MyPlanOptimizer optimizer = new MyPlanOptimizer(plan, ls, 3);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.