Skip to content

AST

[Source]

A labeled node in the parse tree. Contains an ordered list of children (other AST nodes, Tokens, or NotPresent values from optional matches).

class val AST

Constructors

create

[Source]

new iso create(
  label': Label val = reference)
: AST iso^

Parameters

  • label': Label val = reference

Returns


Public fields

embed children: Array[(AST val | Token val | NotPresent val)] ref

[Source]


Public Functions

push

[Source]

Append a child to this node.

fun ref push(
  some: (AST val | Token val | NotPresent val))
: None val

Parameters

Returns


label

[Source]

This node's label.

fun box label()
: Label val

Returns


size

[Source]

The number of children.

fun box size()
: USize val

Returns


extract

[Source]

Return the first child, or NotPresent if there are none.

fun box extract()
: (AST val | Token val | NotPresent val)

Returns