Parser for a specific block node

Introduced properties

type BLOCK: MdBlock

markdown2 :: MdBlockParser :: BLOCK

Kind of block under construction
fun add_line(line: String)

markdown2 :: MdBlockParser :: add_line

Add line to the current block
abstract fun block: BLOCK

markdown2 :: MdBlockParser :: block

MdBlock under construction
protected fun column_start=(column_start: Int)

markdown2 :: MdBlockParser :: column_start=

Column start
fun content_offset: Int

markdown2 :: MdBlockParser :: content_offset

Column where the content starts
protected fun content_offset=(content_offset: Int)

markdown2 :: MdBlockParser :: content_offset=

Column where the content starts
init defaultinit(line_start: Int, column_start: Int, content_offset: Int)

markdown2 :: MdBlockParser :: defaultinit

fun finalize(parser: MdParser)

markdown2 :: MdBlockParser :: finalize

Finalize the current block
fun initialize(parser: MdParser)

markdown2 :: MdBlockParser :: initialize

Initialize the current block
protected fun line_start=(line_start: Int)

markdown2 :: MdBlockParser :: line_start=

Line Start
fun location: MdLocation

markdown2 :: MdBlockParser :: location

Location at start
protected fun location=(location: MdLocation)

markdown2 :: MdBlockParser :: location=

Location at start
fun parse_inlines(inline_parser: MdInlineParser)

markdown2 :: MdBlockParser :: parse_inlines

Parse block lines
abstract fun try_continue(state: MdParser): nullable MdBlockContinue

markdown2 :: MdBlockParser :: try_continue

Can self continue from the current index in parser?

Redefined properties

redef type SELF: MdBlockParser

markdown2 $ MdBlockParser :: SELF

Type of this instance, automatically specialized in every class

All properties

fun !=(other: nullable Object): Bool

core :: Object :: !=

Have self and other different values?
fun ==(other: nullable Object): Bool

core :: Object :: ==

Have self and other the same value?
type BLOCK: MdBlock

markdown2 :: MdBlockParser :: BLOCK

Kind of block under construction
type CLASS: Class[SELF]

core :: Object :: CLASS

The type of the class of self.
type SELF: Object

core :: Object :: SELF

Type of this instance, automatically specialized in every class
fun add_line(line: String)

markdown2 :: MdBlockParser :: add_line

Add line to the current block
abstract fun block: BLOCK

markdown2 :: MdBlockParser :: block

MdBlock under construction
protected fun class_factory(name: String): CLASS

core :: Object :: class_factory

Implementation used by get_class to create the specific class.
fun class_name: String

core :: Object :: class_name

The class name of the object.
protected fun column_start=(column_start: Int)

markdown2 :: MdBlockParser :: column_start=

Column start
fun content_offset: Int

markdown2 :: MdBlockParser :: content_offset

Column where the content starts
protected fun content_offset=(content_offset: Int)

markdown2 :: MdBlockParser :: content_offset=

Column where the content starts
init defaultinit(line_start: Int, column_start: Int, content_offset: Int)

markdown2 :: MdBlockParser :: defaultinit

fun finalize(parser: MdParser)

markdown2 :: MdBlockParser :: finalize

Finalize the current block
fun get_class: CLASS

core :: Object :: get_class

The meta-object representing the dynamic type of self.
fun hash: Int

core :: Object :: hash

The hash code of the object.
init init

core :: Object :: init

fun initialize(parser: MdParser)

markdown2 :: MdBlockParser :: initialize

Initialize the current block
fun inspect: String

core :: Object :: inspect

Developer readable representation of self.
protected fun inspect_head: String

core :: Object :: inspect_head

Return "CLASSNAME:#OBJECTID".
intern fun is_same_instance(other: nullable Object): Bool

core :: Object :: is_same_instance

Return true if self and other are the same instance (i.e. same identity).
fun is_same_serialized(other: nullable Object): Bool

core :: Object :: is_same_serialized

Is self the same as other in a serialization context?
intern fun is_same_type(other: Object): Bool

core :: Object :: is_same_type

Return true if self and other have the same dynamic type.
protected fun line_start=(line_start: Int)

markdown2 :: MdBlockParser :: line_start=

Line Start
fun location: MdLocation

markdown2 :: MdBlockParser :: location

Location at start
protected fun location=(location: MdLocation)

markdown2 :: MdBlockParser :: location=

Location at start
intern fun object_id: Int

core :: Object :: object_id

An internal hash code for the object based on its identity.
fun output

core :: Object :: output

Display self on stdout (debug only).
intern fun output_class_name

