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

« back to all changes in this revision

Viewing changes to contrib/NRefactory/Project/Src/Ast/General/BlockStatement.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 System;
9
 
 
10
 
namespace ICSharpCode.OldNRefactory.Ast
11
 
{
12
 
        public class BlockStatement : Statement
13
 
        {
14
 
                // Children in C#: LabelStatement, LocalVariableDeclaration, Statement
15
 
                // Children in VB: LabelStatement, EndStatement, Statement
16
 
                
17
 
                public static new BlockStatement Null {
18
 
                        get {
19
 
                                return NullBlockStatement.Instance;
20
 
                        }
21
 
                }
22
 
                
23
 
                public override object AcceptVisitor(IAstVisitor visitor, object data)
24
 
                {
25
 
                        return visitor.VisitBlockStatement(this, data);
26
 
                }
27
 
                
28
 
                public override string ToString()
29
 
                {
30
 
                        return String.Format("[BlockStatement: Children={0}]",
31
 
                                             GetCollectionString(base.Children));
32
 
                }
33
 
        }
34
 
        
35
 
        internal sealed class NullBlockStatement : BlockStatement
36
 
        {
37
 
                public static readonly NullBlockStatement Instance = new NullBlockStatement();
38
 
                
39
 
                public override bool IsNull {
40
 
                        get {
41
 
                                return true;
42
 
                        }
43
 
                }
44
 
                
45
 
                public override object AcceptVisitor(IAstVisitor visitor, object data)
46
 
                {
47
 
                        return data;
48
 
                }
49
 
                public override object AcceptChildren(IAstVisitor visitor, object data)
50
 
                {
51
 
                        return data;
52
 
                }
53
 
                public override void AddChild(INode childNode)
54
 
                {
55
 
                        throw new InvalidOperationException();
56
 
                }
57
 
                
58
 
                public override string ToString()
59
 
                {
60
 
                        return String.Format("[NullBlockStatement]");
61
 
                }
62
 
        }
63
 
}