C# Class Pchp.Library.PerlRegex.RegexRunner

Mostra file Open project: iolevel/peachpie Class Usage Examples

Protected Properties

Property Type Description
runcrawl int[]
runcrawlpos int
runmatch Match
runregex Regex
runstack int[]
runstackpos int
runtext string
runtextbeg int
runtextend int
runtextpos int
runtextstart int
runtrack int[]
runtrackcount int
runtrackpos int

Protected Methods

Method Description
Capture ( int capnum, int start, int end ) : void

Called by Go() to capture a subexpression. Note that the capnum used here has already been mapped to a non-sparse index (by the code generator RegexWriter).

CharInClass ( char ch, string charClass ) : bool
CharInSet ( char ch, string set, string category ) : bool
CheckTimeout ( ) : void
Crawl ( int i ) : void

Save a number on the longjump unrolling stack

Crawlpos ( ) : int

Get the height of the stack

DoubleCrawl ( ) : void

Increases the size of the longjump unrolling stack.

DoubleStack ( ) : void

Called by the implementation of Go() to increase the size of the grouping stack.

DoubleTrack ( ) : void

Called by the implementation of Go() to increase the size of the backtracking stack.

EnsureStorage ( ) : void

Called by the implementation of Go() to increase the size of storage

FindFirstChar ( ) : bool

The responsibility of FindFirstChar() is to advance runtextpos until it is at the next position which is a candidate for the beginning of a successful match.

Go ( ) : void

The responsibility of Go() is to run the regular expression at runtextpos and call Capture() on all the captured subexpressions, then to leave runtextpos at the ending position. It should leave runtextpos where it started if there was no match.

InitTrackCount ( ) : void

InitTrackCount must initialize the runtrackcount field; this is used to know how large the initial runtrack and runstack arrays must be.

IsBoundary ( int index, int startpos, int endpos ) : bool

Called by the implementation of Go() to decide whether the pos at the specified index is a boundary or not. It's just not worth emitting inline code for this logic.

IsECMABoundary ( int index, int startpos, int endpos ) : bool
IsMatched ( int cap ) : bool

Call out to runmatch to get around visibility issues

MatchIndex ( int cap ) : int

Call out to runmatch to get around visibility issues

MatchLength ( int cap ) : int

Call out to runmatch to get around visibility issues

Popcrawl ( ) : int

Remove a number from the longjump unrolling stack

RegexRunner ( ) : System
Scan ( Regex regex, string text, int textbeg, int textend, int textstart, int prevlen, bool quick ) : Match

Scans the string to find the first match. Uses the Match object both to feed text in and as a place to store matches that come out. All the action is in the abstract Go() method defined by subclasses. Our responsibility is to load up the class members (as done here) before calling Go. The optimizer can compute a set of candidate starting characters, and we could use a separate method Skip() that will quickly scan past any characters that we know can't match.

Scan ( Regex regex, string text, int textbeg, int textend, int textstart, int prevlen, bool quick, System.TimeSpan timeout ) : Match
TransferCapture ( int capnum, int uncapnum, int start, int end ) : void

Called by Go() to capture a subexpression. Note that the capnum used here has already been mapped to a non-sparse index (by the code generator RegexWriter).

Uncapture ( ) : void

Private Methods

Method Description
DoCheckTimeout ( ) : void
DumpState ( ) : void

Dump the current state

InitMatch ( ) : void

Initializes all the data members that are used by Go()

StackDescription ( int a, int index ) : string
StartTimeoutWatch ( ) : void
TextposDescription ( ) : string
TidyMatch ( bool quick ) : Match

Put match in its canonical form before returning it.

Method Details

Capture() protected method

Called by Go() to capture a subexpression. Note that the capnum used here has already been mapped to a non-sparse index (by the code generator RegexWriter).
protected Capture ( int capnum, int start, int end ) : void
capnum int
start int
end int
return void

CharInClass() protected static method

protected static CharInClass ( char ch, string charClass ) : bool
ch char
charClass string
return bool

CharInSet() protected static method

protected static CharInSet ( char ch, string set, string category ) : bool
ch char
set string
category string
return bool

CheckTimeout() protected method

protected CheckTimeout ( ) : void
return void

Crawl() protected method

Save a number on the longjump unrolling stack
protected Crawl ( int i ) : void
i int
return void

Crawlpos() protected method

Get the height of the stack
protected Crawlpos ( ) : int
return int

