protected NamedClassMemberSyntax(SyntaxToken name)
        {
            Requires.NotNull(name, nameof(name));
            SyntaxRequires.TypeIs(name, SyntaxTokenType.Identifier, nameof(name));

            Name = name;
        }
示例#2
0
        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
        }
示例#4
0
        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();
        }
示例#6
0
        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;
        }
示例#7
0
 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();
 }