本文整理汇总了C#中GotoCaseStatement类的典型用法代码示例。如果您正苦于以下问题:C# GotoCaseStatement类的具体用法?C# GotoCaseStatement怎么用?C# GotoCaseStatement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GotoCaseStatement类属于命名空间,在下文中一共展示了GotoCaseStatement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AcceptGotoCase
public void AcceptGotoCase(GotoCaseStatement stmt)
{
_result.Add(stmt);
}
示例2: AcceptGotoCase
public void AcceptGotoCase(GotoCaseStatement stmt)
{
Check(stmt);
}
示例3: VisitGotoCaseStatement
public sealed override object VisitGotoCaseStatement(GotoCaseStatement gotoCaseStatement, object data) {
BeginVisit(gotoCaseStatement);
object result = TrackedVisitGotoCaseStatement(gotoCaseStatement, data);
EndVisit(gotoCaseStatement);
return result;
}
示例4: VisitGotoCaseStatement
public override void VisitGotoCaseStatement(GotoCaseStatement gotoCaseStatement) {
var value = _resolver.Resolve(gotoCaseStatement.LabelExpression).ConstantValue;
_result.Add(JsStatement.Goto(_currentGotoCaseMap[NormalizeSwitchLabelValue(value)]));
}
示例5: Visit
public override object Visit(GotoCase gotoCase)
{
var result = new GotoCaseStatement();
result.AddChild(new CSharpTokenNode(Convert(gotoCase.loc), GotoCaseStatement.GotoKeywordRole), GotoCaseStatement.GotoKeywordRole);
var location = LocationsBag.GetLocations(gotoCase);
if (location != null)
result.AddChild(new CSharpTokenNode(Convert(location [0]), GotoCaseStatement.CaseKeywordRole), GotoCaseStatement.CaseKeywordRole);
if (gotoCase.Expr != null)
result.AddChild((Expression)gotoCase.Expr.Accept(this), Roles.Expression);
if (location != null && location.Count > 1)
result.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.Semicolon), Roles.Semicolon);
return result;
}
示例6: Visit
public override object Visit (GotoCase gotoCase)
{
var result = new GotoCaseStatement ();
result.AddChild (new CSharpTokenNode (Convert (gotoCase.loc), "goto".Length), GotoCaseStatement.Roles.Keyword);
var location = LocationsBag.GetLocations (gotoCase);
if (location != null)
result.AddChild (new CSharpTokenNode (Convert (location[0]), "case".Length), GotoCaseStatement.CaseKeywordRole);
result.AddChild ((MonoDevelop.CSharp.Ast.Expression)gotoCase.Expr.Accept (this), GotoCaseStatement.Roles.Expression);
if (location != null)
result.AddChild (new CSharpTokenNode (Convert (location[1]), 1), GotoCaseStatement.Roles.Semicolon);
return result;
}
示例7: AcceptGotoCase
public void AcceptGotoCase(GotoCaseStatement stmt)
{
}
示例8: VisitGotoCaseStatement
public void VisitGotoCaseStatement(GotoCaseStatement node)
{
NotSupported(node);
}
示例9: VisitGotoCaseStatement
public void VisitGotoCaseStatement(GotoCaseStatement gotoCaseStatement)
{
JsonObject statement = CreateJsonStatement(gotoCaseStatement);
AddKeyword(statement, GotoCaseStatement.GotoKeywordRole);
AddKeyword(statement, "case-keyword", GotoCaseStatement.CaseKeywordRole);
statement.AddJsonValue("label-expression", GenExpression(gotoCaseStatement.LabelExpression));
Push(statement);
//implement already, but not tested
throw new FirstTimeUseException();
}
示例10: GotoStatement
private void GotoStatement(out ICSharpCode.NRefactory.Parser.AST.Statement stmt)
{
stmt = null;
base.Expect(0x4d);
if (this.la.kind == 1)
{
base.lexer.NextToken();
stmt = new ICSharpCode.NRefactory.Parser.AST.GotoStatement(this.t.val);
base.Expect(11);
}
else if (this.la.kind == 0x36)
{
Expression expression;
base.lexer.NextToken();
this.Expr(out expression);
base.Expect(11);
stmt = new GotoCaseStatement(expression);
}
else if (this.la.kind == 0x3e)
{
base.lexer.NextToken();
base.Expect(11);
stmt = new GotoCaseStatement(null);
}
else
{
base.SynErr(0xae);
}
}
示例11: VisitGotoCaseStatement
public virtual object VisitGotoCaseStatement(GotoCaseStatement gotoCaseStatement, object data) {
throw new global::System.NotImplementedException("GotoCaseStatement");
}
示例12: VisitGotoCaseStatement
public virtual object VisitGotoCaseStatement(GotoCaseStatement gotoCaseStatement, object data) {
Debug.Assert((gotoCaseStatement != null));
Debug.Assert((gotoCaseStatement.Expression != null));
nodeStack.Push(gotoCaseStatement.Expression);
gotoCaseStatement.Expression.AcceptVisitor(this, data);
gotoCaseStatement.Expression = ((Expression)(nodeStack.Pop()));
return null;
}
示例13: AcceptGotoCase
public void AcceptGotoCase(GotoCaseStatement stmt)
{
SimpleResult(stmt);
}
示例14: AcceptGotoCase
/// <summary>
/// Transforms a "goto case" statement. The default implementation places a new "goto case"
/// statement inside the current case selection.
/// </summary>
/// <param name="stmt">"goto case" statement</param>
public virtual void AcceptGotoCase(GotoCaseStatement stmt)
{
GotoCase(_caseMap[stmt.CaseStmt], stmt.TargetIndex);
CopyAttributesToLastStatement(stmt);
}
示例15: VisitGotoCaseStatement
public override void VisitGotoCaseStatement(GotoCaseStatement gotoCaseStatement)
{
_errorReporter.Message(7998, gotoCaseStatement.GetRegion(), "goto case");
_result = false;
}