Browse Source

split Statements into single files

pull/254/head
Siegfried Pammer 14 years ago
parent
commit
d78b1fe68d
  1. 40
      NRefactory/ICSharpCode.NRefactory.VB/Ast/Statements/ExpressionStatement.cs
  2. 39
      NRefactory/ICSharpCode.NRefactory.VB/Ast/Statements/IfElseStatement.cs
  3. 34
      NRefactory/ICSharpCode.NRefactory.VB/Ast/Statements/LabelDeclarationStatement.cs
  4. 37
      NRefactory/ICSharpCode.NRefactory.VB/Ast/Statements/LocalDeclarationStatement.cs
  5. 43
      NRefactory/ICSharpCode.NRefactory.VB/Ast/Statements/ReturnStatement.cs
  6. 308
      NRefactory/ICSharpCode.NRefactory.VB/Ast/Statements/Statement.cs
  7. 36
      NRefactory/ICSharpCode.NRefactory.VB/Ast/Statements/SyncLockStatement.cs
  8. 43
      NRefactory/ICSharpCode.NRefactory.VB/Ast/Statements/ThrowStatement.cs
  9. 67
      NRefactory/ICSharpCode.NRefactory.VB/Ast/Statements/TryStatement.cs
  10. 36
      NRefactory/ICSharpCode.NRefactory.VB/Ast/Statements/WithStatement.cs
  11. 9
      NRefactory/ICSharpCode.NRefactory.VB/ICSharpCode.NRefactory.VB.csproj

40
NRefactory/ICSharpCode.NRefactory.VB/Ast/Statements/ExpressionStatement.cs

@ -0,0 +1,40 @@ @@ -0,0 +1,40 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;
using System.IO;
namespace ICSharpCode.NRefactory.VB.Ast
{
/// <summary>
/// Expression
/// </summary>
// TODO this does not directly reflect the VB grammar!
public class ExpressionStatement : Statement
{
public Expression Expression {
get { return GetChildByRole (Roles.Expression); }
set { SetChildByRole (Roles.Expression, value); }
}
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)
{
return visitor.VisitExpressionStatement(this, data);
}
public ExpressionStatement()
{
}
public ExpressionStatement(Expression expression)
{
this.Expression = expression;
}
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
{
ExpressionStatement o = other as ExpressionStatement;
return o != null && this.Expression.DoMatch(o.Expression, match);
}
}
}

39
NRefactory/ICSharpCode.NRefactory.VB/Ast/Statements/IfElseStatement.cs

@ -0,0 +1,39 @@ @@ -0,0 +1,39 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;
using System.IO;
namespace ICSharpCode.NRefactory.VB.Ast
{
public class IfElseStatement : Statement
{
public static readonly Role<Statement> FalseStatementRole = new Role<Statement>("False", Ast.Statement.Null);
public static readonly Role<Statement> TrueStatementRole = new Role<Statement>("True", Ast.Statement.Null);
public Expression Condition {
get { return GetChildByRole(Roles.Condition); }
set { SetChildByRole(Roles.Condition, value); }
}
public Statement Body {
get { return GetChildByRole(TrueStatementRole); }
set { SetChildByRole(TrueStatementRole, value); }
}
public Statement ElseBlock {
get { return GetChildByRole(FalseStatementRole); }
set { SetChildByRole(FalseStatementRole, value); }
}
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)
{
return visitor.VisitIfElseStatement(this, data);
}
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
{
throw new NotImplementedException();
}
}
}

34
NRefactory/ICSharpCode.NRefactory.VB/Ast/Statements/LabelDeclarationStatement.cs

@ -0,0 +1,34 @@ @@ -0,0 +1,34 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;
using System.IO;
namespace ICSharpCode.NRefactory.VB.Ast
{
/// <summary>
/// Label:
/// </summary>
public class LabelDeclarationStatement : Statement
{
public Identifier Label {
get { return GetChildByRole(Roles.Identifier); }
set { SetChildByRole(Roles.Identifier, value); }
}
public VBTokenNode Colon {
get { return GetChildByRole(Roles.Colon); }
}
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)
{
return visitor.VisitLabelDeclarationStatement(this, data);
}
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
{
LabelDeclarationStatement o = other as LabelDeclarationStatement;
return o != null && MatchString(this.Label.Name, o.Label.Name);
}
}
}

37
NRefactory/ICSharpCode.NRefactory.VB/Ast/Statements/LocalDeclarationStatement.cs

