Pidgin

Class SourcePosDelta

Represents a difference in textual lines and columns corresponding to a region of an input stream.

Inheritance
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

Int32

lines

The number of lines

Int32

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

Int32

The number of columns

Lines

Gets the number of lines represented by the SourcePosDelta.

Declaration
public int Lines { get; }
Property Value
Type Description

Int32

The number of lines

NewLine

A SourcePosDelta representing a newline being consumed.

Declaration
public static SourcePosDelta NewLine { get; }
Property Value
Type Description

SourcePosDelta

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

SourcePosDelta

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

SourcePosDelta

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

SourcePosDelta

other

The SourcePosDelta to add to this one.

Returns
Type Description

SourcePosDelta

A SourcePosDelta representing the composition of this and other.

CompareTo(SourcePosDelta)

Declaration
public int CompareTo(SourcePosDelta other)
Parameters
Type Name Description

SourcePosDelta

other

Returns
Type Description

Int32

Equals(SourcePosDelta)

Declaration
public bool Equals(SourcePosDelta other)
Parameters
Type Name Description

SourcePosDelta

other

Returns
Type Description

Boolean

Equals(Object)

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description

Object

obj

Returns
Type Description

Boolean

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description

Int32

Plus(SourcePosDelta)

Add two SourcePosDeltas.

Declaration
public SourcePosDelta Plus(SourcePosDelta other)
Parameters
Type Name Description

SourcePosDelta

other

The SourcePosDelta to add to this one.

Returns
Type Description

SourcePosDelta

A SourcePosDelta representing the composition of this and other.

Operators

Addition(SourcePosDelta, SourcePosDelta)

Add two SourcePosDeltas.

Declaration
public static SourcePosDelta operator +(SourcePosDelta left, SourcePosDelta right)
Parameters
Type Name Description

SourcePosDelta

left

The first SourcePosDelta.

SourcePosDelta

right

The SourcePosDelta to add to left.

Returns
Type Description

SourcePosDelta

A SourcePosDelta representing the composition of left and right.

Equality(SourcePosDelta, SourcePosDelta)

Declaration
public static bool operator ==(SourcePosDelta left, SourcePosDelta right)
Parameters
Type Name Description

SourcePosDelta

left

SourcePosDelta

right

Returns
Type Description

Boolean

GreaterThan(SourcePosDelta, SourcePosDelta)

Declaration
public static bool operator>(SourcePosDelta left, SourcePosDelta right)
Parameters
Type Name Description

SourcePosDelta

left

SourcePosDelta

right

Returns
Type Description

Boolean

GreaterThanOrEqual(SourcePosDelta, SourcePosDelta)

Declaration
public static bool operator >=(SourcePosDelta left, SourcePosDelta right)
Parameters
Type Name Description

SourcePosDelta

left

SourcePosDelta

right

Returns
Type Description

Boolean

Inequality(SourcePosDelta, SourcePosDelta)

Declaration
public static bool operator !=(SourcePosDelta left, SourcePosDelta right)
Parameters
Type Name Description

SourcePosDelta

left

SourcePosDelta

right

Returns
Type Description

Boolean

LessThan(SourcePosDelta, SourcePosDelta)

Declaration
public static bool operator <(SourcePosDelta left, SourcePosDelta right)
Parameters
Type Name Description

SourcePosDelta

left

SourcePosDelta

right

Returns
Type Description

Boolean

LessThanOrEqual(SourcePosDelta, SourcePosDelta)

Declaration
public static bool operator <=(SourcePosDelta left, SourcePosDelta right)
Parameters
Type Name Description

SourcePosDelta

left

SourcePosDelta

right

Returns
Type Description

Boolean

Implements

System.IEquatable<T>
System.IComparable<T>