Documentation
¶
Index ¶
- Constants
- type CstNode
- type WasmMatcher
- func (m *WasmMatcher) Close() error
- func (m *WasmMatcher) GetCstRoot() (*CstNode, error)
- func (m *WasmMatcher) GetInput() string
- func (m *WasmMatcher) GetModule() api.Module
- func (m *WasmMatcher) LoadModule(wasmPath string) error
- func (m *WasmMatcher) Match(ruleName ...string) (bool, error)
- func (m *WasmMatcher) SetInput(input string)
- func (m *WasmMatcher) SetInputFromFile(filePath string) error
Constants ¶
View Source
const ( // Node type constants NodeTypeNonterminal = 0 NodeTypeTerminal = -1 NodeTypeIter = -2 )
View Source
const ( InputBufferOffset = wasmPageSize InputBufferSize = wasmPageSize MemoTableOffset = InputBufferOffset + InputBufferSize )
Constants for memory layout
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CstNode ¶
type CstNode struct {
// contains filtered or unexported fields
}
CstNode represents a node in the Concrete Syntax Tree
func NewCstNode ¶
NewCstNode creates a new CstNode with the given parameters
func (*CstNode) IsNonterminal ¶
IsNonterminal returns true if this node represents a nonterminal
func (*CstNode) IsTerminal ¶
IsTerminal returns true if this node represents a terminal
func (*CstNode) MatchLength ¶
MatchLength returns the length of the matched text
type WasmMatcher ¶
type WasmMatcher struct {
// contains filtered or unexported fields
}
WasmMatcher is a Go implementation of the JavaScript WasmMatcher class for Ohm
func NewWasmMatcher ¶
func NewWasmMatcher(ctx context.Context) *WasmMatcher
func (*WasmMatcher) GetCstRoot ¶
func (m *WasmMatcher) GetCstRoot() (*CstNode, error)
GetCstRoot returns a CstNode object for the current parse tree
func (*WasmMatcher) GetInput ¶
func (m *WasmMatcher) GetInput() string
func (*WasmMatcher) GetModule ¶
func (m *WasmMatcher) GetModule() api.Module
GetModule returns the WebAssembly module
func (*WasmMatcher) LoadModule ¶
func (m *WasmMatcher) LoadModule(wasmPath string) error
func (*WasmMatcher) SetInput ¶
func (m *WasmMatcher) SetInput(input string)
func (*WasmMatcher) SetInputFromFile ¶
func (m *WasmMatcher) SetInputFromFile(filePath string) error
SetInputFromFile reads input from a file and sets it as the current input
Click to show internal directories.
Click to hide internal directories.