Ejemplo n.º 1
0
        public override QLSNode VisitQuestion(QuestionContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("Context can't be null.");
            }

            string id = context.ID().GetText();

            if (context.widgetspecification() != null)
            {
                var widgetSpecificaitonVisitor = new WidgetSpecificationVisitor();
                var specification = widgetSpecificaitonVisitor.VisitWidgetspecification(context.widgetspecification());

                var qlsNode = new QLSQuestionNode(Location.FromContext(context), id, new List <QLSStyle>()
                {
                    new QLSStyle(QValueType.Unknown, specification)
                });
                return(qlsNode);
            }
            else
            {
                var qlsNode = new QLSQuestionNode(Location.FromContext(context), id);
                return(qlsNode);
            }
        }
Ejemplo n.º 2
0
        public override QLSStyle VisitDefaults([NotNull] QLSGrammarParser.DefaultsContext context)
        {
            var specificationVisitor = new WidgetSpecificationVisitor();
            var specification        = specificationVisitor.VisitWidgetspecification(context.widgetspecification());
            var qtype = Util.GetQValueTypeFromString(context.QTYPE().GetText());
            var style = new QLSStyle(qtype, specification);

            foreach (var ctx in context.stylevalue())
            {
                style.AddStyleValue(GetStylevalue(ctx));
            }

            return(style);
        }