O'Reilly logo

C# Primer Plus by Klaus Michelsen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Namespace Syntax

On the basis of our previous namespace discussion, we can deduce the syntax for writing compilation units, using statements, and namespaces. This has been done in Syntax Box 15.1, which makes heavy use of the optional [] brackets because the using statements, namespace definitions, and type definitions in a compilation unit and inside a namespace are optional.

Syntax Box 15.1 Compilation Units, Using Statements and Namespaces

						Compilation_unit::=
						
						[[<using_statement_1>]
						[<using_statement_2>]
						...]
						[[<Namespace_definition_1>]
						[<Namespace_definition_2>]
						...]
						[[<Type_definition_1>]
						[<Type_definition_2>]
						...]
					

where

						<using_statement> ::=
              using <Namespace_name> ;

<Namespace_definition>::=
						<Short_namespace_name>
						{
						[[<using_statement_1>] ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required