1 using System;
2 using System.Collections;
3
4
5
6
7
8 namespace System.Lex
9 {
10 public class Span
11 {
12 public Span() :
13 fileIndex(-1), line(-1), start(-1), end(-1)
14 {
15 }
16 public Span(int fileIndex_, int line_, int start_) :
17 fileIndex(fileIndex_), line(line_), start(start_), end(start)
18 {
19 }
20 public Span(int fileIndex_, int line_, int start_, int end_) :
21 fileIndex(fileIndex_), line(line_), start(start_), end(end_)
22 {
23 }
24 public bool Valid() const
25 {
26 return fileIndex != -1 && line != -1 && start != -1 && end != -1;
27 }
28 public int fileIndex;
29 public int line;
30 public int start;
31 public int end;
32 }
33 public bool operator==(const Span& left, const Span& right)
34 {
35 return left.fileIndex == right.fileIndex && left.line == right.line && left.start == right.start && left.end == right.end;
36 }
37 }