abla/xml/literal

Generated from source.

Source module; follow its importing module's re-export links.

Source: abla/xml/literal.ab

XmlLiteralAttribute (class)

compile class XmlLiteralAttribute(
    val name: string, val prefix: string, val local: string, val uri: string,
    val value: SyntaxExpression, val declaration: bool, val declaredPrefix: string
)

Stores a parsed attribute's qualified name, value expression and any namespace declaration.

XmlLiteralNode (class)

compile class XmlLiteralNode(
    val kind: string, val name: string, val prefix: string, val uri: string,
    val attributes: array<XmlLiteralAttribute>, val children: array<XmlLiteralNode>,
    val value: SyntaxExpression
)

Represents a parsed literal node with its name, content expressions and children.

XmlLiteralBinding (class)

compile class XmlLiteralBinding(val prefix: string, val uri: string)

Binds an XML namespace prefix to a URI while parsing a literal.

XmlLiteralParser (class)

compile class XmlLiteralParser(val cursor: ParserCursor, val begin: int, var failed: bool,
    val bindings: array<XmlLiteralBinding>, var count: int)

Tracks the parser cursor, namespace bindings, size budget and first error.

ablaXmlLiteral_fail (compile.fun)

compile fun ablaXmlLiteral_fail(var parser: XmlLiteralParser, message: string): void

Reports the first XML literal error and marks the parser failed.

ablaXmlLiteral_expect (compile.fun)

compile fun ablaXmlLiteral_expect(var parser: XmlLiteralParser, text: string): void

Consumes the given raw token or records a parse error when it is absent.

ablaXmlLiteral_space (compile.fun)

compile fun ablaXmlLiteral_space(var parser: XmlLiteralParser): bool

Skips XML whitespace and reports whether the cursor advanced.

ablaXmlLiteral_lookup (compile.fun)

compile fun ablaXmlLiteral_lookup(var parser: XmlLiteralParser, prefix: string): string

Returns the URI currently bound to the prefix, or an empty string if none is found.

ablaXmlLiteral_checkBudget (compile.fun)

compile fun ablaXmlLiteral_checkBudget(var parser: XmlLiteralParser): void

Charges one parsed item and records an error if the item or byte limit is exceeded.

ablaXmlLiteral_hole (compile.fun)

compile fun ablaXmlLiteral_hole(var parser: XmlLiteralParser): SyntaxExpression

Parses an embedded Abla expression and reports missing braces.

ablaXmlLiteral_decode (compile.fun)

compile fun ablaXmlLiteral_decode(var parser: XmlLiteralParser, source: string, attribute: bool, references: bool): string

Normalizes XML text and optionally expands references, recording an error on invalid characters or references.

ablaXmlLiteral_reference (compile.fun)

compile fun ablaXmlLiteral_reference(var parser: XmlLiteralParser, name: string): string

Decodes a predefined entity or numeric reference and records an error on invalid input.

ablaXmlLiteral_attribute (compile.fun)

compile fun ablaXmlLiteral_attribute(var parser: XmlLiteralParser): XmlLiteralAttribute

Reads an attribute and its value, recording malformed names, quoting or namespace declarations as parser errors.

ablaXmlLiteral_content (compile.fun)

compile fun ablaXmlLiteral_content(var parser: XmlLiteralParser, depth: int): XmlLiteralNode

Reads one child node or splice and records malformed XML on the parser.

ablaXmlLiteral_element (compile.fun)

compile fun ablaXmlLiteral_element(var parser: XmlLiteralParser, depth: int): XmlLiteralNode

Reads an element and its children, recording invalid markup, namespace use or limit violations on the parser.

ablaXmlLiteralLeaf (compile.fun)

compile fun ablaXmlLiteralLeaf(kind: string, name: string, value: SyntaxExpression): XmlLiteralNode

Constructs a parsed leaf with the given kind, name and content expression.

ablaXmlLiteralRead (compile.fun)

compile fun ablaXmlLiteralRead(cursor: ParserCursor): XmlLiteralParser

Initializes XML parsing at the current cursor position.

ablaXmlLiteralTree (compile.fun)

compile fun ablaXmlLiteralTree(node: XmlLiteralNode): SyntaxExpression

Lowers a parsed XML node into an expression that constructs the runtime node.

ablaXmlParseLiteral (compile.fun)

compile fun ablaXmlParseLiteral(cursor: ParserCursor): SyntaxExpression

Parses one XML element into a runtime construction expression, returning null syntax after an error.

ablaXmlLiteralScalar (fun)

fun ablaXmlLiteralScalar(value: string): string

Returns the literal interpolation value as text.

ablaXmlLiteralScalar (fun)

fun ablaXmlLiteralScalar(value: int): string

Returns the literal interpolation value as text.

ablaXmlLiteralScalar (fun)

fun ablaXmlLiteralScalar(value: bool): string

Returns the literal interpolation value as text.

ablaXmlLiteralAsNode (fun)

fun ablaXmlLiteralAsNode(value: XmlNode): XmlNode

Returns the given node as the base XML node type for a literal splice.

ablaXmlLiteralNode (fun)

fun ablaXmlLiteralNode(value: XmlNode): array<XmlNode>

Wraps a single XML node in a child group.

ablaXmlLiteralNodes (fun)

fun ablaXmlLiteralNodes(value: array<XmlNode>): array<XmlNode>

Copies a group of spliced nodes into a fresh array.

ablaXmlLiteralElement (fun)

fun ablaXmlLiteralElement(name: string, prefix: string, local: string, uri: string,
    attributes: array<XmlAttribute>, parts: array<array<XmlNode>>): XmlElement

Creates an element by flattening its child groups in order.

$xml (sub-language)

#compilerRegisterSubparser("xml", ablaXmlParseLiteral)

Parses an inline XML element with Abla expression splices and reports malformed XML at compile time.

Built from Abla v0.2.79 source ba5d6b7d. Examples and generated signatures follow that source revision.