parser

package
v0.0.0-...-1743342 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2015 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Overview

package parser contains information for parsing the tokens in the input file

Index

Constants

View Source
const (

	// TokenHistorySize represents the size of the token history we remember
	TokenHistorySize = 15
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler func(html.Token) error

Handler is a function which processes a token

type Parser

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

Parser contains information about the context we are processing

func (Parser) ColNo

func (c Parser) ColNo() int

ColNo returns the current column number

func (*Parser) NewCol

func (c *Parser) NewCol()

NewCol increments the column count

func (*Parser) NewRow

func (c *Parser) NewRow()

NewRow increments the row count and sets the column number to 0

func (Parser) PrintRow

func (c Parser) PrintRow()

PrintRow prints the row if we have some data

func (*Parser) Process

func (c *Parser) Process(filename string, tablename string)

Process parses the file consuming tokens and finally returning the SQL statements to build a table

func (*Parser) ProcessingTable

func (c *Parser) ProcessingTable(token html.Token) error

ProcessingTable process the content of the main table

func (*Parser) ResetRowCounters

func (c *Parser) ResetRowCounters()

ResetRowCounters resets the row counters

func (Parser) RowNo

func (c Parser) RowNo() int

RowNo returns the current row number

func (*Parser) SaveRow

func (c *Parser) SaveRow()

SaveRow saves the row details in the parser.

func (*Parser) SetText

func (c *Parser) SetText(token html.Token)

SetText puts the text in the appropriate field

func (*Parser) SetVerbose

func (c *Parser) SetVerbose()

SetVerbose makes logging more verbose

func (*Parser) WaitingForDetails

func (c *Parser) WaitingForDetails(token html.Token) error

WaitingForDetails processes the token while waiting for details

func (*Parser) WaitingForTable

func (c *Parser) WaitingForTable(token html.Token) error

WaitingForTable processes tokens waiting for the main table to start

type TokenHistory

type TokenHistory []html.Token

TokenHistory is a slice of tokens

Jump to

Keyboard shortcuts

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