Exemple #1
0
        public override void ExitFoxaddobjectclause([NotNull] XP.FoxaddobjectclauseContext context)
        {
            var modifiers = context.Modifiers?.GetList <SyntaxToken>() ?? TokenList(SyntaxKind.PublicKeyword);
            var datatype  = context.Type.Get <TypeSyntax>();
            var name      = context.Id.GetText();
            var prop      = createProperty(name, datatype, context, context.Modifiers);

            context.Put(prop);
        }
Exemple #2
0
        public ExpressionSyntax createAddObject(XP.FoxaddobjectclauseContext context)
        {
            InitializerExpressionSyntax init = null;

            if (context._FieldsInits.Count > 0)
            {
                init = _syntaxFactory.InitializerExpression(
                    SyntaxKind.ObjectInitializerExpression,
                    SyntaxFactory.MakeToken(SyntaxKind.OpenBraceToken),
                    MakeSeparatedList <ExpressionSyntax>(context._FieldsInits),
                    SyntaxFactory.MakeToken(SyntaxKind.CloseBraceToken));
            }
            return(CreateObject(context.Type.Get <TypeSyntax>(), EmptyArgumentList(), init));
        }