C# Class Pchp.Library.PerlRegex.RegexNode

ファイルを表示 Open project: iolevel/peachpie Class Usage Examples

Private Methods

Method Description
AddChild ( RegexNode newChild ) : void
Child ( int i ) : RegexNode
ChildCount ( ) : int
Description ( ) : string
Dump ( ) : void
MakeQuantifier ( bool lazy, int min, int max ) : RegexNode
MakeRep ( int type, int min, int max ) : void

Pass type as OneLazy or OneLoop

Reduce ( ) : RegexNode

Removes redundant nodes from the subtree, and returns a reduced subtree.

ReduceAlternation ( ) : RegexNode

Basic optimization. Single-letter alternations can be replaced by faster set specifications, and nested alternations with no intervening operators can be flattened: a|b|c|def|g|h -> [a-c]|def|[gh] apple|(?:orange|pear)|grape -> apple|orange|pear|grape

ReduceConcatenation ( ) : RegexNode

Basic optimization. Adjacent strings can be concatenated. (?:abc)(?:def) -> abcdef

ReduceGroup ( ) : RegexNode

Simple optimization. Once parsed into a tree, non-capturing groups serve no function, so strip them out.

ReduceRep ( ) : RegexNode

Nested repeaters just get multiplied with each other if they're not too lumpy

ReduceSet ( ) : RegexNode

Simple optimization. If a set is a singleton, an inverse singleton, or empty, it's transformed accordingly.

RegexNode ( int type, RegexOptions options ) : System
RegexNode ( int type, RegexOptions options, char ch ) : System
RegexNode ( int type, RegexOptions options, int m ) : System
RegexNode ( int type, RegexOptions options, int m, int n ) : System
RegexNode ( int type, RegexOptions options, string str ) : System
ReverseLeft ( ) : RegexNode
StripEnation ( int emptyType ) : RegexNode

Simple optimization. If a concatenation or alternation has only one child strip out the intermediate node. If it has zero children, turn it into an empty.

Type ( ) : int
UseOptionR ( ) : bool