parser

package
v0.0.0-...-539d71c Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NosLexer

func NosLexer() lexer.Definition

NosLexer returns a lexer instance able to tokenize nostale packets

Types

type NosPacketParser

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

NosPacketParser provides a collection of methods to parse nostale packets and convert them between different formats or notations. It also holds an initially-empty list of parsable packets.

func New

func New() *NosPacketParser

New initializes and returns a new packet parser.

func (*NosPacketParser) ParseClientPacket

func (p *NosPacketParser) ParseClientPacket(rawPacket string) (packets.NosPacket, error)

ParseClientPacket parses a registered client packet

func (*NosPacketParser) ParseServerPacket

func (p *NosPacketParser) ParseServerPacket(rawPacket string) (packets.NosPacket, error)

ParseServerPacket parses a registered server packet

func (*NosPacketParser) RegisterPacket

func (p *NosPacketParser) RegisterPacket(packet packets.NosPacket) error

RegisterPacket adds a new packet to the list of packets that the parser will be able to parse.

Jump to

Keyboard shortcuts

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