org.pz.platypus.parsers
Class BlockCommentParser

java.lang.Object
  extended by org.pz.platypus.parsers.BlockCommentParser

public class BlockCommentParser
extends java.lang.Object

Handles identification of block comments (and does some limited processing)

Author:
alb

Constructor Summary
BlockCommentParser()
           
 
Method Summary
 java.lang.String computeClosingMarker(char[] input, int startPoint)
          Computes the closing marker for a block comment based on the opening marker.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlockCommentParser

public BlockCommentParser()
Method Detail

computeClosingMarker

public java.lang.String computeClosingMarker(char[] input,
                                             int startPoint)
Computes the closing marker for a block comment based on the opening marker. This is needed because block comments can nest, so their opening and closing markers necessarily can be variable length. Specifically, the basic open/close marker pair are: [% and %]. But the number of % can be incremented to any amount, so long as the closing marker matches. So, [%%%% and %%%%] are a legal pair.

Parameters:
input - the text containing the opening marker
startPoint - where the opening marker begins
Returns:
a string containing the closing marker, or null if an error occurred.


Copyright © 2008-10 Pacific Data Works LLC