コード例 #1
0
        private bool ExpectIdentifier(ref TokenInfo tokenInfo)
        {
            tokenInfo = GetNextToken();

            if (tokenInfo.Is(Token.Identifier))
            {
                return true;
            }

            Report.AddItem(VBErrors.IdentifierExpected, SourceFile,
                           new SourceSpan(tokenInfo.GetSourceLocation(), default(SourceLocation)),
                           null);

            return false;
        }
コード例 #2
0
        private bool Expect(Token token, ref TokenInfo tokenInfo, string message)
        {
            tokenInfo = GetNextToken();

            if (tokenInfo.Is(token))
            {
                return true;
            }

            Report.AddError("?", message, tokenInfo.SourceFile,
                            new SourceSpan(tokenInfo.GetSourceLocation(), default(SourceLocation)),
                            null);

            return false;
        }