~halega/+junk/sharpdevelop

« back to all changes in this revision

Viewing changes to src/Libraries/NRefactory/Project/Src/Lexer/VBNet/Block.cs

  • Committer: sk
  • Date: 2011-09-10 05:17:57 UTC
  • Revision ID: halega@halega.com-20110910051757-qfouz1llya9m6boy
4.1.0.7915 Release Candidate 1

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 the GNU LGPL (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.Parser.VB
 
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 = Location.Empty
 
37
                };
 
38
                
 
39
                public Context context;
 
40
                public Location 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
}