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

« back to all changes in this revision

Viewing changes to external/nrefactory/ICSharpCode.NRefactory.VB/Lexer/Block.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
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
 
2
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
 
3
 
 
4
using System;
 
5
using System.Collections.Generic;
 
6
using System.Linq;
 
7
using System.Text;
 
8
 
 
9
namespace ICSharpCode.NRefactory.VB.Parser
 
10
{       
 
11
        public enum Context
 
12
        {
 
13
                Global,
 
14
                TypeDeclaration,
 
15
                ObjectCreation,
 
16
                ObjectInitializer,
 
17
                CollectionInitializer,
 
18
                Type,
 
19
                Member,
 
20
                Parameter,
 
21
                Identifier,
 
22
                Body,
 
23
                Xml,
 
24
                Attribute,
 
25
                Importable,
 
26
                Query,
 
27
                Expression,
 
28
                Debug,
 
29
                Default
 
30
        }
 
31
        
 
32
        public class Block : ICloneable
 
33
        {
 
34
                public static readonly Block Default = new Block() {
 
35
                        context = Context.Global,
 
36
                        lastExpressionStart = TextLocation.Empty
 
37
                };
 
38
                
 
39
                public Context context;
 
40
                public TextLocation lastExpressionStart;
 
41
                public bool isClosed;
 
42
                
 
43
                public override string ToString()
 
44
                {
 
45
                        return string.Format("[Block Context={0}, LastExpressionStart={1}, IsClosed={2}]", context, lastExpressionStart, isClosed);
 
46
                }
 
47
                
 
48
                public object Clone()
 
49
                {
 
50
                        return new Block() {
 
51
                                context = this.context,
 
52
                                lastExpressionStart = this.lastExpressionStart,
 
53
                                isClosed = this.isClosed
 
54
                        };
 
55
                }
 
56
        }
 
57
}