Package net.akehurst.language.api.sppt

Types

SharedPackedParseTree
Link copied to clipboard
interface SharedPackedParseTree
A Shared Packed Parse Forest is a collection of parse trees which share Nodes when possible.
SharedPackedParseTreeVisitor
Link copied to clipboard
interface SharedPackedParseTreeVisitor<T, A>
Visitor interface for a SharedPackedParse
SPPTBranch
Link copied to clipboard
interface SPPTBranch : SPPTNode
A branch in a SharedPackedParseTree
SPPTException
Link copied to clipboard
class SPPTException(message: String, cause: Throwable?) : RuntimeException
SPPTLeaf
Link copied to clipboard
interface SPPTLeaf : SPPTNode
A leaf node has no children.
SPPTNode
Link copied to clipboard
interface SPPTNode
A leaf node has no children.
SPPTNodeIdentity
Link copied to clipboard
interface SPPTNodeIdentity
The identity of a node in a Shared Packed Parse Forest is composed from:
  • a unique rule number,
  • a starting position indicating the index of a position in the input text of the parse at which this node starts,
  • the length (number of characters) of the input text that is matched by this node
If a grammar is ambiguous, a parse result may contain multiple nodes with the same identity but with different children.
SPPTParser
Link copied to clipboard
interface SPPTParser
grammar Tree { skip WHITESPACE : "\s+" ;tree : node ; nodes : node+ ; node : branch | leaf | EMPTY ; branch : NAME '{' nodes '}' ; leaf : LITERAL | pattern ; pattern : PATTERN ':' LITERAL ; PATTERN : "\"(^\"\\|\\.