Exemplo n.º 1
0
        private void ParseStatementList()
        {
            var firstSetOfStatement1 = new[]
            {
                TokenKind.Let, TokenKind.Print
            };

            MatchOneOf(firstSetOfStatement1);
            ParseStatement();
            _astBuilder.StmtEnd(_scanner.CurrentToken);
            Match(TokenKind.Semicolon);
            _scanner.Advance();
            var firstSetOfKleeneStar1 = new[]
            {
                TokenKind.Let, TokenKind.Print
            };

            while (firstSetOfKleeneStar1.Contains(_scanner.CurrentToken.TokenKind))
            {
                ParseStatement();
                _astBuilder.StmtEnd(_scanner.CurrentToken);
                Match(TokenKind.Semicolon);
                _scanner.Advance();
            }
        }