Documentation
¶
Index ¶
- func AppendRuneIfNotInArr(n rune, arr []rune) []rune
- func AppendStringIfNotInArr(n string, arr []string) []string
- func BoolsToBytes(t []bool) []byte
- func CompareSlices(slice1, slice2 []int) bool
- func ConcatenateTwoArrays(arr1 []interface{}, arr2 []interface{}) ([]interface{}, error)
- func Contains(slice []string, value string) bool
- func Filter(slice []string, condition func(string) bool) []string
- func IsTerminal(symbol string) bool
- func ItemsEqual(items1, items2 []*Item) bool
- func RemoveDuplicate[T comparable](sliceList []T) []T
- func RuneInRuneArray(n rune, arr []rune) bool
- func RuneType(r rune) string
- func StateExists(states []*LRState, newState *LRState) bool
- func StringInStringArray(n string, arr []string) bool
- func Unique(slice []string) []string
- type DoublyLinkedList
- type Item
- type LRState
- type LexToken
- type LinkedNode
- type Nodo
- type ParseToken
- type ProductionToken
- type RegexToken
- type Stack
- type Token
- type ValidSegment
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendRuneIfNotInArr ¶
func AppendStringIfNotInArr ¶
func BoolsToBytes ¶
func CompareSlices ¶
func ConcatenateTwoArrays ¶
func ConcatenateTwoArrays(arr1 []interface{}, arr2 []interface{}) ([]interface{}, error)
func IsTerminal ¶
IsTerminal verifica si un símbolo es terminal basado en tu convención de mayúsculas.
func ItemsEqual ¶
ItemsEqual compara dos slices de *Item para determinar si son iguales
func RemoveDuplicate ¶
func RemoveDuplicate[T comparable](sliceList []T) []T
func RuneInRuneArray ¶
func StateExists ¶
StateExists verifica si un estado LRState ya existe en una lista de estados
func StringInStringArray ¶
Types ¶
type DoublyLinkedList ¶
type DoublyLinkedList struct { Head *LinkedNode Tail *LinkedNode Size int }
func DeepCopyList ¶
func DeepCopyList(original *DoublyLinkedList) *DoublyLinkedList
func (*DoublyLinkedList) Append ¶
func (l *DoublyLinkedList) Append(value interface{})
func (*DoublyLinkedList) DeleteWithValue ¶
func (l *DoublyLinkedList) DeleteWithValue(value interface{})
func (*DoublyLinkedList) Prepend ¶
func (l *DoublyLinkedList) Prepend(value interface{})
func (*DoublyLinkedList) PrintForward ¶
func (l *DoublyLinkedList) PrintForward()
func (*DoublyLinkedList) PrintReverse ¶
func (l *DoublyLinkedList) PrintReverse()
type Item ¶
type Item struct { Production *ProductionToken `json:"production"` Position int `json:"position"` SubPos int `json:"subposition"` Lookaheads []string `json:"lookaheads"` }
func NewLR1Item ¶
func NewLR1Item(prod *ProductionToken, pos int, subPos int, lookahead []string) *Item
type LinkedNode ¶
type LinkedNode struct { Value interface{} Prev *LinkedNode Next *LinkedNode }
type Nodo ¶
type Nodo struct { Valor rune `json:"valor"` Izquierdo *Nodo `json:"izquierdo,omitempty"` Derecho *Nodo `json:"derecho,omitempty"` Leaf *int `json:"leaf"` Nullability bool `json:"nullability,omitempty"` Firstpos []int `json:"firstpos,omitempty"` Lastpos []int `json:"lastpos,omitempty"` Followpos []int `json:"followpos,omitempty"` }
func (*Nodo) ImprimirDetalle ¶
func (nodo *Nodo) ImprimirDetalle()
func (*Nodo) PrintNodoDetalle ¶
func (nodo *Nodo) PrintNodoDetalle()
type ParseToken ¶
type ParseToken struct {
Token string `json:"token"`
}
type ProductionToken ¶
type RegexToken ¶
func (*RegexToken) String ¶
func (r *RegexToken) String() string
type Stack ¶
type Stack struct {
Elements []interface{} `json:"elements"` // Utiliza interface{} para permitir almacenar cualquier tipo de dato
}
Stack representa una pila donde los elementos se añaden o se quitan desde el mismo lado (FILO).
func (*Stack) ElemInStack ¶
func (*Stack) Peek ¶
func (s *Stack) Peek() interface{}
Peek devuelve el elemento superior de la pila sin eliminarlo. Retorna nil si la pila está vacía.
func (*Stack) Pop ¶
func (s *Stack) Pop() interface{}
Pop elimina y devuelve el elemento superior de la pila. Retorna nil si la pila está vacía.
type ValidSegment ¶
Click to show internal directories.
Click to hide internal directories.