Class ParseRule
java.lang.Object
com.inductiveautomation.snap.parse.ParseRule
- All Implemented Interfaces:
- Cloneable
- Direct Known Subclasses:
- JAnnotationParseRule,- JExprParseRule,- JFileParseRule,- JLiteralParseRule,- JStmtParseRule
A class to represent a parse rule.
- 
Nested Class SummaryNested Classes
- 
Constructor SummaryConstructorsConstructorDescriptionCreates a new parse rule.Creates a new parse rule for given nameParseRule(String aName, ParseHandler aHandler) Creates a new parse rule for given name and handler.Creates a new parse rule for given nameCreates a new parse rule for given name
- 
Method SummaryModifier and TypeMethodDescriptionaddLookAhead(int aCount) Adds a look ahead rule with given operator and count.addLookAhead(ParseRule aRule) Adds a look ahead rule with given operator.addLookAhead(ParseRule.Op anOp, int aCount) Adds a look ahead rule with given operator and count.addLookAhead(ParseRule.Op anOp, ParseRule aRule) Adds a look ahead rule with given operator.Adds a child rule.addRule(ParseRule.Count aCount, ParseRule aRule) Adds a child rule.addRule(ParseRule.Count aCount, String aPattern) Adds a rule for pattern.addRule(ParseRule.Count aCount, String aName, String aPattern) Adds a rule for name and pattern.addRule(ParseRule.Op anOp, ParseRule aRule) Adds a child rule.addRule(ParseRule.Op anOp, ParseRule.Count aCount, ParseRule aRule) Adds a child rule.addRule(ParseRule.Op anOp, ParseRule.Count aCount, ParseRule aRule, int anIndex) Adds a child rule.addRule(ParseRule.Op anOp, ParseRule.Count aCount, String aPattern) Adds a rule for pattern.addRule(ParseRule.Op anOp, ParseRule.Count aCount, String aName, String aPattern) Adds a rule for name and pattern.addRule(ParseRule.Op anOp, String aPattern) Adds a rule for pattern.addRule(ParseRule.Op anOp, String aName, String aPattern) Adds a rule for name and pattern.Adds a rule for pattern.Adds a rule for name and pattern.voidAdds child rules.clone()Standard clone implementation.Returns the handler for this rule.intReturns the look ahead count.getName()Returns rule name.Returns the rule pattern if simple pattern.Returns the pattern compiled.intReturns pattern compile flags.getRule(int anIndex) Returns the individual rule at index.intReturns the number of rules.getRuleCount(int anIndex) Returns the individual rule count at index.getRuleCount(int aPathIndex, int aRuleIndex) Returns the rule count for a given rule path and index in that rule path.Returns the rule counts list.getRuleOp(int anIndex) Returns the individual rule op at index.Returns the rule ops list.getRulePath(int anIndex) Returns the individual rule path at given index.intReturns the number of rule paths.Returns the rule paths.getRules()Returns the child rules.booleanReturns whether rule is anonymous - true if rule has no name and no pattern.booleanReturns whether pattern is literal.booleanReturns whether rule is look ahead.removeRule(int anIndex) Removes a child rule.intremoveRule(ParseRule aRule) Removes a child rule.voidsetHandler(ParseHandler aHandler) Sets the handler for this rule.setLiteral(boolean aFlag) Sets whether pattern is literal.setLookAhead(int aValue) Sets the look ahead count.voidSets rule name.setPattern(String anPattern) Sets the rule pattern if simple pattern.toString()Returns a string representation.
- 
Constructor Details- 
ParseRulepublic ParseRule()Creates a new parse rule.
- 
ParseRuleCreates a new parse rule for given name
- 
ParseRuleCreates a new parse rule for given name
- 
ParseRuleCreates a new parse rule for given name
- 
ParseRuleCreates a new parse rule for given name and handler.
 
- 
- 
Method Details- 
getNameReturns rule name.
- 
setNameSets rule name.
- 
getPatternReturns the rule pattern if simple pattern.
- 
setPatternSets the rule pattern if simple pattern.
- 
isLiteralpublic boolean isLiteral()Returns whether pattern is literal.
- 
setLiteralSets whether pattern is literal.
- 
getPatternCompiledReturns the pattern compiled.
- 
getPatternCompileFlagspublic int getPatternCompileFlags()Returns pattern compile flags.
- 
isAnonymouspublic boolean isAnonymous()Returns whether rule is anonymous - true if rule has no name and no pattern.
- 
getHandlerReturns the handler for this rule.
- 
setHandlerSets the handler for this rule.
- 
isLookAheadpublic boolean isLookAhead()Returns whether rule is look ahead.
- 
getLookAheadpublic int getLookAhead()Returns the look ahead count.
- 
setLookAheadSets the look ahead count.
- 
getRuleCountpublic int getRuleCount()Returns the number of rules.
- 
getRuleReturns the individual rule at index.
- 
getRuleOpReturns the individual rule op at index.
- 
getRuleCountReturns the individual rule count at index.
- 
getRulesReturns the child rules.
- 
getRuleOpsReturns the rule ops list.
- 
getRuleCountsReturns the rule counts list.
- 
addRuleAdds a child rule.
- 
addRuleAdds a child rule.
- 
addRuleAdds a child rule.
- 
addRuleAdds a child rule.
- 
addRuleAdds a child rule.
- 
removeRuleRemoves a child rule.
- 
removeRuleRemoves a child rule.
- 
addRuleAdds a rule for pattern.
- 
addRuleAdds a rule for pattern.
- 
addRuleAdds a rule for pattern.
- 
addRuleAdds a rule for pattern.
- 
addRuleAdds a rule for name and pattern.
- 
addRuleAdds a rule for name and pattern.
- 
addRuleAdds a rule for name and pattern.
- 
addRuleAdds a rule for name and pattern.
- 
addRulesAdds child rules.
- 
addLookAheadAdds a look ahead rule with given operator and count.
- 
addLookAheadAdds a look ahead rule with given operator and count.
- 
addLookAheadAdds a look ahead rule with given operator.
- 
addLookAheadAdds a look ahead rule with given operator.
- 
getRulePathCountpublic int getRulePathCount()Returns the number of rule paths.
- 
getRulePathReturns the individual rule path at given index.
- 
getRulePathsReturns the rule paths.
- 
getRuleCountReturns the rule count for a given rule path and index in that rule path.
- 
cloneStandard clone implementation.
- 
toStringReturns a string representation.
 
-