Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is .( ever legal in C# or VB.Net?

Tags:

syntax

c#

vb.net

Can the sequence .( ever appear in C# or VB.Net code?
(Not in a string, comment, or XML literal, EDIT: or preprocessor directive)

I'm reasonably certain that the answer is no, but I'd like to make sure.

like image 538
SLaks Avatar asked Apr 07 '11 13:04

SLaks


1 Answers

The only places that . appears in the grammar are:

real-literal:     decimal-digits   .   decimal-digits ...     .   decimal-digits ...  namespace-or-type-name:     namespace-or-type-name   .   identifier ...   member-access:     primary-expression   .   identifier ...     predefined-type   .   identifier ...  qualified-alias-member   .   identifier ...  base-access:     base   .   identifier  unbound-type-name:     unbound-type-name   .   identifier  qualified-identifier:      qualified-identifier   .   identifier  member-name:     interface-type   .   identifier  indexer-declarator:     type   interface-type   .   this    

(The ... means I have elided the remainder of the production rule.) In none of these cases is a .( valid as . is either followed by digits, a valid identifier, or the keyword this.

like image 192
jason Avatar answered Sep 19 '22 17:09

jason