Represents a set of characters (e.g. 'A'..'Z' | 'a'..'z' | '_'), or a set of integers, used in the grammar of a parser.
More...
Represents a set of characters (e.g. 'A'..'Z' | 'a'..'z' | '_'), or a set of integers, used in the grammar of a parser.
This class extends IntSet to implement IPGTerminalSet, used by LLParserGenerator. It also contains a a couple of code generation helper methods.
-1 is assumed to represent EOF.
|
PGIntSet | WithEOF (bool wantEOF=true) |
| Adds or removes EOF from the set. If the set doesn't change, this method may return this. More...
|
|
| PGIntSet (bool isCharSet=false, bool inverted=false) |
|
| PGIntSet (IntRange r, bool isCharSet=false, bool inverted=false) |
|
| PGIntSet (bool isCharSet, bool inverted, params IntRange[] list) |
|
PGIntSet | Union (IntSet other) |
|
new PGIntSet | Intersection (IntSet other, bool subtract=false, bool subtractThis=false) |
|
new PGIntSet | Subtract (IntSet other) |
|
PGIntSet | Optimize (IntSet dontcare) |
|
bool | Equals (IPGTerminalSet other) |
|
int | ExprComplexity () |
| Returns the "complexity" of the set. More...
|
|
Match | ChooseMatchType (int maxRanges, int maxSingles) |
|
LNode | GenerateTest (LNode subject, Symbol setName) |
|
IntSet | Inverted () |
|
| IntSet (bool isCharSet=false, bool inverted=false) |
|
| IntSet (IntRange r, bool isCharSet=false, bool inverted=false) |
|
| IntSet (bool isCharSet, bool inverted, params IntRange[] list) |
|
bool | Contains (int ch) |
|
IntSet | Union (IntSet r, bool cloneWhenOneIsEmpty=false) |
|
IntSet | Intersection (IntSet r, bool subtract=false, bool subtractThis=false) |
|
IntSet | Subtract (IntSet other) |
|
IntSet | EquivalentInverted () |
| Computes the equivalent inverted set, e.g. if the set is 'b'..'y' , the equivalent inverted set is ~(int.MinValue..'a' | 'z'..int.MaxValue) . More...
|
|
IntSet | Clone () |
|
override string | ToString () |
| Prints the character set using regex syntax, e.g. [$a-z] means "EOF or a to z", [^
\r] means "not \n or \r". Use ToString(false) if this is an integer set. More...
|
|
string | ToString (bool charSet) |
|
IEnumerator< IntRange > | GetEnumerator () |
|
IEnumerator< IntRange > | GetEnumerator (bool obeyInversion) |
|
IntRange | TryGet (int index, out bool fail) |
|
override bool | Equals (object obj) |
|
bool | Equals (IntSet other) |
|
override int | GetHashCode () |
|
bool | Equals (IntSet other, Symbol mode) |
|
InternalList< IntRange > | Runs () |
|
InternalList< IntRange > | InternalRangeList () |
|
IEnumerable< int > | IntegerSequence (bool obeyInversion) |
|
IntSet | Optimize (IntSet dontcare, bool mergeRuns=true) |
|
IRange< T > | Slice (int start, int count=int.MaxValue) |
| Returns a sub-range of this list. More...
|
|
|
static new PGIntSet | With (params int[] members) |
|
static new PGIntSet | WithRanges (params int[] ranges) |
|
static new PGIntSet | Without (params int[] members) |
|
static new PGIntSet | WithoutRanges (params int[] ranges) |
|
static new PGIntSet | WithChars (params int[] members) |
|
static new PGIntSet | WithCharRanges (params int[] ranges) |
|
static new PGIntSet | WithoutChars (params int[] members) |
|
static new PGIntSet | WithoutCharRanges (params int[] ranges) |
|
static new PGIntSet | Parse (string members) |
|
static new PGIntSet | TryParse (string members) |
|
static new PGIntSet | TryParse (string members, out int errorIndex) |
|
static implicit | operator IntSet (int c) |
|
static implicit | operator IntSet (IntRange r) |
|
static IntSet | With (params int[] members) |
|
static IntSet | WithRanges (params int[] ranges) |
|
static IntSet | Without (params int[] members) |
|
static IntSet | WithoutRanges (params int[] ranges) |
|
static IntSet | WithChars (params int[] members) |
|
static IntSet | WithCharRanges (params int[] ranges) |
|
static IntSet | WithoutChars (params int[] members) |
|
static IntSet | WithoutCharRanges (params int[] ranges) |
|
static IntSet | Parse (string members) |
|
static IntSet | TryParse (string members) |
|
static IntSet | TryParse (string members, out int errorIndex) |
|
|
| PGIntSet (bool isCharSet, InternalList< IntRange > ranges, bool inverted, bool autoSimplify) |
|
| PGIntSet (bool isCharSet, bool inverted, bool ranges, params int[] list) |
|
override IntSet | New (IntSet basis, bool inverted, InternalList< IntRange > ranges) |
|
| IntSet (bool isCharSet, InternalList< IntRange > ranges, bool inverted, bool autoSimplify) |
|
| IntSet (bool isCharSet, bool inverted, bool ranges, params int[] list) |
|