// // 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); }
public NestedTypeName(string nestedTypeName, NamedTypeName declaringType) { _nestedTypeName = nestedTypeName; _declaringType = declaringType; }
public ConstructedGenericTypeName(NamedTypeName genericTypeDefinition, IList<TypeName> genericTypeArguments) { _genericTypeDefinition = genericTypeDefinition; _genericTypeArguments = genericTypeArguments; }
public ConstructedGenericTypeName(NamedTypeName genericTypeDefinition, IList <TypeName> genericTypeArguments) { _genericTypeDefinition = genericTypeDefinition; _genericTypeArguments = genericTypeArguments; }
public ConstructedGenericTypeName(NamedTypeName genericType, IEnumerable<TypeName> genericArguments) { GenericType = genericType; GenericArguments = genericArguments; }
public NestedTypeName(String name, NamedTypeName declaringType) { Name = name; DeclaringType = declaringType; }
public NestedTypeName(string name, NamedTypeName declaringType) { Name = name; DeclaringType = declaringType; }
public ConstructedGenericTypeName(NamedTypeName genericType, IEnumerable <TypeName> genericArguments) { GenericType = genericType; GenericArguments = genericArguments; }