progress
This commit is contained in:
parent
16e76d6b31
commit
484dbfc9d9
529 changed files with 113694 additions and 0 deletions
51
AspClassic.Parser/OptionDeclaration.cs
Normal file
51
AspClassic.Parser/OptionDeclaration.cs
Normal file
|
@ -0,0 +1,51 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace AspClassic.Parser;
|
||||
|
||||
/// <summary>
|
||||
/// A parse tree for an Option declaration.
|
||||
/// </summary>
|
||||
public sealed class OptionDeclaration : Declaration
|
||||
{
|
||||
private readonly OptionType _OptionType;
|
||||
|
||||
private readonly Location _OptionTypeLocation;
|
||||
|
||||
private readonly Location _OptionArgumentLocation;
|
||||
|
||||
/// <summary>
|
||||
/// The type of Option statement.
|
||||
/// </summary>
|
||||
public OptionType OptionType => _OptionType;
|
||||
|
||||
/// <summary>
|
||||
/// The location of the Option type (e.g. "Strict"), if any.
|
||||
/// </summary>
|
||||
public Location OptionTypeLocation => _OptionTypeLocation;
|
||||
|
||||
/// <summary>
|
||||
/// The location of the Option argument (e.g. "On"), if any.
|
||||
/// </summary>
|
||||
public Location OptionArgumentLocation => _OptionArgumentLocation;
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new parse tree for an Option declaration.
|
||||
/// </summary>
|
||||
/// <param name="optionType">The type of the Option declaration.</param>
|
||||
/// <param name="optionTypeLocation">The location of the Option type, if any.</param>
|
||||
/// <param name="optionArgumentLocation">The location of the Option argument, if any.</param>
|
||||
/// <param name="span">The location of the parse tree.</param>
|
||||
/// <param name="comments">The comments for the parse tree.</param>
|
||||
public OptionDeclaration(OptionType optionType, Location optionTypeLocation, Location optionArgumentLocation, Span span, IList<Comment> comments)
|
||||
: base(TreeType.OptionDeclaration, span, comments)
|
||||
{
|
||||
if (optionType < OptionType.SyntaxError || optionType > OptionType.CompareText)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("optionType");
|
||||
}
|
||||
_OptionType = optionType;
|
||||
_OptionTypeLocation = optionTypeLocation;
|
||||
_OptionArgumentLocation = optionArgumentLocation;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue