public boolean consume(String s) { String r = rest(); if (r.isEmpty()) { return false; } if (r.startsWith(s)) { pos += s.length(); return true; } return false; }
public boolean consume(String s) { String r = rest(); if (r.isEmpty()) { return false; } if (r.startsWith(s)) { pos += s.length(); return true; } return false; }
public boolean consume(String s) { String r = rest(); if (r.isEmpty()) { return false; } if (r.startsWith(s)) { pos += s.length(); return true; } return false; }
private String getParseTag() { if (stream.eof()) { error("Expected an id tag, not end of file."); } if (stream.eol()) { error("Expected an id tag, not end of line"); } int i = stream.indexOf(':'); if (i == -1) { error("Could not find tag separator ':' in line."); } String tag = stream.rest().substring(0, i); stream.advance(i + 1); parseWs(); parseZeroOrMoreWs(); // Memory optimization // re-use the tag string OboFormatTag formatTag = OBOFormatConstants.getTag(tag); if (formatTag != null) { tag = formatTag.getTag(); } return mapDeprecatedTag(tag); }
private String getParseTag() { if (stream.eof()) { error("Expected an id tag, not end of file."); } if (stream.eol()) { error("Expected an id tag, not end of line"); } int i = stream.indexOf(':'); if (i == -1) { error("Could not find tag separator ':' in line."); } String tag = stream.rest().substring(0, i); stream.advance(i + 1); parseWs(); parseZeroOrMoreWs(); // Memory optimization // re-use the tag string OboFormatTag formatTag = OBOFormatConstants.getTag(tag); if (formatTag != null) { tag = formatTag.getTag(); } return mapDeprecatedTag(tag); }
private boolean parseQual(Clause cl) { parseZeroOrMoreWs(); String rest = stream.rest(); if (!rest.contains("=")) { error( "Missing '=' in trailing qualifier block. This might happen for not properly escaped '{', '}' chars in comments."); } String q = getParseUntilAdv("="); parseZeroOrMoreWs(); String v; if (stream.consume("\"")) { v = getParseUntilAdv("\""); } else { v = getParseUntil(" ,}"); warn("qualifier values should be enclosed in quotes. You have: " + q + '=' + stream .rest()); } if (v.isEmpty()) { warn("Empty value for qualifier in trailing qualifier block."); v = ""; } QualifierValue qv = new QualifierValue(q, v); cl.addQualifierValue(qv); parseZeroOrMoreWs(); return true; }
private String getParseTag() { if (stream.eof()) { error("Expected an id tag, not end of file."); } if (stream.eol()) { error("Expected an id tag, not end of line"); } int i = stream.indexOf(':'); if (i == -1) { error("Could not find tag separator ':' in line."); } String tag = stream.rest().substring(0, i); stream.advance(i + 1); parseWs(); parseZeroOrMoreWs(); // Memory optimization // re-use the tag string OboFormatTag formatTag = OBOFormatConstants.getTag(tag); if (formatTag != null) { tag = formatTag.getTag(); } return mapDeprecatedTag(tag); }
private boolean parseQual(Clause cl) { parseZeroOrMoreWs(); String rest = stream.rest(); if (!rest.contains("=")) { error( "Missing '=' in trailing qualifier block. This might happen for not properly escaped '{', '}' chars in comments."); } String q = getParseUntilAdv("="); parseZeroOrMoreWs(); String v; if (stream.consume("\"")) { v = getParseUntilAdv("\""); } else { v = getParseUntil(" ,}"); warn("qualifier values should be enclosed in quotes. You have: " + q + '=' + stream .rest()); } if (v.isEmpty()) { warn("Empty value for qualifier in trailing qualifier block."); v = ""; } QualifierValue qv = new QualifierValue(q, v); cl.addQualifierValue(qv); parseZeroOrMoreWs(); return true; }
/** * @param obodoc obodoc * @throws OBOFormatParserException parser exception */ public void parseEntityFrame(OBODoc obodoc) { parseZeroOrMoreWsOptCmtNl(); String rest = stream.rest(); if (rest.startsWith("[Term]")) { parseTermFrame(obodoc); } else if (rest.startsWith("[Instance]")) { LOG.error("Error: Instance frames are not supported yet. Parsing stopped at line: {}", Integer.valueOf( stream.getLineNo())); while (!stream.eof()) { stream.advanceLine(); } } else { parseTypedefFrame(obodoc); } }
/** * @param obodoc obodoc * @throws OBOFormatParserException parser exception */ public void parseEntityFrame(OBODoc obodoc) { parseZeroOrMoreWsOptCmtNl(); String rest = stream.rest(); if (rest.startsWith("[Term]")) { parseTermFrame(obodoc); } else if (rest.startsWith("[Instance]")) { LOG.error("Error: Instance frames are not supported yet. Parsing stopped at line: {}", Integer.valueOf( stream.getLineNo())); while (!stream.eof()) { stream.advanceLine(); } } else { parseTypedefFrame(obodoc); } }
/** * @param obodoc obodoc * @throws OBOFormatParserException parser exception */ public void parseEntityFrame(OBODoc obodoc) { parseZeroOrMoreWsOptCmtNl(); String rest = stream.rest(); if (rest.startsWith("[Term]")) { parseTermFrame(obodoc); } else if (rest.startsWith("[Instance]")) { LOG.error("Error: Instance frames are not supported yet. Parsing stopped at line: {}", Integer.valueOf( stream.getLineNo())); while (!stream.eof()) { stream.advanceLine(); } } else { parseTypedefFrame(obodoc); } }
/** * @param obodoc obodoc * @throws OBOFormatParserException parser exception */ public void parseEntityFrame(OBODoc obodoc) { parseZeroOrMoreWsOptCmtNl(); String rest = stream.rest(); if (rest.startsWith("[Term]")) { parseTermFrame(obodoc); } else if (rest.startsWith("[Instance]")) { LOG.error("Error: Instance frames are not supported yet. Parsing stopped at line: {}", Integer.valueOf( stream.getLineNo())); while (!stream.eof()) { stream.advanceLine(); } } else { parseTypedefFrame(obodoc); } }
public void parseEntityFrame(OBODoc obodoc) throws OBOFormatParserException { parseZeroOrMoreWsOptCmtNl(); String rest = s.rest(); if (rest != null && rest.startsWith("[Term]")) { parseTermFrame(obodoc); } else { parseTypedefFrame(obodoc); } }
protected void forceParseNlOrEof() { parseZeroOrMoreWs(); if (stream.eol()) { stream.advanceLine(); return; } if (stream.eof()) { return; } error("expected newline or end of line but found: " + stream.rest()); }
protected void forceParseNlOrEof() { parseZeroOrMoreWs(); if (stream.eol()) { stream.advanceLine(); return; } if (stream.eof()) { return; } error("expected newline or end of line but found: " + stream.rest()); }
protected void forceParseNlOrEof() { parseZeroOrMoreWs(); if (stream.eol()) { stream.advanceLine(); return; } if (stream.eof()) { return; } error("expected newline or end of line but found: " + stream.rest()); }
protected void forceParseNlOrEof() throws OBOFormatParserException { parseZeroOrMoreWs(); if (s.eol()) { s.advanceLine(); return; } if (s.eof()) { return; } error("expected newline or end of line but found: "+s.rest()); }
public boolean consume(String s) { String r = rest(); if (r==null) { return false; } if (r.startsWith(s)) { pos += s.length(); return true; } return false; }
public boolean consume(String s) { String r = rest(); if (r.isEmpty()) { return false; } if (r.startsWith(s)) { pos += s.length(); return true; } return false; }
protected void forceParseNlOrEof() { parseZeroOrMoreWs(); if (stream.eol()) { stream.advanceLine(); return; } if (stream.eof()) { return; } error("expected newline or end of line but found: " + stream.rest()); }