~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to contrib/NRefactory/Project/Src/Parser/VBNet/ParamModifierList.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// <file>
2
 
//     <copyright see="prj:///doc/copyright.txt"/>
3
 
//     <license see="prj:///doc/license.txt"/>
4
 
//     <owner name="none" email=""/>
5
 
//     <version>$Revision: 4482 $</version>
6
 
// </file>
7
 
 
8
 
using ICSharpCode.OldNRefactory.Ast;
9
 
 
10
 
namespace ICSharpCode.OldNRefactory.Parser.VB
11
 
{
12
 
        internal class ParamModifierList
13
 
        {
14
 
                ParameterModifiers cur;
15
 
                Parser   parser;
16
 
                
17
 
                public ParameterModifiers Modifier {
18
 
                        get {
19
 
                                return cur;
20
 
                        }
21
 
                }
22
 
                
23
 
                public ParamModifierList(Parser parser)
24
 
                {
25
 
                        this.parser = parser;
26
 
                        cur         = ParameterModifiers.None;
27
 
                }
28
 
                
29
 
                public bool isNone { get { return cur == ParameterModifiers.None; } }
30
 
                
31
 
                public void Add(ParameterModifiers m) 
32
 
                {
33
 
                        if ((cur & m) == 0) {
34
 
                                cur |= m;
35
 
                        } else {
36
 
                                parser.Error("param modifier " + m + " already defined");
37
 
                        }
38
 
                }
39
 
                
40
 
                public void Add(ParamModifierList m)
41
 
                {
42
 
                        Add(m.cur);
43
 
                }
44
 
                
45
 
                public void Check()
46
 
                {
47
 
                        if((cur & ParameterModifiers.In) != 0 && 
48
 
                           (cur & ParameterModifiers.Ref) != 0) {
49
 
                                parser.Error("ByRef and ByVal are not allowed at the same time.");
50
 
                        }
51
 
                }
52
 
        }
53
 
}