def METHOD_NAME(self, anchor):
    event = self.get_event()
    tag = event.tag
    if tag is None or tag == u'!':
        tag = self.resolve(ScalarNode, event.value, event.implicit)
    node = ScalarNode(tag, event.value,
            event.start_mark, event.end_mark, style=event.style)
    if anchor is not None:
        self.anchors[anchor] = node
    return node