DoubleCrawl() protected method

Increases the size of the longjump unrolling stack.
protected DoubleCrawl ( ) : void
return void

DoubleStack() protected method

Called by the implementation of Go() to increase the size of the grouping stack.
protected DoubleStack ( ) : void
return void

DoubleTrack() protected method

Called by the implementation of Go() to increase the size of the backtracking stack.
protected DoubleTrack ( ) : void
return void

EnsureStorage() protected method

Called by the implementation of Go() to increase the size of storage
protected EnsureStorage ( ) : void
return void

FindFirstChar() protected abstract method

The responsibility of FindFirstChar() is to advance runtextpos until it is at the next position which is a candidate for the beginning of a successful match.
protected abstract FindFirstChar ( ) : bool
return bool

Go() protected abstract method

The responsibility of Go() is to run the regular expression at runtextpos and call Capture() on all the captured subexpressions, then to leave runtextpos at the ending position. It should leave runtextpos where it started if there was no match.
protected abstract Go ( ) : void
return void

InitTrackCount() protected abstract method

InitTrackCount must initialize the runtrackcount field; this is used to know how large the initial runtrack and runstack arrays must be.
protected abstract InitTrackCount ( ) : void
return void

IsBoundary() protected method

Called by the implementation of Go() to decide whether the pos at the specified index is a boundary or not. It's just not worth emitting inline code for this logic.
protected IsBoundary ( int index, int startpos, int endpos ) : bool
index int
startpos int
endpos int
return bool

IsECMABoundary() protected method

protected IsECMABoundary ( int index, int startpos, int endpos ) : bool
index int
startpos int
endpos int
return bool

IsMatched() protected method

Call out to runmatch to get around visibility issues
protected IsMatched ( int cap ) : bool
cap int
return bool

MatchIndex() protected method

Call out to runmatch to get around visibility issues
protected MatchIndex ( int cap ) : int
cap int
return int

MatchLength() protected method

Call out to runmatch to get around visibility issues
protected MatchLength ( int cap ) : int
cap int
return int

Popcrawl() protected method

Remove a number from the longjump unrolling stack
protected Popcrawl ( ) : int
return int

RegexRunner() protected method

protected RegexRunner ( ) : System
return System

Scan() protected method

Scans the string to find the first match. Uses the Match object both to feed text in and as a place to store matches that come out. All the action is in the abstract Go() method defined by subclasses. Our responsibility is to load up the class members (as done here) before calling Go. The optimizer can compute a set of candidate starting characters, and we could use a separate method Skip() that will quickly scan past any characters that we know can't match.
protected Scan ( Regex regex, string text, int textbeg, int textend, int textstart, int prevlen, bool quick ) : Match
regex Regex
text string
textbeg int
textend int
textstart int
prevlen int
quick bool
return Match

Scan() protected method

protected Scan ( Regex regex, string text, int textbeg, int textend, int textstart, int prevlen, bool quick, System.TimeSpan timeout ) : Match
regex Regex
text string
textbeg int
textend int
textstart int
prevlen int
quick bool
timeout System.TimeSpan
return Match

TransferCapture() protected method

Called by Go() to capture a subexpression. Note that the capnum used here has already been mapped to a non-sparse index (by the code generator RegexWriter).
protected TransferCapture ( int capnum, int uncapnum, int start, int end ) : void
capnum int
uncapnum int
start int
end int
return void

Uncapture() protected method

protected Uncapture ( ) : void
return void

Property Details

runcrawl protected_oe property

protected int[] runcrawl
return int[]

runcrawlpos protected_oe property

protected int runcrawlpos
return int

runmatch protected_oe property

protected Match,Pchp.Library.PerlRegex runmatch
return Match

runregex protected_oe property

protected Regex runregex
return Regex

runstack protected_oe property

protected int[] runstack
return int[]

runstackpos protected_oe property

protected int runstackpos
return int

runtext protected_oe property

protected string runtext
return string

runtextbeg protected_oe property

protected int runtextbeg
return int

runtextend protected_oe property

protected int runtextend
return int

runtextpos protected_oe property

protected int runtextpos
return int

runtextstart protected_oe property

protected int runtextstart
return int

runtrack protected_oe property

protected int[] runtrack
return int[]

runtrackcount protected_oe property

protected int runtrackcount
return int

runtrackpos protected_oe property

protected int runtrackpos
return int