public override string toString() { if (this.rules.size() == 0) { return("<NULL>"); } StringBuilder stringBuilder = new StringBuilder(); for (int i = 0; i < this.rules.size(); i++) { if (i > 0) { stringBuilder.append(' '); } JSGFRule jsgfrule = (JSGFRule)this.rules.get(i); if (jsgfrule is JSGFRuleAlternatives || jsgfrule is JSGFRuleSequence) { stringBuilder.append("( ").append(jsgfrule).append(" )"); } else { stringBuilder.append(jsgfrule); } } return(stringBuilder.toString()); }
public override string toString() { if (this.rules == null || this.rules.size() == 0) { return("<VOID>"); } StringBuilder stringBuilder = new StringBuilder(); for (int i = 0; i < this.rules.size(); i++) { if (i > 0) { stringBuilder.append(" | "); } if (this.weights != null) { stringBuilder.append(new StringBuilder().append("/").append(this.weights.get(i)).append("/ ").toString()); } JSGFRule jsgfrule = (JSGFRule)this.rules.get(i); if (this.rules.get(i) is JSGFRuleAlternatives) { stringBuilder.append("( ").append(jsgfrule).append(" )"); } else { stringBuilder.append(jsgfrule); } } return(stringBuilder.toString()); }
public virtual void append(JSGFRule rule) { if (this.rules == null) { string text = "null rule to append"; throw new NullPointerException(text); } this.rules.add(rule); }
public virtual void append(JSGFRule rule) { if (!JSGFRuleAlternatives.assertionsDisabled && rule == null) { throw new AssertionError(); } this.rules.add(rule); if (this.weights != null) { this.weights.add(Float.valueOf(1f)); } }
public virtual void setRule(JSGFRule rule) { this.rule = rule; }
public JSGFRuleTag(JSGFRule rule, string tag) { this.setRule(rule); this.setTag(tag); }
public JSGFRuleCount(JSGFRule rule, int count) { this.setRule(rule); this.setCount(count); }