Package io.vertigo.commons.peg.rule
Class PegAbstractRule<R,M>
java.lang.Object
io.vertigo.commons.peg.rule.PegAbstractRule<R,M>
- Type Parameters:
R- Type of the product text parsingM- Type of the parent parsing rule
- All Implemented Interfaces:
PegRule<R>
Une règle peut être vue comme
- la création d'une règle principale
- la gestion du résultat du parsing
- Author:
- pchretien
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.vertigo.commons.peg.rule.PegRule
PegRule.Dummy -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPegAbstractRule(PegRule<M> mainRule) protectedPegAbstractRule(PegRule<M> mainRule, String ruleName) -
Method Summary
-
Constructor Details
-
PegAbstractRule
-
PegAbstractRule
-
-
Method Details
-
getMainRule
-
getRuleName
-
getExpression
- Specified by:
getExpressionin interfacePegRule<R>- Returns:
- Expression de la règle.
-
handle
-
parse
Parser produces an objector throw an exception. A parser analyzes a text, according some rules. A parser is responsible for moving the index position or throw an exception. Returns the result of the parsing operation.
- Specified by:
parsein interfacePegRule<R>- Parameters:
text- Text to parsestart- Start of the element of text to parse- Returns:
- the new index and the result
- Throws:
PegNoMatchFoundException- if parsing has failed.
-