public ParserImpl(StreamReader reader) { this(new ScannerImpl(reader)); }
/** * Fetch a key in a block-style mapping. * * @see <a href="http://www.yaml.org/spec/1.1/#id863975"></a> */ private void fetchKey() { // Block context needs additional checks. if (this.flowLevel == 0) { // Are we allowed to start a key (not necessary a simple)? if (!this.allowSimpleKey) { throw new ScannerException(null, null, "mapping keys are not allowed here", reader.getMark()); } // We may need to add BLOCK-MAPPING-START. if (addIndent(this.reader.getColumn())) { Mark mark = reader.getMark(); this.tokens.add(new BlockMappingStartToken(mark, mark)); } } // Simple keys are allowed after '?' in the block context. this.allowSimpleKey = this.flowLevel == 0; // Reset possible simple key on the current level. removePossibleSimpleKey(); // Add KEY. Mark startMark = reader.getMark(); reader.forward(); Mark endMark = reader.getMark(); Token token = new KeyToken(startMark, endMark); this.tokens.add(token); }
scanToNextToken(); stalePossibleSimpleKeys(); unwindIndent(reader.getColumn()); fetchStreamEnd(); return; case '%': if (checkDirective()) { fetchDirective(); return; if (checkDocumentStart()) { fetchDocumentStart(); return; } else if (checkBlockEntry()) { fetchBlockEntry(); return; if (checkDocumentEnd()) { fetchDocumentEnd(); return; fetchFlowSequenceStart(); return; case '{':
scanToNextToken(); stalePossibleSimpleKeys(); unwindIndent(reader.getColumn()); fetchStreamEnd(); return; case '%': if (checkDirective()) { fetchDirective(); return; if (checkDocumentStart()) { fetchDocumentStart(); return; } else if (checkBlockEntry()) { fetchBlockEntry(); return; if (checkDocumentEnd()) { fetchDocumentEnd(); return; fetchFlowSequenceStart(); return; case '{':
if (addIndent(this.reader.getColumn())) { Mark mark = reader.getMark(); this.tokens.add(new BlockSequenceStartToken(mark, mark)); removePossibleSimpleKey();
public ParserImpl(StreamReader reader) { this(new ScannerImpl(reader)); }
scanToNextToken(); stalePossibleSimpleKeys(); unwindIndent(reader.getColumn()); fetchStreamEnd(); return; case '%': if (checkDirective()) { fetchDirective(); return; if (checkDocumentStart()) { fetchDocumentStart(); return; } else if (checkBlockEntry()) { fetchBlockEntry(); return; if (checkDocumentEnd()) { fetchDocumentEnd(); return; fetchFlowSequenceStart(); return; case '{':
if (addIndent(key.getColumn())) { this.tokens.add(key.getTokenNumber() - this.tokensTaken, new BlockMappingStartToken(key.getMark(), key.getMark())); if (addIndent(reader.getColumn())) { Mark mark = reader.getMark(); this.tokens.add(new BlockMappingStartToken(mark, mark)); removePossibleSimpleKey();
public ParserImpl(StreamReader reader) { this(new ScannerImpl(reader)); }
scanToNextToken(); stalePossibleSimpleKeys(); unwindIndent(reader.getColumn()); fetchStreamEnd(); return; case '%': if (checkDirective()) { fetchDirective(); return; if (checkDocumentStart()) { fetchDocumentStart(); return; } else if (checkBlockEntry()) { fetchBlockEntry(); return; if (checkDocumentEnd()) { fetchDocumentEnd(); return; fetchFlowSequenceStart(); return; case '{':
/** * Fetch a key in a block-style mapping. * * @see <a href="http://www.yaml.org/spec/1.1/#id863975"></a> */ private void fetchKey() { // Block context needs additional checks. if (this.flowLevel == 0) { // Are we allowed to start a key (not necessary a simple)? if (!this.allowSimpleKey) { throw new ScannerException(null, null, "mapping keys are not allowed here", reader.getMark()); } // We may need to add BLOCK-MAPPING-START. if (addIndent(this.reader.getColumn())) { Mark mark = reader.getMark(); this.tokens.add(new BlockMappingStartToken(mark, mark)); } } // Simple keys are allowed after '?' in the block context. this.allowSimpleKey = this.flowLevel == 0; // Reset possible simple key on the current level. removePossibleSimpleKey(); // Add KEY. Mark startMark = reader.getMark(); reader.forward(); Mark endMark = reader.getMark(); Token token = new KeyToken(startMark, endMark); this.tokens.add(token); }
public ParserImpl(StreamReader reader) { this.scanner = new ScannerImpl(reader); currentEvent = null; directives = new VersionTagsTuple(null, new HashMap<String, String>(DEFAULT_TAGS)); states = new ArrayStack<Production>(100); marks = new ArrayStack<Mark>(10); state = new ParseStreamStart(); }
/** * Fetch a key in a block-style mapping. * * @see <a href="http://www.yaml.org/spec/1.1/#id863975"></a> */ private void fetchKey() { // Block context needs additional checks. if (this.flowLevel == 0) { // Are we allowed to start a key (not necessary a simple)? if (!this.allowSimpleKey) { throw new ScannerException(null, null, "mapping keys are not allowed here", reader.getMark()); } // We may need to add BLOCK-MAPPING-START. if (addIndent(this.reader.getColumn())) { Mark mark = reader.getMark(); this.tokens.add(new BlockMappingStartToken(mark, mark)); } } // Simple keys are allowed after '?' in the block context. this.allowSimpleKey = this.flowLevel == 0; // Reset possible simple key on the current level. removePossibleSimpleKey(); // Add KEY. Mark startMark = reader.getMark(); reader.forward(); Mark endMark = reader.getMark(); Token token = new KeyToken(startMark, endMark); this.tokens.add(token); }
/** * Fetch a key in a block-style mapping. * * @see http://www.yaml.org/spec/1.1/#id863975 */ private void fetchKey() { // Block context needs additional checks. if (this.flowLevel == 0) { // Are we allowed to start a key (not necessary a simple)? if (!this.allowSimpleKey) { throw new ScannerException(null, null, "mapping keys are not allowed here", reader.getMark()); } // We may need to add BLOCK-MAPPING-START. if (addIndent(this.reader.getColumn())) { Mark mark = reader.getMark(); this.tokens.add(new BlockMappingStartToken(mark, mark)); } } // Simple keys are allowed after '?' in the block context. this.allowSimpleKey = this.flowLevel == 0; // Reset possible simple key on the current level. removePossibleSimpleKey(); // Add KEY. Mark startMark = reader.getMark(); reader.forward(); Mark endMark = reader.getMark(); Token token = new KeyToken(startMark, endMark); this.tokens.add(token); }
if (addIndent(this.reader.getColumn())) { Mark mark = reader.getMark(); this.tokens.add(new BlockSequenceStartToken(mark, mark)); removePossibleSimpleKey();
if (addIndent(this.reader.getColumn())) { Mark mark = reader.getMark(); this.tokens.add(new BlockSequenceStartToken(mark, mark)); removePossibleSimpleKey();
if (addIndent(this.reader.getColumn())) { Mark mark = reader.getMark(); this.tokens.add(new BlockSequenceStartToken(mark, mark)); removePossibleSimpleKey();
if (addIndent(key.getColumn())) { this.tokens.add(key.getTokenNumber() - this.tokensTaken, new BlockMappingStartToken(key.getMark(), key.getMark())); if (addIndent(reader.getColumn())) { Mark mark = reader.getMark(); this.tokens.add(new BlockMappingStartToken(mark, mark)); removePossibleSimpleKey();
if (addIndent(key.getColumn())) { this.tokens.add(key.getTokenNumber() - this.tokensTaken, new BlockMappingStartToken(key.getMark(), key.getMark())); if (addIndent(reader.getColumn())) { Mark mark = reader.getMark(); this.tokens.add(new BlockMappingStartToken(mark, mark)); removePossibleSimpleKey();
if (addIndent(key.getColumn())) { this.tokens.add(key.getTokenNumber() - this.tokensTaken, new BlockMappingStartToken(key.getMark(), key.getMark())); if (addIndent(reader.getColumn())) { Mark mark = reader.getMark(); this.tokens.add(new BlockMappingStartToken(mark, mark)); removePossibleSimpleKey();