core :: Object :: output_class_name

Display class name on stdout (debug only).
fun parse_inlines(inline_parser: MdInlineParser)

markdown2 :: MdBlockParser :: parse_inlines

Parse block lines
fun serialization_hash: Int

core :: Object :: serialization_hash

Hash value use for serialization
intern fun sys: Sys

core :: Object :: sys

Return the global sys object, the only instance of the Sys class.
abstract fun to_jvalue(env: JniEnv): JValue

core :: Object :: to_jvalue

fun to_s: String

core :: Object :: to_s

User readable representation of self.
abstract fun try_continue(state: MdParser): nullable MdBlockContinue

markdown2 :: MdBlockParser :: try_continue

Can self continue from the current index in parser?
package_diagram markdown2::MdBlockParser MdBlockParser core::Object Object markdown2::MdBlockParser->core::Object markdown2::MdDocumentBlockParser MdDocumentBlockParser markdown2::MdDocumentBlockParser->markdown2::MdBlockParser markdown2::MdHeadingParser MdHeadingParser markdown2::MdHeadingParser->markdown2::MdBlockParser markdown2::MdBlockQuoteParser MdBlockQuoteParser markdown2::MdBlockQuoteParser->markdown2::MdBlockParser markdown2::MdIndentedCodeBlockParser MdIndentedCodeBlockParser markdown2::MdIndentedCodeBlockParser->markdown2::MdBlockParser markdown2::MdFencedCodeBlockParser MdFencedCodeBlockParser markdown2::MdFencedCodeBlockParser->markdown2::MdBlockParser markdown2::MdListBlockParser MdListBlockParser markdown2::MdListBlockParser->markdown2::MdBlockParser markdown2::MdListItemParser MdListItemParser markdown2::MdListItemParser->markdown2::MdBlockParser markdown2::MdThematicBreakParser MdThematicBreakParser markdown2::MdThematicBreakParser->markdown2::MdBlockParser markdown2::MdParagraphParser MdParagraphParser markdown2::MdParagraphParser->markdown2::MdBlockParser markdown2::MdHtmlBlockParser MdHtmlBlockParser markdown2::MdHtmlBlockParser->markdown2::MdBlockParser

Parents

interface Object

core :: Object

The root of the class hierarchy.

Children

class MdBlockQuoteParser

markdown2 :: MdBlockQuoteParser

Blockquotes parser
class MdDocumentBlockParser

markdown2 :: MdDocumentBlockParser

Parser for the whole document
class MdFencedCodeBlockParser

markdown2 :: MdFencedCodeBlockParser

Fenced code blocks parser
class MdHeadingParser

markdown2 :: MdHeadingParser

Headings parser
class MdHtmlBlockParser

markdown2 :: MdHtmlBlockParser

Html blocks parser
class MdIndentedCodeBlockParser

markdown2 :: MdIndentedCodeBlockParser

Indented code blocks parser
class MdListBlockParser

markdown2 :: MdListBlockParser

List blocks parser
class MdListItemParser

markdown2 :: MdListItemParser

List items parser
class MdParagraphParser

markdown2 :: MdParagraphParser

Paragraphs parser
class MdThematicBreakParser

markdown2 :: MdThematicBreakParser

Thematic breaks parser

Class definitions

markdown2 $ MdBlockParser
# Parser for a specific block node
abstract class MdBlockParser

	# Kind of block under construction
	type BLOCK: MdBlock

	# MdBlock under construction
	fun block: BLOCK is abstract

	# Line Start
	var line_start: Int

	# Column start
	var column_start: Int

	# Location at start
	#
	# The location end it initialized at `-1` and will be set later in the
	# `finalize` method.
	var location: MdLocation is lazy do return new MdLocation(line_start, column_start, -1, -1)

	# Column where the content starts
	var content_offset: Int

	# Initialize the current `block`
	fun initialize(parser: MdParser) do end

	# Can `self` continue from the current `index` in `parser`?
	#
	# Return a new `MdBlockContinue` if `self` can continue parsing.
	# Return null otherwise.
	fun try_continue(state: MdParser): nullable MdBlockContinue is abstract

	# Add `line` to the current `block`
	fun add_line(line: String) do end

	# Finalize the current `block`
	#
	# Deactivate `self` from `parser` and call `close_block`.
	fun finalize(parser: MdParser) do
		if parser.active_block_parser == self then
			parser.deactivate_block_parser
		end
	end

	# Parse `block` lines
	fun parse_inlines(inline_parser: MdInlineParser) do end
end
lib/markdown2/markdown_block_parsing.nit:478,1--525,3