//
        // Foo or Foo+Inner or Foo[String] or Foo+Inner[String]
        //
        private NonQualifiedTypeName ParseNamedOrConstructedGenericTypeName()
        {
            NamedTypeName namedType = ParseNamedTypeName();

            // Because "[" is used both for generic arguments and array indexes, we must peek two characters deep.
            if (!(_lexer.Peek == TokenType.OpenSqBracket && (_lexer.PeekSecond == TokenType.Other || _lexer.PeekSecond == TokenType.OpenSqBracket)))
            {
                return(namedType);
            }
            else
            {
                _lexer.Skip();
                LowLevelListWithIList <TypeName> genericTypeArguments = new LowLevelListWithIList <TypeName>();
                for (;;)
                {
                    TypeName genericTypeArgument = ParseGenericTypeArgument();
                    genericTypeArguments.Add(genericTypeArgument);
                    TokenType token = _lexer.GetNextToken();
                    if (token == TokenType.CloseSqBracket)
                    {
                        break;
                    }
                    if (token != TokenType.Comma)
                    {
                        throw new ArgumentException();
                    }
                }

                return(new ConstructedGenericTypeName(namedType, genericTypeArguments));
            }
        }
        //
        // Foo or Foo+Inner
        //
        private NamedTypeName ParseNamedTypeName()
        {
            NamedTypeName namedType = ParseNamespaceTypeName();

            while (_lexer.Peek == TokenType.Plus)
            {
                _lexer.Skip();
                String nestedTypeName = _lexer.GetNextIdentifier();
                namedType = new NestedTypeName(nestedTypeName, namedType);
            }
            return(namedType);
        }
Esempio n. 3
0
 public NestedTypeName(string nestedTypeName, NamedTypeName declaringType)
 {
     _nestedTypeName = nestedTypeName;
     _declaringType = declaringType;
 }
Esempio n. 4
0
 public ConstructedGenericTypeName(NamedTypeName genericTypeDefinition, IList<TypeName> genericTypeArguments)
 {
     _genericTypeDefinition = genericTypeDefinition;
     _genericTypeArguments = genericTypeArguments;
 }
Esempio n. 5
0
 public ConstructedGenericTypeName(NamedTypeName genericTypeDefinition, IList <TypeName> genericTypeArguments)
 {
     _genericTypeDefinition = genericTypeDefinition;
     _genericTypeArguments  = genericTypeArguments;
 }
Esempio n. 6
0
 public NestedTypeName(string nestedTypeName, NamedTypeName declaringType)
 {
     _nestedTypeName = nestedTypeName;
     _declaringType  = declaringType;
 }
Esempio n. 7
0
 public ConstructedGenericTypeName(NamedTypeName genericType, IEnumerable<TypeName> genericArguments)
 {
     GenericType = genericType;
     GenericArguments = genericArguments;
 }
Esempio n. 8
0
 public NestedTypeName(String name, NamedTypeName declaringType)
 {
     Name = name;
     DeclaringType = declaringType;
 }
Esempio n. 9
0
 public NestedTypeName(string name, NamedTypeName declaringType)
 {
     Name          = name;
     DeclaringType = declaringType;
 }
Esempio n. 10
0
 public ConstructedGenericTypeName(NamedTypeName genericType, IEnumerable <TypeName> genericArguments)
 {
     GenericType      = genericType;
     GenericArguments = genericArguments;
 }