Class PegWordRule

  • All Implemented Interfaces:
    PegRule<String>

    public final class PegWordRule
    extends Object
    implements PegRule<String>
    Règle a état permettant de récupérer un mot. En précisant : - Soit les caractères acceptés, - Soit les caractères rejetés.
    Author:
    pchretien
    • Method Detail

      • parse

        public PegResult<String> parse​(String text,
                                       int start)
                                throws PegNoMatchFoundException
        Parser produces an object

        or 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:
        parse in interface PegRule<String>
        Parameters:
        text - Text to parse
        start - Start of the element of text to parse
        Returns:
        the new index and the result
        Throws:
        PegNoMatchFoundException - if parsing has failed.