antlrz

package
v0.48.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package antlrz contains utilities for working with ANTLR4.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TokenExtractor

type TokenExtractor struct {
	// contains filtered or unexported fields
}

TokenExtractor extracts the raw text of a parser rule from the input.

func NewTokenExtractor

func NewTokenExtractor(input string) *TokenExtractor

NewTokenExtractor returns a new TokenExtractor.

func (*TokenExtractor) Extract

func (l *TokenExtractor) Extract(prc antlr.ParserRuleContext) string

Extract extracts the raw text of the parser rule from the input. It may panic if the parser rule is not found in the input.

func (*TokenExtractor) Offset

func (l *TokenExtractor) Offset(prc antlr.ParserRuleContext) (start, stop int)

Offset returns the start and stop (inclusive) offsets of the parser rule in the input.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL