Class SourcePosDelta
Represents a difference in textual lines and columns corresponding to a region of an input stream.
Inheritance
- Object
- SourcePosDelta
Implements
Declaration
public sealed class SourcePosDelta : ValueType
Constructors
SourcePosDelta(Int32, Int32)
Create a new SourcePosDelta with the specified number of lines and columns.
Declaration
public SourcePosDelta(int lines, int cols)
Parameters
Type | Name | Description |
---|---|---|
lines |
The number of lines |
|
cols |
The number of columns |
Properties
Cols
Gets the number of columns represented by the SourcePosDelta.
Declaration
public int Cols { get; }
Property Value
Type | Description |
---|---|
The number of columns |
Lines
Gets the number of lines represented by the SourcePosDelta.
Declaration
public int Lines { get; }
Property Value
Type | Description |
---|---|
The number of lines |
NewLine
A SourcePosDelta representing a newline being consumed.
Declaration
public static SourcePosDelta NewLine { get; }
Property Value
Type | Description |
---|---|
A SourcePosDelta representing a newline being consumed. |
OneCol
A SourcePosDelta representing a single column being consumed.
Declaration
public static SourcePosDelta OneCol { get; }
Property Value
Type | Description |
---|---|
A SourcePosDelta representing a single column being consumed. |
Zero
A SourcePosDelta representing no change in the source position.
Declaration
public static SourcePosDelta Zero { get; }
Property Value
Type | Description |
---|---|
A SourcePosDelta representing no change in the source position. |
Methods
Add(SourcePosDelta)
Add two SourcePosDeltas.
Declaration
public SourcePosDelta Add(SourcePosDelta other)
Parameters
Type | Name | Description |
---|---|---|
other |
The SourcePosDelta to add to this one. |
Returns
Type | Description |
---|---|
A SourcePosDelta representing the composition of this and |
CompareTo(SourcePosDelta)
Declaration
public int CompareTo(SourcePosDelta other)
Parameters
Type | Name | Description |
---|---|---|
other |
Returns
Type | Description |
---|---|
Equals(SourcePosDelta)
Declaration
public bool Equals(SourcePosDelta other)
Parameters
Type | Name | Description |
---|---|---|
other |
Returns
Type | Description |
---|---|
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
obj |
Returns
Type | Description |
---|---|
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Plus(SourcePosDelta)
Add two SourcePosDeltas.
Declaration
public SourcePosDelta Plus(SourcePosDelta other)
Parameters
Type | Name | Description |
---|---|---|
other |
The SourcePosDelta to add to this one. |
Returns
Type | Description |
---|---|
A SourcePosDelta representing the composition of this and |
Operators
Addition(SourcePosDelta, SourcePosDelta)
Add two SourcePosDeltas.
Declaration
public static SourcePosDelta operator +(SourcePosDelta left, SourcePosDelta right)
Parameters
Type | Name | Description |
---|---|---|
left |
The first SourcePosDelta. |
|
right |
The SourcePosDelta to add to |
Returns
Type | Description |
---|---|
A SourcePosDelta representing the composition of |
Equality(SourcePosDelta, SourcePosDelta)
Declaration
public static bool operator ==(SourcePosDelta left, SourcePosDelta right)
Parameters
Type | Name | Description |
---|---|---|
left |
||
right |
Returns
Type | Description |
---|---|
GreaterThan(SourcePosDelta, SourcePosDelta)
Declaration
public static bool operator>(SourcePosDelta left, SourcePosDelta right)
Parameters
Type | Name | Description |
---|---|---|
left |
||
right |
Returns
Type | Description |
---|---|
GreaterThanOrEqual(SourcePosDelta, SourcePosDelta)
Declaration
public static bool operator >=(SourcePosDelta left, SourcePosDelta right)
Parameters
Type | Name | Description |
---|---|---|
left |
||
right |
Returns
Type | Description |
---|---|
Inequality(SourcePosDelta, SourcePosDelta)
Declaration
public static bool operator !=(SourcePosDelta left, SourcePosDelta right)
Parameters
Type | Name | Description |
---|---|---|
left |
||
right |
Returns
Type | Description |
---|---|
LessThan(SourcePosDelta, SourcePosDelta)
Declaration
public static bool operator <(SourcePosDelta left, SourcePosDelta right)
Parameters
Type | Name | Description |
---|---|---|
left |
||
right |
Returns
Type | Description |
---|---|
LessThanOrEqual(SourcePosDelta, SourcePosDelta)
Declaration
public static bool operator <=(SourcePosDelta left, SourcePosDelta right)
Parameters
Type | Name | Description |
---|---|---|
left |
||
right |
Returns
Type | Description |
---|---|