private void fixed(char ch) throws FHIRException { boolean b = gchar(ch); rule(b, "Expected character \""+ch+"\" but found "+peek()); ws(); }
private void prefix(char c) throws FHIRException { fixed(c); fixed(c); fixed(c); ws(); }
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 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 Refinement attribute() throws FHIRException { Refinement res = new Refinement(); res.setStart(cursor); res.name = attributeName(); fixed('='); res.value = attributeValue(); ws(); res.setStop(cursor); return res; }
private void prefix(char c) throws FHIRException { fixed(c); fixed(c); fixed(c); ws(); }
private void fixed(char ch) throws FHIRException { boolean b = gchar(ch); rule(b, "Expected character \""+ch+"\" but found "+peek()); ws(); }
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 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 Refinement attribute() throws FHIRException { Refinement res = new Refinement(); res.setStart(cursor); res.name = attributeName(); fixed('='); res.value = attributeValue(); ws(); res.setStop(cursor); return res; }