classes/phing/filters/StripPhpComments.php

\StripPhpComments

This is a Php comment and string stripper reader that filters those lexical tokens out for purposes of simple Php parsing.

(if you have more complex Php parsing needs, use a real lexer). Since this class heavily relies on the single char read function, you are reccomended to make it work on top of a buffered reader.

Extends from
\BaseFilterReader
Implements
\ChainableReader
see
\FilterReader
access
public
author
Yannick Lecaillez
author
hans lellelid, hans@velum.net
package
phing.filters
version
$Revision: 526 $ $Date: 2009-08-11 14:11:17 +0200 (Tue, 11 Aug 2009) $

Properties

Propertyprivateboolean  $_inString= 'false'

Whether or not the parser is currently in the middle of a string literal.

Default valuefalseDetails
Type
boolean
Propertyprivate  $_readAheadCh= ''

The read-ahead character, used for effectively pushing a single character back. -1 indicates that no character is in the buffer.

Details
Type

Methods

methodpublic  chain( \reader $reader ) : \a
Creates a new StripPhpComments using the passed in Reader for instantiation.
Parameters
Name Type Description
$reader \reader

A Reader object providing the underlying stream. Must not be null.

Returns
Type Description
\a
methodpublic  read(  $len = null ) : \the
Returns the stream without Php comments.
Parameters
Name Type Description
$len
Returns
Type Description
\the
Details
throws
if the underlying stream throws an IOException during reading
methodpublic  readChar( ) :
Documentation was generated by DocBlox 0.13.1.