private void parseImports(StructureMap result, FHIRLexer lexer) throws FHIRException { lexer.token("imports"); result.addImport(lexer.readConstant("url")); lexer.skipToken(";"); if (lexer.hasComment()) { lexer.next(); } lexer.skipComments(); }
private void parseUses(StructureMap result, FHIRLexer lexer) throws FHIRException { lexer.token("uses"); StructureMapStructureComponent st = result.addStructure(); st.setUrl(lexer.readConstant("url")); if (lexer.hasToken("alias")) { lexer.token("alias"); st.setAlias(lexer.take()); } lexer.token("as"); st.setMode(StructureMapModelMode.fromCode(lexer.take())); lexer.skipToken(";"); if (lexer.hasComment()) { st.setDocumentation(lexer.take().substring(2).trim()); } lexer.skipComments(); }
private void parseInput(StructureMapGroupComponent group, FHIRLexer lexer, boolean newFmt) throws FHIRException { StructureMapGroupInputComponent input = group.addInput(); if (newFmt) { input.setMode(StructureMapInputMode.fromCode(lexer.take())); } else lexer.token("input"); input.setName(lexer.take()); if (lexer.hasToken(":")) { lexer.token(":"); input.setType(lexer.take()); } if (!newFmt) { lexer.token("as"); input.setMode(StructureMapInputMode.fromCode(lexer.take())); if (lexer.hasComment()) { input.setDocumentation(lexer.take().substring(2).trim()); } lexer.skipToken(";"); lexer.skipComments(); } }
public StructureMap parse(String text, String srcName) throws FHIRException { FHIRLexer lexer = new FHIRLexer(text, srcName); if (lexer.done()) throw lexer.error("Map Input cannot be empty"); lexer.skipComments(); lexer.token("map"); StructureMap result = new StructureMap(); result.setUrl(lexer.readConstant("url")); lexer.token("="); result.setName(lexer.readConstant("name")); lexer.skipComments(); while (lexer.hasToken("conceptmap")) parseConceptMap(result, lexer); while (lexer.hasToken("uses")) parseUses(result, lexer); while (lexer.hasToken("imports")) parseImports(result, lexer); while (!lexer.done()) { parseGroup(result, lexer); } return result; }
rule.setDocumentation(lexer.take().substring(2).trim()); lexer.skipComments(); while (!lexer.hasToken("}")) { if (lexer.done()) lexer.skipComments();
lexer.skipComments(); if (newFmt) { while (!lexer.hasToken("}")) { if (newFmt && lexer.hasToken(";")) lexer.next(); lexer.skipComments();
private void parseImports(StructureMap result, FHIRLexer lexer) throws FHIRException { lexer.token("imports"); result.addImport(lexer.readConstant("url")); lexer.skipToken(";"); if (lexer.hasComment()) { lexer.next(); } lexer.skipComments(); }
private void parseUses(StructureMap result, FHIRLexer lexer) throws FHIRException { lexer.token("uses"); StructureMapStructureComponent st = result.addStructure(); st.setUrl(lexer.readConstant("url")); if (lexer.hasToken("alias")) { lexer.token("alias"); st.setAlias(lexer.take()); } lexer.token("as"); st.setMode(StructureMapModelMode.fromCode(lexer.take())); lexer.skipToken(";"); if (lexer.hasComment()) { st.setDocumentation(lexer.take().substring(2).trim()); } lexer.skipComments(); }
private void parseInput(StructureMapGroupComponent group, FHIRLexer lexer, boolean newFmt) throws FHIRException { StructureMapGroupInputComponent input = group.addInput(); if (newFmt) { input.setMode(StructureMapInputMode.fromCode(lexer.take())); } else lexer.token("input"); input.setName(lexer.take()); if (lexer.hasToken(":")) { lexer.token(":"); input.setType(lexer.take()); } if (!newFmt) { lexer.token("as"); input.setMode(StructureMapInputMode.fromCode(lexer.take())); if (lexer.hasComment()) { input.setDocumentation(lexer.take().substring(2).trim()); } lexer.skipToken(";"); lexer.skipComments(); } }
public StructureMap parse(String text, String srcName) throws FHIRException { FHIRLexer lexer = new FHIRLexer(text, srcName); if (lexer.done()) throw lexer.error("Map Input cannot be empty"); lexer.skipComments(); lexer.token("map"); StructureMap result = new StructureMap(); result.setUrl(lexer.readConstant("url")); lexer.token("="); result.setName(lexer.readConstant("name")); lexer.skipComments(); while (lexer.hasToken("conceptmap")) parseConceptMap(result, lexer); while (lexer.hasToken("uses")) parseUses(result, lexer); while (lexer.hasToken("imports")) parseImports(result, lexer); while (!lexer.done()) { parseGroup(result, lexer); } return result; }
rule.setDocumentation(lexer.take().substring(2).trim()); lexer.skipComments(); while (!lexer.hasToken("}")) { if (lexer.done()) lexer.skipComments();
lexer.skipComments(); if (newFmt) { while (!lexer.hasToken("}")) { if (newFmt && lexer.hasToken(";")) lexer.next(); lexer.skipComments();