/** * Fetch a literal scalar, denoted with a vertical-bar. This is the type * best used for source code and other content, such as binary data, which * must be included verbatim. * * @see <a href="http://www.yaml.org/spec/1.1/#id863975"></a> */ private void fetchLiteral() { fetchBlockScalar('|'); }
/** * Fetch a document-start token ("---"). */ private void fetchDocumentStart() { fetchDocumentIndicator(true); }
/** * Fetch a double-quoted (") scalar. */ private void fetchDouble() { fetchFlowScalar('"'); }
/** * Remove the saved possible key position at the current flow level. */ private void removePossibleSimpleKey() { SimpleKey key = possibleSimpleKeys.remove(flowLevel); if (key != null && key.isRequired()) { throw new ScannerException("while scanning a simple key", key.getMark(), "could not find expected ':'", reader.getMark()); } }
/** * Return the next token, but do not delete it from the queue. */ public Token peekToken() { while (needMoreTokens()) { fetchMoreTokens(); } return this.tokens.get(0); }
/** * Fetch a plain scalar. */ private void fetchPlain() { // A plain scalar could be a simple key. savePossibleSimpleKey(); // No simple keys after plain scalars. But note that `scan_plain` will // change this flag if the scan is finished at the beginning of the // line. this.allowSimpleKey = false; // Scan and add SCALAR. May change `allow_simple_key`. Token tok = scanPlain(); this.tokens.add(tok); }
public boolean hasNo(int c, String additional) { return !has(c, additional); } }
private void fetchFlowMappingEnd() { fetchFlowCollectionEnd(true); }
private void fetchFlowMappingStart() { fetchFlowCollectionStart(true); }
public ParserImpl(StreamReader reader) { this(new ScannerImpl(reader)); }
private boolean isLineBreak(int c) { return Constant.NULL_OR_LINEBR.has(c); }
/** * Fetch a folded scalar, denoted with a greater-than sign. This is the type * best used for long content, such as the text of a chapter or description. * * @see <a href="http://www.yaml.org/spec/1.1/#id863975"></a> */ private void fetchFolded() { fetchBlockScalar('>'); }
/** * Fetch a document-end token ("..."). */ private void fetchDocumentEnd() { fetchDocumentIndicator(false); }
/** * Fetch a single-quoted (') scalar. */ private void fetchSingle() { fetchFlowScalar('\''); }
private void fetchFlowSequenceEnd() { fetchFlowCollectionEnd(false); }
private void fetchFlowSequenceStart() { fetchFlowCollectionStart(false); }
public boolean hasNo(int c) { return !has(c); }
/** * Returns true if the next thing on the reader is a value token. */ private boolean checkValue() { // VALUE(flow context): ':' if (flowLevel != 0) { return true; } else { // VALUE(block context): ':' (' '|'\n') return Constant.NULL_BL_T_LINEBR.has(reader.peek(1)); } }
/** * Returns true if the next thing on the reader is a block token. */ private boolean checkBlockEntry() { // BLOCK-ENTRY: '-' (' '|'\n') return Constant.NULL_BL_T_LINEBR.has(reader.peek(1)); }
/** * Returns true if the next thing on the reader is a key token. */ private boolean checkKey() { // KEY(flow context): '?' if (this.flowLevel != 0) { return true; } else { // KEY(block context): '?' (' '|'\n') return Constant.NULL_BL_T_LINEBR.has(reader.peek(1)); } }