@ -0,0 +1,37 @@ @@ -0,0 +1,37 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;
using System.IO;
namespace ICSharpCode.NRefactory.VB.Ast
{
/// <summary>
/// ( Dim | Static | Const ) VariableDeclarator { , VariableDeclarator }
/// </summary>
public class LocalDeclarationStatement : Statement
{
public AstNodeCollection<VariableDeclarator> Variables {
get { return GetChildrenByRole(VariableDeclarator.VariableDeclaratorRole); }
}
public Modifiers Modifiers {
get { return AttributedNode.GetModifiers(this); }
set { AttributedNode.SetModifiers(this, value); }
}
public VBModifierToken ModifierToken {
get { return GetChildByRole(AttributedNode.ModifierRole); }
}
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)
{
return visitor.VisitLocalDeclarationStatement(this, data);
}
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
{
throw new NotImplementedException();
}
}
}

43
NRefactory/ICSharpCode.NRefactory.VB/Ast/Statements/ReturnStatement.cs

@ -0,0 +1,43 @@ @@ -0,0 +1,43 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;
using System.IO;
namespace ICSharpCode.NRefactory.VB.Ast
{
/// <summary>
/// Return Expression
/// </summary>
public class ReturnStatement : Statement
{
public VBTokenNode ReturnToken {
get { return GetChildByRole (Roles.Keyword); }
}
public Expression Expression {
get { return GetChildByRole(Roles.Expression); }
set { SetChildByRole(Roles.Expression, value); }
}
public ReturnStatement()
{
}
public ReturnStatement(Expression expression)
{
AddChild (expression, Roles.Expression);
}
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)
{
return visitor.VisitReturnStatement(this, data);
}
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
{
ReturnStatement o = other as ReturnStatement;
return o != null && this.Expression.DoMatch(o.Expression, match);
}
}
}

308
NRefactory/ICSharpCode.NRefactory.VB/Ast/Statements/Statement.cs

