lexer

package
v0.0.0-...-26c87ff Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2017 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package lexer manages the imported configuration in order to generate secuences of tokens.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Scanner

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

Scanner is the scanning tool which contains de internal estate of analysis. Must be initialized via Init before use.

func (*Scanner) GetReport

func (s *Scanner) GetReport() error

GetReport returns the errors of the scanner as a common error interface

func (*Scanner) Init

func (s *Scanner) Init(context string, src []byte)

Init prepares the scanner s to tokenize the text src by setting the scanner at the beginning of src.

func (*Scanner) Scan

func (s *Scanner) Scan() (tok token.Token, lit string, pos int)

Scan scans the next token and returns the token position, the token, and its literal string if applicable. The source end is indicated by token.EOF.

Jump to

Keyboard shortcuts

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