public static void CheckForIndexStatement(RangeFinderState s, ForIndexStatement a) { CheckAny(s, a.InitializerStatement); CheckAny(s, a.ConditionExpr); CheckAny(s, a.NextStatement); CheckAny(s, a.Body); }
private static ForIndexStatement ParseForIndexStatementTail(ParserState s, Token id) { var result = new ForIndexStatement(); if (id != null) { var initExpr = new BinaryOperatorExpression { Lhs = id, Op = s.Token }; ReadToken(s); initExpr.Rhs = ParseExpression(s, 0, false); result.InitializerStatement = new ExpressionStatement { Expr = initExpr }; } ParseTokenWithType(s, TokenType.Semicolon); result.ConditionExpr = ParseExpression(s, 0, false); if (s.Token.Type == TokenType.Semicolon || id == null) { ParseTokenWithType(s, TokenType.Semicolon); result.NextStatement = ParseExpressionStatement(s, false); } result.Body = ParseBlockStatement(s); return(result); }
public static void PrintForIndexStatement(PrintState s, ForIndexStatement a) { PrintLine(s, "ForIndexStatement"); Indent(s); PrintDescWithAny(s, "InitializerStatement", a.InitializerStatement); PrintDescWithAny(s, "ConditionExpr", a.ConditionExpr); PrintDescWithAny(s, "NextStatement", a.NextStatement); PrintDescWithAny(s, "Body", a.Body); UnIndent(s); }