tokenizer

package
v0.0.0-...-437b54e Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: GPL-2.0 Imports: 1 Imported by: 3

Documentation

Overview

Package tokenizer contains the tokenizer we use for parsing BASIC programs.

Given a string containing a complete BASIC program this package allows that to be iterated over as a series of tokens.

Our interpeter is intentionally naive, and executes tokens directly, without any intermediary representation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tokenizer

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

Tokenizer holds our state.

func New

func New(input string) *Tokenizer

New returns a Tokenizer instance from the specified string input.

func (*Tokenizer) NextToken

func (l *Tokenizer) NextToken() token.Token

NextToken reads and returns the next available token, skipping any white space which might be present.

Jump to

Keyboard shortcuts

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