Package apg

Class UdtLib.Comment

  • Direct Known Subclasses:
    UdtLib.CppComment, UdtLib.SemiComment
    Enclosing class:
    UdtLib

    public static class UdtLib.Comment
    extends Parser.UdtCallback
    UDT for many common comment formats. Comments are defined by one or two leading characters and the comment will include all following characters up to but not including the next line end character (x0A or x0D)
    • Constructor Summary

      Constructors 
      Constructor Description
      Comment​(Parser parser, char begin)
      Constructor for a comment beginning with a single character.
      Comment​(Parser parser, char begin1, char begin2)
      Constructor for a comment beginning with a pair of characters
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int callback​(int offset)
      The UDT function.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Comment

        public Comment​(Parser parser,
                       char begin)
        Constructor for a comment beginning with a single character.
        Parameters:
        parser - the Parser object this UDT is attached to.
        begin - the first character which defines the beginning of the comment.
      • Comment

        public Comment​(Parser parser,
                       char begin1,
                       char begin2)
        Constructor for a comment beginning with a pair of characters
        Parameters:
        parser - the Parser object this UDT is attached to.
        begin1 - the first character of the beginning pair.
        begin2 - the second character of the beginning pair.
    • Method Detail

      • callback

        public int callback​(int offset)
        Description copied from class: Parser.UdtCallback
        The UDT function.
        Specified by:
        callback in class Parser.UdtCallback
        Parameters:
        offset - offset into the input string to the first character of the parsed phrase.
        Returns:
        the matched phrase length, L, or -1 if no phrase was matched. The phrase length must be in the range 0 <= L <=(n-1), where n is the remaining number of characters in the input string.