public String take() throws FHIRLexerException { String s = current; next(); return s; }
lexer.next(); result.setKind(Kind.Group); result.setGroup(parseExpression(lexer, true)); throw lexer.error("Found "+lexer.getCurrent()+" expecting a \")\""); result.setEnd(lexer.getCurrentLocation()); lexer.next(); } else { if (!lexer.isToken() && !lexer.getCurrent().startsWith("\"")) lexer.next(); while (!")".equals(lexer.getCurrent())) { result.getParameters().add(parseExpression(lexer, true)); if (",".equals(lexer.getCurrent())) lexer.next(); else if (!")".equals(lexer.getCurrent())) throw lexer.error("The token "+lexer.getCurrent()+" is not expected here - either a \",\" or a \")\" expected"); lexer.next(); checkParameters(lexer, c, result, details); } else lexer.next(); ExpressionNode item = new ExpressionNode(lexer.nextId()); item.setKind(Kind.Function); if (!lexer.getCurrent().equals("]")) throw lexer.error("The token "+lexer.getCurrent()+" is not expected here - a \"]\" expected"); lexer.next();
public void skipToken(String token) throws FHIRLexerException { if (getCurrent().equals(token)) next(); } public String takeDottedToken() throws FHIRLexerException {
public FHIRLexer(String source, String name) throws FHIRLexerException { this.source = source; this.name = name == null ? "??" : name; currentLocation = new SourceLocation(1, 1); next(); } public FHIRLexer(String source, int i) throws FHIRLexerException {
public FHIRLexer(String source, int i) throws FHIRLexerException { this.source = source; this.cursor = i; currentLocation = new SourceLocation(1, 1); next(); } public String getCurrent() {
public void token(String kw) throws FHIRLexerException { if (!kw.equals(current)) throw error("Found \""+current+"\" expecting \""+kw+"\""); next(); }
public int takeInt() throws FHIRLexerException { String s = current; if (!Utilities.isInteger(s)) throw error("Found "+current+" expecting an integer"); next(); return Integer.parseInt(s); }
void skipComments() throws FHIRLexerException { while (!done() && hasComment()) next(); } public int getCurrentStart() {
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 parseRuleReference(StructureMapGroupRuleComponent rule, FHIRLexer lexer) throws FHIRLexerException { StructureMapGroupRuleDependentComponent ref = rule.addDependent(); ref.setName(lexer.take()); lexer.token("("); boolean done = false; while (!done) { ref.addVariable(lexer.take()); done = !lexer.hasToken(","); if (!done) lexer.next(); } lexer.token(")"); }
public String take() throws FHIRLexerException { String s = current; next(); return s; }
public void token(String kw) throws FHIRLexerException { if (!kw.equals(current)) throw error("Found \""+current+"\" expecting \""+kw+"\""); next(); }
public void skipToken(String token) throws FHIRLexerException { if (getCurrent().equals(token)) next(); } public String takeDottedToken() throws FHIRLexerException {
public FHIRLexer(String source, String name) throws FHIRLexerException { this.source = source; this.name = name == null ? "??" : name; currentLocation = new SourceLocation(1, 1); next(); } public FHIRLexer(String source, int i) throws FHIRLexerException {
public FHIRLexer(String source, int i) throws FHIRLexerException { this.source = source; this.cursor = i; currentLocation = new SourceLocation(1, 1); next(); } public String getCurrent() {
public int takeInt() throws FHIRLexerException { String s = current; if (!Utilities.isInteger(s)) throw error("Found "+current+" expecting an integer"); next(); return Integer.parseInt(s); }
void skipComments() throws FHIRLexerException { while (!done() && hasComment()) next(); } public int getCurrentStart() {