1
// ----------------------------------------------------------------
4
// Copyright 2008, Irénée HOTTIER,
6
// This is free software licensed under the NUnit license, You may
7
// obtain a copy of the license at http://nunit.org/?p=license&r=2.4
8
// ----------------------------------------------------------------
11
using System.Collections.Generic;
14
namespace NUnit.UiException.CSharpParser
17
/// This enum defines the list of all tags
18
/// that can be assigned to a particular string.
23
/// All sequences but the ones below
28
/// White characters: ' ' \t \n
29
/// and other separators like:
30
/// - '[' ']' '(' ')' ';'
66
/// This class is used to make the link between a string and a LexerTag value.
71
/// The string in this token.
73
protected string _text;
78
protected LexerTag _tag;
81
/// The starting startingPosition.
91
/// Gets the string value.
94
get { return (_text); }
98
/// Gets the tag value
100
public LexerTag Tag {
101
get { return (_tag); }
105
/// Gets the starting startingPosition of the string.
107
public int IndexStart {
108
get { return (_start); }
111
public override bool Equals(object obj)
115
if (obj == null || !(obj is LexToken))
118
token = (LexToken)obj;
120
return (token.Text == Text &&
121
token.IndexStart == IndexStart &&
125
public override int GetHashCode() {
126
return base.GetHashCode();
129
public override string ToString()
131
return (String.Format("Token=([{0}], Index={1}, Tag={2})",
132
Text, IndexStart, Tag));