2
// <copyright see="prj:///doc/copyright.txt"/>
3
// <license see="prj:///doc/license.txt"/>
4
// <owner name="none" email=""/>
5
// <version>$Revision: 4482 $</version>
8
using ICSharpCode.OldNRefactory.Ast;
10
namespace ICSharpCode.OldNRefactory.Parser
12
internal class ModifierList
15
Location location = new Location(-1, -1);
17
public Modifiers Modifier {
26
public Location GetDeclarationLocation(Location keywordLocation)
28
if(location.IsEmpty) {
29
return keywordLocation;
34
// public Location Location {
43
public bool isNone { get { return cur == Modifiers.None; } }
45
public bool Contains(Modifiers m)
47
return ((cur & m) != 0);
50
public void Add(Modifiers m, Location tokenLocation)
52
if(location.IsEmpty) {
53
location = tokenLocation;
55
if (m == Modifiers.Internal && (cur & Modifiers.Protected) != 0) {
56
cur = Modifiers.ProtectedAndInternal;
62
// parser.Error("modifier " + m + " already defined");
66
// public void Add(Modifiers m)
68
// Add(m.cur, m.Location);
71
public void Check(Modifiers allowed)
73
Modifiers wrong = cur & ~allowed;
74
if (wrong != Modifiers.None) {
75
// parser.Error("modifier(s) " + wrong + " not allowed here");