private static UnifiedExpression CreateNext(XElement node) { Contract.Requires(node != null); Contract.Requires(node.Name() == "next"); return (UnifiedContinue.Create( CreateSmartExpresion(node.FirstElementOrDefault()))); }
public static UnifiedExpression CreateJumpStatement(XElement node) { Contract.Requires(node != null); Contract.Requires(node.Name() == "jump_statement"); /* jump_statement * : 'goto' IDENTIFIER ';' * | 'continue' ';' * | 'break' ';' * | 'return' ';' * | 'return' expression ';' */ var firstElement = node.FirstElement(); switch (firstElement.Value) { case "goto": return (UnifiedGoto.Create( UnifiedLabelIdentifier.Create( node.NthElement(1).Value))); case "continue": return(UnifiedContinue.Create()); case "break": return(UnifiedBreak.Create()); case "return": var expression = node.Element("expression"); if (expression != null) { return (UnifiedReturn.Create( CreateExpression(expression).First())); } return(UnifiedReturn.Create()); default: throw new InvalidOperationException(); } }
public override bool Visit(UnifiedContinue element, VisitorArgument arg) { Writer.Write("continue "); return(true); }
public override bool Visit(UnifiedContinue element, VisitorArgument arg) { Writer.Write("continue "); element.Value.TryAccept(this, arg); return(true); }
public override bool Visit(UnifiedContinue element, VisitorArgument arg) { Writer.Write("continue "); return true; }
public UnifiedElement VisitContinueStatement( ContinueStatement stmt, object data) { return(UnifiedContinue.Create()); }
public override bool Visit(UnifiedContinue element, VisitorArgument arg) { Writer.Write("continue "); element.Value.TryAccept(this, arg); return true; }