lexmlparser

package module
v0.0.0-...-4284d3c Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2020 License: GPL-3.0 Imports: 7 Imported by: 0

README

lexmlparser, UNDER CONSTRUCTION

Parser for the tokens from the lexml package. Under construction.

What it does

This package takes the tokens produced by the lexml package and creates a Go struct of the parsed values

Documentation

Overview

Package lexmlparser , Make a buffered reader of channel. Will keep the next input values read in a buffer where size if defined by b.size. Will release a new value with the readNext method.

Package lexmlparser ,

This package takes the tokens produced by the lexml package and creates a Go struct of the parsed values

tokenStartTag      TokenType = "tokenStartTag"      // <tag> || <
tokenEndTag        TokenType = "tokenEndTag"        // </tag> || />
tokenArgumentName  TokenType = "tokenArgumentName"  // name is infront of a = sign
tokenArgumentValue TokenType = "tokenArgumentValue" // value is after a = sign
tokenDescription   TokenType = "tokenDescription"   // Description, just text between tags
tokenEOF           TokenType = "tokenEOF"           //End Of File
tokenJustText      TokenType = "tokenJustText"      //just text, no start or end tag

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(tCh chan lexml.Token, outFh *os.File)

Start will start the lexml parser. Takes a channel of tokens as it's input.

Types

type Buffer

type Buffer struct {
	ChOut chan lexml.Token //ChOut, the channel out to be read by client
	Slice []lexml.Token    //Slice which is the actual buffer
	// contains filtered or unexported fields
}

Buffer is a buffer

func NewBuffer

func NewBuffer(m int) *Buffer

NewBuffer creates a new buffer, takes the buffer size as an input argument, and returns a *buffer.

func (*Buffer) ReadNext

func (b *Buffer) ReadNext()

ReadNext will, relese the lock on the go routine inside the start method, and let it read another value from the incomming channel and put it into the buffer.

func (*Buffer) Start

func (b *Buffer) Start(chIn chan lexml.Token)

Start will start filling the buffer, to continue filling buffer use the readNext method.

Directories

Path Synopsis
cmd
This main.go file will typically be the parser, but here we just print out the tokens that is received.
This main.go file will typically be the parser, but here we just print out the tokens that is received.
tmp

Jump to

Keyboard shortcuts

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