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); } }
public override QuestionNode VisitQuestion(QuestionContext context) { if (context == null) { throw new ArgumentNullException("Context can't be null"); } var id = context.ID().GetText(); var rawQuestionText = context.TEXT().GetText(); var question = Util.RemoveQuotes(rawQuestionText); var qtype = Util.GetQValueTypeFromString(context.QTYPE().GetText()); return(new QuestionNode(Location.FromContext(context), id, question, qtype)); }