@ -129,312 +129,4 @@ namespace ICSharpCode.NRefactory.VB.Ast @@ -129,312 +129,4 @@ namespace ICSharpCode.NRefactory.VB.Ast
throw new NotImplementedException();
}
}
/// <summary>
/// Label:
/// </summary>
public class LabelDeclarationStatement : Statement
{
public Identifier Label {
get { return GetChildByRole(Roles.Identifier); }
set { SetChildByRole(Roles.Identifier, value); }
}
public VBTokenNode Colon {
get { return GetChildByRole(Roles.Colon); }
}
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)
{
return visitor.VisitLabelDeclarationStatement(this, data);
}
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
{
LabelDeclarationStatement o = other as LabelDeclarationStatement;
return o != null && MatchString(this.Label.Name, o.Label.Name);
}
}
/// <summary>
/// ( Dim | Static | Const ) VariableDeclarator { , VariableDeclarator }
/// </summary>
public class LocalDeclarationStatement : Statement
{
public AstNodeCollection<VariableDeclarator> Variables {
get { return GetChildrenByRole(VariableDeclarator.VariableDeclaratorRole); }
}
public Modifiers Modifiers {
get { return AttributedNode.GetModifiers(this); }
set { AttributedNode.SetModifiers(this, value); }
}
public VBModifierToken ModifierToken {
get { return GetChildByRole(AttributedNode.ModifierRole); }
}
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)
{
return visitor.VisitLocalDeclarationStatement(this, data);
}
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
{
throw new NotImplementedException();
}
}
/// <summary>
/// With Expression <br />
/// Block <br />
/// End With
/// </summary>
public class WithStatement : Statement
{
public Expression Expression {
get { return GetChildByRole(Roles.Expression); }
set { SetChildByRole(Roles.Expression, value); }
}
public BlockStatement Body {
get { return GetChildByRole(Roles.Body); }
set { SetChildByRole(Roles.Body, value); }
}
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)
{
return visitor.VisitWithStatement(this, data);
}
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
{
throw new NotImplementedException();
}
}
/// <summary>
/// SyncLock Expression <br />
/// Block <br />
/// End SyncLock
/// </summary>
public class SyncLockStatement : Statement
{
public Expression Expression {
get { return GetChildByRole(Roles.Expression); }
set { SetChildByRole(Roles.Expression, value); }
}
public BlockStatement Body {
get { return GetChildByRole(Roles.Body); }
set { SetChildByRole(Roles.Body, value); }
}
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)
{
return visitor.VisitSyncLockStatement(this, data);
}
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
{
throw new NotImplementedException();
}
}
/// <summary>
/// SyncLock Expression <br />
/// Block <br />
/// End SyncLock
/// </summary>
public class TryStatement : Statement
{
public static readonly Role<BlockStatement> FinallyBlockRole = new Role<BlockStatement>("FinallyBlock", Ast.BlockStatement.Null);
public BlockStatement Body {
get { return GetChildByRole(Roles.Body); }
set { SetChildByRole(Roles.Body, value); }
}
public AstNodeCollection<CatchBlock> CatchBlocks {
get { return GetChildrenByRole(CatchBlock.CatchBlockRole); }
}
public BlockStatement FinallyBlock {
get { return GetChildByRole(FinallyBlockRole); }
set { SetChildByRole(FinallyBlockRole, value); }
}
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)
{
return visitor.VisitTryStatement(this, data);
}
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
{
throw new NotImplementedException();
}
}
public class CatchBlock : BlockStatement
{
public static readonly Role<CatchBlock> CatchBlockRole = new Role<CatchBlock>("CatchBlockRole");
public Identifier ExceptionVariable {
get { return GetChildByRole(Roles.Identifier); }
set { SetChildByRole(Roles.Identifier, value); }
}
public AstType ExceptionType {
get { return GetChildByRole(Roles.Type); }
set { SetChildByRole(Roles.Type, value); }
}
public Expression WhenExpression {
get { return GetChildByRole(Roles.Expression); }
set { SetChildByRole(Roles.Expression, value); }
}
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)
{
return visitor.VisitCatchBlock(this, data);
}
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
{
throw new NotImplementedException();
}
}
public class IfElseStatement : Statement
{
public static readonly Role<Statement> FalseStatementRole = new Role<Statement>("False", Ast.Statement.Null);
public static readonly Role<Statement> TrueStatementRole = new Role<Statement>("True", Ast.Statement.Null);
public Expression Condition {
get { return GetChildByRole(Roles.Condition); }
set { SetChildByRole(Roles.Condition, value); }
}
public Statement Body {
get { return GetChildByRole(TrueStatementRole); }
set { SetChildByRole(TrueStatementRole, value); }
}
public Statement ElseBlock {
get { return GetChildByRole(FalseStatementRole); }
set { SetChildByRole(FalseStatementRole, value); }
}
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)
{
return visitor.VisitIfElseStatement(this, data);
}
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
{
throw new NotImplementedException();
}
}
/// <summary>
/// Expression
/// </summary>
public class ExpressionStatement : Statement
{
public Expression Expression {
get { return GetChildByRole (Roles.Expression); }
set { SetChildByRole (Roles.Expression, value); }
}
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)
{
return visitor.VisitExpressionStatement(this, data);
}
public ExpressionStatement()
{
}
public ExpressionStatement(Expression expression)
{
this.Expression = expression;
}
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
{
ExpressionStatement o = other as ExpressionStatement;
return o != null && this.Expression.DoMatch(o.Expression, match);
}
}
/// <summary>
/// Throw Expression
/// </summary>
public class ThrowStatement : Statement
{
public VBTokenNode ThrowToken {
get { return GetChildByRole (Roles.Keyword); }
}
public Expression Expression {
get { return GetChildByRole(Roles.Expression); }
set { SetChildByRole(Roles.Expression, value); }
}
public ThrowStatement()
{
}
public ThrowStatement(Expression expression)
{
AddChild (expression, Roles.Expression);
}
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)
{
return visitor.VisitThrowStatement(this, data);
}
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
{
ThrowStatement o = other as ThrowStatement;
return o != null && this.Expression.DoMatch(o.Expression, match);
}
}
/// <summary>
/// Return Expression
/// </summary>
public class ReturnStatement : Statement
{
public VBTokenNode ReturnToken {
get { return GetChildByRole (Roles.Keyword); }
}
public Expression Expression {
get { return GetChildByRole(Roles.Expression); }
set { SetChildByRole(Roles.Expression, value); }
}
public ReturnStatement()
{
}
public ReturnStatement(Expression expression)
{
AddChild (expression, Roles.Expression);
}
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)
{
return visitor.VisitReturnStatement(this, data);
}
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
{
ReturnStatement o = other as ReturnStatement;
return o != null && this.Expression.DoMatch(o.Expression, match);
}
}
}

36
NRefactory/ICSharpCode.NRefactory.VB/Ast/Statements/SyncLockStatement.cs

@ -0,0 +1,36 @@ @@ -0,0 +1,36 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;
using System.IO;
namespace ICSharpCode.NRefactory.VB.Ast
{
/// <summary>
/// SyncLock Expression <br />
/// Block <br />
/// End SyncLock
/// </summary>
public class SyncLockStatement : Statement
{
public Expression Expression {
get { return GetChildByRole(Roles.Expression); }
set { SetChildByRole(Roles.Expression, value); }
}
public BlockStatement Body {
get { return GetChildByRole(Roles.Body); }
set { SetChildByRole(Roles.Body, value); }
}
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)
{
return visitor.VisitSyncLockStatement(this, data);
}
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
{
throw new NotImplementedException();
}
}
}

43
NRefactory/ICSharpCode.NRefactory.VB/Ast/Statements/ThrowStatement.cs

