interfaces

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: MIT Imports: 1 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alphabet

type Alphabet[T any] interface {
	Contains(symbol Symbol[T]) bool
	Length() int
	Equal(other Alphabet[T]) bool
	String() string
	GetSymbols() []Symbol[T]
	GetSymbolAt(i int) Symbol[T]
	Iterator() iterator.Iterator[Symbol[T]]
	IsComplete() bool
}

type Guard

type Guard[T any] interface {
	// IsSatisfied returns true if the guard is satisfied by the given symbol.
	IsSatisfied(symbol Symbol[T]) bool
	// String returns a string representation of the guard.
	String() string
}

type Sequence

type Sequence[T any] interface {
	// GetPrefixes returns the prefixes of the sequence.
	GetPreffixes() []Sequence[T]
	// GetSuffixes returns the suffixes of the sequence.
	GetSuffixes() []Sequence[T]
	// Append appends the specified symbol(s) to a copy of the sequence and returns it.
	Append(symbols ...Symbol[T]) Sequence[T]
	// Prepend prepends the specified symbol(s) to a copy of the sequence and returns it.
	Prepend(symbols ...Symbol[T]) Sequence[T]
	// Length returns the length of the sequence.
	Length() int
	// IsEmpty returns true if the sequence is empty, false otherwise.
	IsEmpty() bool
	// GetSymbolAt returns the symbol at the specified index.
	GetSymbolAt(index int) Symbol[T]
	//AsSlice returns the sequence as a slice.
	AsSlice() []Symbol[T]

	String() string
	Equal(other Sequence[T]) bool
	Iterator() iterator.Iterator[Symbol[T]]
	Hash() int
}

type Symbol

type Symbol[T any] interface {
	// GetValue returns the value of the symbol.
	GetValue() T
	// AddToValue adds the given value to the symbol's value.
	AddToValue(value T) Symbol[T]
	String() string
	Equal(other Symbol[T]) bool
	LesserThan(other Symbol[T]) bool
	GreaterThan(other Symbol[T]) bool
	LesserEqualThan(other Symbol[T]) bool
	GreaterEqualThan(other Symbol[T]) bool
	Hash() int
}

Jump to

Keyboard shortcuts

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