protected NamedClassMemberSyntax(SyntaxToken name) { Requires.NotNull(name, nameof(name)); SyntaxRequires.TypeIs(name, SyntaxTokenType.Identifier, nameof(name)); Name = name; }
public IdentifierNameSyntax(SyntaxToken identifier) { Requires.NotNull(identifier, nameof(identifier)); SyntaxRequires.TypeIs(identifier, SyntaxTokenType.Identifier, nameof(identifier)); Identifier = identifier; }
public PredefinedTypeSyntax(SyntaxToken name) { Requires.NotNull(name, nameof(name)); SyntaxRequires.TypeIs(name, SyntaxTokenType.PredefinedType, nameof(name)); Name = name; // TODO really parse the type name }
public MemberAccessSyntax(ExpressionSyntax expression, SyntaxToken member) { Requires.NotNull(expression, nameof(expression)); Requires.NotNull(member, nameof(member)); SyntaxRequires.TypeIs(member, SyntaxTokenType.Identifier, nameof(member)); Expression = expression; Member = member; }
public ConstructorSyntax(Accessibility access, SyntaxToken name, IEnumerable <ParameterSyntax> parameters, IEnumerable <StatementSyntax> body) { Requires.EnumDefined(access, nameof(access)); SyntaxRequires.TypeIs(name, SyntaxTokenType.Identifier, nameof(name)); Access = access; Name = name; Parameters = parameters.ToList(); Body = body.ToList(); }
protected EntitySyntax( Accessibility accessibility, SyntaxToken name) { Requires.EnumIn(accessibility, nameof(accessibility), Accessibility.Public, Accessibility.Package); Requires.NotNull(name, nameof(name)); SyntaxRequires.TypeIs(name, SyntaxTokenType.Identifier, nameof(name)); Accessibility = accessibility; Name = name; }
public NamespaceSyntax(IEnumerable <SyntaxToken> names, IEnumerable <UsingSyntax> usingDirectives, IEnumerable <DeclarationSyntax> declarations) { Names = names.ToList(); Requires.That(Names.Count > 0, nameof(names), "Must be at least one name"); foreach (var token in Names) { Requires.NotNull(token, "name"); SyntaxRequires.TypeIs(token, SyntaxTokenType.Identifier, "name"); } UsingDirectives = usingDirectives.ToList(); Members = declarations.ToList(); }