@ -0,0 +1,43 @@ @@ -0,0 +1,43 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;
using System.IO;
namespace ICSharpCode.NRefactory.VB.Ast
{
/// <summary>
/// Throw Expression
/// </summary>
public class ThrowStatement : Statement
{
public VBTokenNode ThrowToken {
get { return GetChildByRole (Roles.Keyword); }
}
public Expression Expression {
get { return GetChildByRole(Roles.Expression); }
set { SetChildByRole(Roles.Expression, value); }
}
public ThrowStatement()
{
}
public ThrowStatement(Expression expression)
{
AddChild (expression, Roles.Expression);
}
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)
{
return visitor.VisitThrowStatement(this, data);
}
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
{
ThrowStatement o = other as ThrowStatement;
return o != null && this.Expression.DoMatch(o.Expression, match);
}
}
}

67
NRefactory/ICSharpCode.NRefactory.VB/Ast/Statements/TryStatement.cs

@ -0,0 +1,67 @@ @@ -0,0 +1,67 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;
using System.IO;
namespace ICSharpCode.NRefactory.VB.Ast
{
public class TryStatement : Statement
{
public static readonly Role<BlockStatement> FinallyBlockRole = new Role<BlockStatement>("FinallyBlock", Ast.BlockStatement.Null);
public BlockStatement Body {
get { return GetChildByRole(Roles.Body); }
set { SetChildByRole(Roles.Body, value); }
}
public AstNodeCollection<CatchBlock> CatchBlocks {
get { return GetChildrenByRole(CatchBlock.CatchBlockRole); }
}
public BlockStatement FinallyBlock {
get { return GetChildByRole(FinallyBlockRole); }
set { SetChildByRole(FinallyBlockRole, value); }
}
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)
{
return visitor.VisitTryStatement(this, data);
}
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
{
throw new NotImplementedException();
}
}
public class CatchBlock : BlockStatement
{
public static readonly Role<CatchBlock> CatchBlockRole = new Role<CatchBlock>("CatchBlockRole");
public Identifier ExceptionVariable {
get { return GetChildByRole(Roles.Identifier); }
set { SetChildByRole(Roles.Identifier, value); }
}
public AstType ExceptionType {
get { return GetChildByRole(Roles.Type); }
set { SetChildByRole(Roles.Type, value); }
}
public Expression WhenExpression {
get { return GetChildByRole(Roles.Expression); }
set { SetChildByRole(Roles.Expression, value); }
}
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)
{
return visitor.VisitCatchBlock(this, data);
}
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
{
throw new NotImplementedException();
}
}
}

36
NRefactory/ICSharpCode.NRefactory.VB/Ast/Statements/WithStatement.cs

@ -0,0 +1,36 @@ @@ -0,0 +1,36 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
using System;
using System.IO;
namespace ICSharpCode.NRefactory.VB.Ast
{
/// <summary>
/// With Expression <br />
/// Block <br />
/// End With
/// </summary>
public class WithStatement : Statement
{
public Expression Expression {
get { return GetChildByRole(Roles.Expression); }
set { SetChildByRole(Roles.Expression, value); }
}
public BlockStatement Body {
get { return GetChildByRole(Roles.Body); }
set { SetChildByRole(Roles.Body, value); }
}
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)
{
return visitor.VisitWithStatement(this, data);
}
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
{
throw new NotImplementedException();
}
}
}

9
NRefactory/ICSharpCode.NRefactory.VB/ICSharpCode.NRefactory.VB.csproj

@ -86,7 +86,16 @@ @@ -86,7 +86,16 @@
<Compile Include="Ast\Identifier.cs" />
<Compile Include="Ast\INullable.cs" />
<Compile Include="Ast\Statements\BlockStatement.cs" />
<Compile Include="Ast\Statements\ExpressionStatement.cs" />
<Compile Include="Ast\Statements\IfElseStatement.cs" />
<Compile Include="Ast\Statements\LabelDeclarationStatement.cs" />
<Compile Include="Ast\Statements\LocalDeclarationStatement.cs" />
<Compile Include="Ast\Statements\ReturnStatement.cs" />
<Compile Include="Ast\Statements\Statement.cs" />
<Compile Include="Ast\Statements\SyncLockStatement.cs" />
<Compile Include="Ast\Statements\ThrowStatement.cs" />
<Compile Include="Ast\Statements\TryStatement.cs" />
<Compile Include="Ast\Statements\WithStatement.cs" />
<Compile Include="Ast\TypeMembers\Accessor.cs" />
<Compile Include="Ast\TypeMembers\ConstructorDeclaration.cs" />
<Compile Include="Ast\TypeMembers\EventDeclaration.cs" />

Loading…
Cancel
Save