Exemple #1
0
        private EntityName ParseEntityName(bool allowReservedWords, DiagnosticMessage diagnosticMessage = null)
        {
            var entity = (EntityName)ParseIdentifier();

            while (ParseOptional(SyntaxKind.DotToken))
            {
                using (var node = CreateNode <QualifiedName>(SyntaxKind.QualifiedName, entity.Pos, NodeStackOperation.PushAdd))
                {
                    node.Left  = entity;
                    node.Right = ParseRightSideOfDot(allowReservedWords);

                    Add(node.Left);
                    Add(node.Right);

                    entity = (EntityName)FinishNode(node);
                }
            }

            return(entity);
        }
Exemple #2
0
        private Identifier CreateIdentifier(bool isIdentifier, DiagnosticMessage diagnosticMessage = null)
        {
            identifierCount++;

            if (isIdentifier)
            {
                var node = CreateNode <Identifier>(SyntaxKind.Identifier);

                if (this.Token != SyntaxKind.Identifier)
                {
                    node.OriginalKeywordKind = this.Token;
                }

                node.Text = InternIdentifier(scanner.GetTokenValue());
                NextToken();

                return(FinishNode(node));
            }
            else
            {
                Debugger.Break();
                return(null);
            }
        }
Exemple #3
0
 private Identifier ParseIdentifier(DiagnosticMessage diagnosticMessage = null)
 {
     return(CreateIdentifier(IsIdentifier()));
 }
Exemple #4
0
        private CLRStringEntityName ParseCLRStringEntityName(bool allowReservedWords, DiagnosticMessage diagnosticMessage = null)
        {
            var entityName = (CLRStringEntityName)ParseEntityName(allowReservedWords, diagnosticMessage);

            if (LookAhead(NextTokenIsNumericLiteral))
            {
                NextToken();
                entityName.ArgCount = (NumericLiteral)(TokenNode)ParseLiteralNode();
            }

            return(entityName);
        }