public override object Visit(ThrowStatement throwStatement, object data) { ProcessSpecials(throwStatement.Specials); CodeThrowExceptionStatement throwStmt = new CodeThrowExceptionStatement((CodeExpression)throwStatement.ThrowExpression.AcceptVisitor(this, data)); // Add Statement to Current Statement Collection AddStmt(throwStmt); return throwStmt; }
public override object Visit(ThrowStatement throwStatement, object data) { DebugOutput(throwStatement); AppendIndentation();sourceText.Append("Throw "); sourceText.Append(throwStatement.ThrowExpression.AcceptVisitor(this, data).ToString()); AppendNewLine(); return null; }
public override object Visit(ThrowStatement throwStatement, object data) { Console.WriteLine(throwStatement.ToString()); return throwStatement.AcceptChildren(this, data); }
public virtual object Visit(ThrowStatement throwStatement, object data) { if (throwStatement.ThrowExpression == null) { return data; } return throwStatement.ThrowExpression.AcceptVisitor(this, data); }
void EmbeddedStatement( #line 1564 "cs.ATG" out Statement statement) { #line 1566 "cs.ATG" TypeReference type = null; Expression expr = null; Statement embeddedStatement = null; statement = null; if (la.kind == 14) { Block( #line 1572 "cs.ATG" out statement); } else if (la.kind == 10) { lexer.NextToken(); #line 1574 "cs.ATG" statement = new EmptyStatement(); } else if ( #line 1576 "cs.ATG" IdentIsYield ()) { Expect(1); if (la.kind == 100) { lexer.NextToken(); Expr( #line 1577 "cs.ATG" out expr); } else if (la.kind == 52) { lexer.NextToken(); } else SynErr(169); Expect(10); #line 1577 "cs.ATG" statement = new YieldStatement(expr); } else if ( #line 1579 "cs.ATG" UnCheckedAndLBrace()) { #line 1579 "cs.ATG" Statement block; bool isChecked = true; if (la.kind == 57) { lexer.NextToken(); } else if (la.kind == 117) { lexer.NextToken(); #line 1580 "cs.ATG" isChecked = false; } else SynErr(170); Block( #line 1581 "cs.ATG" out block); #line 1581 "cs.ATG" statement = isChecked ? (Statement)new CheckedStatement(block) : (Statement)new UncheckedStatement(block); } else if (StartOf(4)) { StatementExpr( #line 1583 "cs.ATG" out statement); Expect(10); } else if (la.kind == 78) { lexer.NextToken(); #line 1585 "cs.ATG" Statement elseStatement = null; Expect(18); Expr( #line 1586 "cs.ATG" out expr); Expect(19); EmbeddedStatement( #line 1587 "cs.ATG" out embeddedStatement); if (la.kind == 66) { lexer.NextToken(); EmbeddedStatement( #line 1588 "cs.ATG" out elseStatement); } #line 1589 "cs.ATG" statement = elseStatement != null ? (Statement)new IfElseStatement(expr, embeddedStatement, elseStatement) : (Statement)new IfStatement(expr, embeddedStatement); } else if (la.kind == 109) { lexer.NextToken(); #line 1590 "cs.ATG" ArrayList switchSections = new ArrayList(); Expect(18); Expr( #line 1591 "cs.ATG" out expr); Expect(19); Expect(14); while (la.kind == 54 || la.kind == 62) { SwitchSection( #line 1592 "cs.ATG" out statement); #line 1592 "cs.ATG" switchSections.Add(statement); } Expect(15); #line 1593 "cs.ATG" statement = new SwitchStatement(expr, switchSections); } else if (la.kind == 124) { lexer.NextToken(); Expect(18); Expr( #line 1595 "cs.ATG" out expr); Expect(19); EmbeddedStatement( #line 1596 "cs.ATG" out embeddedStatement); #line 1596 "cs.ATG" statement = new WhileStatement(expr, embeddedStatement); } else if (la.kind == 64) { lexer.NextToken(); EmbeddedStatement( #line 1597 "cs.ATG" out embeddedStatement); Expect(124); Expect(18); Expr( #line 1598 "cs.ATG" out expr); Expect(19); Expect(10); #line 1598 "cs.ATG" statement = new DoWhileStatement(expr, embeddedStatement); } else if (la.kind == 75) { lexer.NextToken(); #line 1599 "cs.ATG" ArrayList initializer = null, iterator = null; Expect(18); if (StartOf(4)) { ForInitializer( #line 1600 "cs.ATG" out initializer); } Expect(10); if (StartOf(4)) { Expr( #line 1601 "cs.ATG" out expr); } Expect(10); if (StartOf(4)) { ForIterator( #line 1602 "cs.ATG" out iterator); } Expect(19); EmbeddedStatement( #line 1603 "cs.ATG" out embeddedStatement); #line 1603 "cs.ATG" statement = new ForStatement(initializer, expr, iterator, embeddedStatement); } else if (la.kind == 76) { lexer.NextToken(); Expect(18); Type( #line 1604 "cs.ATG" out type); Expect(1); #line 1604 "cs.ATG" string varName = t.val; Expect(80); Expr( #line 1605 "cs.ATG" out expr); Expect(19); EmbeddedStatement( #line 1606 "cs.ATG" out embeddedStatement); #line 1606 "cs.ATG" statement = new ForeachStatement(type, varName , expr, embeddedStatement); statement.EndLocation = t.EndLocation; } else if (la.kind == 52) { lexer.NextToken(); Expect(10); #line 1610 "cs.ATG" statement = new BreakStatement(); } else if (la.kind == 60) { lexer.NextToken(); Expect(10); #line 1611 "cs.ATG" statement = new ContinueStatement(); } else if (la.kind == 77) { GotoStatement( #line 1612 "cs.ATG" out statement); } else if (la.kind == 100) { lexer.NextToken(); if (StartOf(4)) { Expr( #line 1613 "cs.ATG" out expr); } Expect(10); #line 1613 "cs.ATG" statement = new ReturnStatement(expr); } else if (la.kind == 111) { lexer.NextToken(); if (StartOf(4)) { Expr( #line 1614 "cs.ATG" out expr); } Expect(10); #line 1614 "cs.ATG" statement = new ThrowStatement(expr); } else if (la.kind == 113) { TryStatement( #line 1617 "cs.ATG" out statement); } else if (la.kind == 85) { lexer.NextToken(); Expect(18); Expr( #line 1619 "cs.ATG" out expr); Expect(19); EmbeddedStatement( #line 1620 "cs.ATG" out embeddedStatement); #line 1620 "cs.ATG" statement = new LockStatement(expr, embeddedStatement); } else if (la.kind == 120) { #line 1622 "cs.ATG" Statement resourceAcquisitionStmt = null; lexer.NextToken(); Expect(18); ResourceAcquisition( #line 1624 "cs.ATG" out resourceAcquisitionStmt); Expect(19); EmbeddedStatement( #line 1625 "cs.ATG" out embeddedStatement); #line 1625 "cs.ATG" statement = new UsingStatement(resourceAcquisitionStmt, embeddedStatement); } else if (la.kind == 118) { lexer.NextToken(); Block( #line 1627 "cs.ATG" out embeddedStatement); #line 1627 "cs.ATG" statement = new UnsafeStatement(embeddedStatement); } else if (la.kind == 73) { lexer.NextToken(); Expect(18); Type( #line 1630 "cs.ATG" out type); #line 1630 "cs.ATG" if (type.PointerNestingLevel == 0) Error("can only fix pointer types"); FixedStatement fxStmt = new FixedStatement(type); string identifier = null; Expect(1); #line 1634 "cs.ATG" identifier = t.val; Expect(3); Expr( #line 1635 "cs.ATG" out expr); #line 1635 "cs.ATG" fxStmt.PointerDeclarators.Add(new VariableDeclaration(identifier, expr)); while (la.kind == 12) { lexer.NextToken(); Expect(1); #line 1637 "cs.ATG" identifier = t.val; Expect(3); Expr( #line 1638 "cs.ATG" out expr); #line 1638 "cs.ATG" fxStmt.PointerDeclarators.Add(new VariableDeclaration(identifier, expr)); } Expect(19); EmbeddedStatement( #line 1640 "cs.ATG" out embeddedStatement); #line 1640 "cs.ATG" fxStmt.EmbeddedStatement = embeddedStatement; statement = fxStmt; } else SynErr(171); }
public override object Visit(ThrowStatement throwStatement, object data) { outputFormatter.Indent(); outputFormatter.PrintToken(Tokens.Throw); if (throwStatement.ThrowExpression != null) { outputFormatter.Space(); throwStatement.ThrowExpression.AcceptVisitor(this, data); } outputFormatter.PrintToken(Tokens.Semicolon); outputFormatter.NewLine(); return null; }