/// <summary> /// Initializes a new instance of the <see cref="LocatedTextReaderWrapper"/> class. /// </summary> /// <param name="source">The reader to wrap the <see cref="LocatedTextReaderWrapper"/> around.</param> /// <param name="location">The starting location of the reader.</param> public LocatedTextReaderWrapper(TextReader source, Location location) { if(source == null) { throw new ArgumentNullException("source"); } if(location == null) { throw new ArgumentNullException("location"); } this.location = location; this.source = source; }
/// <summary> /// Determines whether the specified character at the given location is the start of an directive. /// </summary> /// <param name="c">The character to test.</param> /// <param name="loc">The location of <paramref name="c"/>.</param> /// <returns> /// <c>true</c> if the specified character at the given location is the start of an directive; otherwise, <c>false</c>. /// </returns> private static bool IsDirectiveStart(char c, Location loc) { return c == '#' && loc.Column == 1; }
/// <summary> /// Initializes a new instance of the <see cref="LocatedTextReaderWrapper"/> class. /// </summary> /// <param name="source">The stream to wrap the <see cref="LocatedTextReaderWrapper"/> around.</param> /// <param name="location">The starting location of the stream.</param> /// <param name="wrapperOwnsStream">If set to <c>true</c>, <paramref name="source"/> will be disposed when the <see cref="LocatedTextReaderWrapper"/> is disposed.</param> public LocatedTextReaderWrapper(Stream source, Location location, bool wrapperOwnsStream = true) : this(new StreamReader(source), location) { this.mustDisposeSource = wrapperOwnsStream; }
/// <summary> /// Initializes a new instance of the <see cref="LocatedTextReaderWrapper"/> class. /// </summary> /// <param name="source">The string to wrap the <see cref="LocatedTextReaderWrapper"/> around.</param> /// <param name="location">The starting location of the string.</param> public LocatedTextReaderWrapper(string source, Location location) : this(new StringReader(source), location) { this.mustDisposeSource = true; }
public ParserException(string message, Location location, Exception inner) : base(message, inner) { this.location = location.Clone(); }
public MissingDataException(string message, Location location, Exception inner) : base(message, location, inner) { }
public MissingDataException(string message, Location location) : base(message, location) { }
public Token(TokenType type, object value, Location location = null) { TokenType = type; Value = value; Location = location; }