private void fixed(char ch) throws FHIRException { boolean b = gchar(ch); rule(b, "Expected character \""+ch+"\" but found "+peek()); ws(); }
private void refinements(Expression expr) throws FHIRException { boolean n = true; while (n) { if (peek() != '{') expr.refinements.add(attribute()); else expr.refinementGroups.add(attributeGroup()); ws(); n = gchar(','); ws(); } }
private Expression attributeValue() throws FHIRException { Expression res; ws(); if (gchar('(')) { res = expression(); fixed(')'); } else { res = expression(); } return res; }
private RefinementGroup attributeGroup() throws FHIRException { RefinementGroup res = new RefinementGroup(); fixed('{'); ws(); res.setStart(cursor); res.refinements.add(attribute()); while (gchar(',')) res.refinements.add(attribute()); res.setStop(cursor); ws(); fixed('}'); ws(); return res; }
private Expression parse() throws FHIRException { Expression res = new Expression(); res.setStart(cursor); ws(); if (peek() == '=') { res.status = ExpressionStatus.Equivalent; prefix('='); } else if (peek() == '<') { res.status = ExpressionStatus.SubsumedBy; prefix('<'); } res.concepts.add(concept()); while (gchar('+')) res.concepts.add(concept()); if (gchar(':')) { ws(); refinements(res); } res.setStop(cursor); rule(cursor >= source.length(), "Found content (\""+peekDisp()+"\") after end of expression"); return res; }
private Concept attributeName() throws FHIRException { Concept res = new Concept(); res.setStart(cursor); ws(); res.code = conceptId(); ws(); if (gchar('|')) { ws(); res.description = term(); ws(); fixed('|'); ws(); } res.setStop(cursor); return res; }
private Concept concept() throws FHIRException { Concept res = new Concept(); res.setStart(cursor); ws(); if (peek() == '#') res.decimal = decimal(); else if (peek() == '"') res.literal = stringConstant(); else res.code = conceptId(); ws(); if (gchar('|')) { ws(); res.description = term().trim(); ws(); fixed('|'); ws(); } res.setStop(cursor); return res; }
private void fixed(char ch) throws FHIRException { boolean b = gchar(ch); rule(b, "Expected character \""+ch+"\" but found "+peek()); ws(); }
private void refinements(Expression expr) throws FHIRException { boolean n = true; while (n) { if (peek() != '{') expr.refinements.add(attribute()); else expr.refinementGroups.add(attributeGroup()); ws(); n = gchar(','); ws(); } }
private Expression attributeValue() throws FHIRException { Expression res; ws(); if (gchar('(')) { res = expression(); fixed(')'); } else { res = expression(); } return res; }
private Expression parse() throws FHIRException { Expression res = new Expression(); res.setStart(cursor); ws(); if (peek() == '=') { res.status = ExpressionStatus.Equivalent; prefix('='); } else if (peek() == '<') { res.status = ExpressionStatus.SubsumedBy; prefix('<'); } res.concepts.add(concept()); while (gchar('+')) res.concepts.add(concept()); if (gchar(':')) { ws(); refinements(res); } res.setStop(cursor); rule(cursor >= source.length(), "Found content (\""+peekDisp()+"\") after end of expression"); return res; }
private RefinementGroup attributeGroup() throws FHIRException { RefinementGroup res = new RefinementGroup(); fixed('{'); ws(); res.setStart(cursor); res.refinements.add(attribute()); while (gchar(',')) res.refinements.add(attribute()); res.setStop(cursor); ws(); fixed('}'); ws(); return res; }
private Concept attributeName() throws FHIRException { Concept res = new Concept(); res.setStart(cursor); ws(); res.code = conceptId(); ws(); if (gchar('|')) { ws(); res.description = term(); ws(); fixed('|'); ws(); } res.setStop(cursor); return res; }
private Concept concept() throws FHIRException { Concept res = new Concept(); res.setStart(cursor); ws(); if (peek() == '#') res.decimal = decimal(); else if (peek() == '"') res.literal = stringConstant(); else res.code = conceptId(); ws(); if (gchar('|')) { ws(); res.description = term().trim(); ws(); fixed('|'); ws(); } res.setStop(cursor); return res; }