public ExpressionNode parse(String path, String name) throws FHIRLexerException { FHIRLexer lexer = new FHIRLexer(path, name); if (lexer.done()) throw lexer.error("Path cannot be empty"); ExpressionNode result = parseExpression(lexer, true); if (!lexer.done()) throw lexer.error("Premature ExpressionNode termination at unexpected token \""+lexer.getCurrent()+"\""); result.check(); return result; }
/** * Parse a path for later use using execute * * @param path * @return * @throws PathEngineException * @throws Exception */ public ExpressionNodeWithOffset parsePartial(String path, int i) throws FHIRLexerException { FHIRLexer lexer = new FHIRLexer(path, i); if (lexer.done()) throw lexer.error("Path cannot be empty"); ExpressionNode result = parseExpression(lexer, true); result.check(); return new ExpressionNodeWithOffset(lexer.getCurrentStart(), result); }
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; }
/** * Parse a path for later use using execute * * @param path * @return * @throws PathEngineException * @throws Exception */ public ExpressionNodeWithOffset parsePartial(String path, int i) throws FHIRLexerException { FHIRLexer lexer = new FHIRLexer(path, i); if (lexer.done()) throw lexer.error("Path cannot be empty"); ExpressionNode result = parseExpression(lexer, true); result.check(); return new ExpressionNodeWithOffset(lexer.getCurrentStart(), result); }
public ExpressionNode parse(String path, String name) throws FHIRLexerException { FHIRLexer lexer = new FHIRLexer(path, name); if (lexer.done()) throw lexer.error("Path cannot be empty"); ExpressionNode result = parseExpression(lexer, true); if (!lexer.done()) throw lexer.error("Premature ExpressionNode termination at unexpected token \""+lexer.getCurrent()+"\""); result.check(); return result; }
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; }