progress
This commit is contained in:
parent
16e76d6b31
commit
484dbfc9d9
529 changed files with 113694 additions and 0 deletions
55
AspClassic.Parser/UnsignedIntegerLiteralToken.cs
Normal file
55
AspClassic.Parser/UnsignedIntegerLiteralToken.cs
Normal file
|
@ -0,0 +1,55 @@
|
|||
using System;
|
||||
|
||||
namespace AspClassic.Parser;
|
||||
|
||||
/// <summary>
|
||||
/// An integer literal.
|
||||
/// </summary>
|
||||
public sealed class UnsignedIntegerLiteralToken : Token
|
||||
{
|
||||
private readonly ulong _Literal;
|
||||
|
||||
private readonly TypeCharacter _TypeCharacter;
|
||||
|
||||
private readonly IntegerBase _IntegerBase;
|
||||
|
||||
/// <summary>
|
||||
/// The value of the literal.
|
||||
/// </summary>
|
||||
[CLSCompliant(false)]
|
||||
public ulong Literal => _Literal;
|
||||
|
||||
/// <summary>
|
||||
/// The type character of the literal.
|
||||
/// </summary>
|
||||
public TypeCharacter TypeCharacter => _TypeCharacter;
|
||||
|
||||
/// <summary>
|
||||
/// The integer base of the literal.
|
||||
/// </summary>
|
||||
public IntegerBase IntegerBase => _IntegerBase;
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new unsigned integer literal.
|
||||
/// </summary>
|
||||
/// <param name="literal">The literal value.</param>
|
||||
/// <param name="integerBase">The integer base of the literal.</param>
|
||||
/// <param name="typeCharacter">The type character of the literal.</param>
|
||||
/// <param name="span">The location of the literal.</param>
|
||||
[CLSCompliant(false)]
|
||||
public UnsignedIntegerLiteralToken(ulong literal, IntegerBase integerBase, TypeCharacter typeCharacter, Span span)
|
||||
: base(TokenType.UnsignedIntegerLiteral, span)
|
||||
{
|
||||
if (integerBase < IntegerBase.Decimal || integerBase > IntegerBase.Hexadecimal)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("integerBase");
|
||||
}
|
||||
if (typeCharacter != 0 && typeCharacter != TypeCharacter.UnsignedIntegerChar && typeCharacter != TypeCharacter.UnsignedLongChar && typeCharacter != TypeCharacter.UnsignedShortChar)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("typeCharacter");
|
||||
}
|
||||
_Literal = literal;
|
||||
_IntegerBase = integerBase;
|
||||
_TypeCharacter = typeCharacter;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue