Module hime_redist::parsers [] [src]

Module for parsers API

Modules

lrk

Module for LR(k) parsers

rnglr

Module for RNGLR parsers

subtree

Module for AST subtree in parsers

Structs

LRAction

Represents a LR action in a LR parse table

LRContexts

Represents the contexts opening by transitions from a state

LRExpected

Container for the expected terminals for a LR state

LRProduction

Represents a rule's production in a LR parser The binary representation of a LR Production is as follow: --- header u16: head's index u8: 1=replace, 0=nothing u8: reduction length u8: bytecode length in number of op-code --- production's bytecode array of LROpCode

Constants

LR_ACTION_CODE_ACCEPT

Accept the input

LR_ACTION_CODE_NONE

No possible action => Error

LR_ACTION_CODE_REDUCE

Apply a reduction

LR_ACTION_CODE_SHIFT

Shift to another state

LR_OP_CODE_BASE_ADD_NULLABLE_VARIABLE

Add a null variable This can be found only in RNGLR productions

LR_OP_CODE_BASE_ADD_VIRTUAL

Add a virtual symbol

LR_OP_CODE_BASE_POP_STACK

Pop an AST from the stack

LR_OP_CODE_BASE_SEMANTIC_ACTION

Execute a semantic action

MAX_ERROR_COUNT

The maximum number of errors

TREE_ACTION_DROP

Drop the node and all its descendants

TREE_ACTION_NONE

Keep the node as is

TREE_ACTION_PROMOTE

Promote the node, i.e. replace its parent with it and insert its children where it was

TREE_ACTION_REPLACE

Replace the node with its children

Traits

Parser

Functions

get_op_code_base

Gets the base LR op-code

get_op_code_tree_action

Gets the tree action encoded in the specified LR op-code

Type Definitions

LRActionCode

Represents an action in a LR parser

LROpCode

Represent an op-code for a LR production An op-code can be either an instruction or raw data

TreeAction

Represents a tree action