chordpro

package
v0.0.0-...-0ba011f Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2014 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Overview

Provides a Scanner to scan chrodpro format See http://www.vromans.org/johan/projects/Chordii/chordpro/ See ExampleSong to see how to parse a chordpro file

Index

Constants

View Source
const (
	Eof = -(iota + 1)
	NewLineToken
	TextToken
	DirectiveToken
	ChordToken
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Directive

type Directive struct {
	Name string
	Data string
}

A ChordPro directive

func ParseDirective

func ParseDirective(s string) *Directive

Parse a Directive, split the directive in name and Data

type Scanner

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

A Scanner produces tokens from text

func NewScanner

func NewScanner(src io.Reader) (*Scanner, error)

Return a new Scanner from a Reader

func (*Scanner) GetCursorPosition

func (s *Scanner) GetCursorPosition() int

Get the Current position of the cursor

func (*Scanner) NextToken

func (s *Scanner) NextToken() (Token, string)

Scan the next token and the text representing the token

type Token

type Token int

Jump to

Keyboard shortcuts

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