ivy: robpike.io/ivy/scan Index | Files

package scan

import "robpike.io/ivy/scan"

Index

Package Files

scan.go type_string.go

type Scanner Uses

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

Scanner holds the state of the scanner.

func New Uses

func New(context value.Context, name string, r io.ByteReader) *Scanner

New creates a new scanner for the input string.

func (*Scanner) Next Uses

func (l *Scanner) Next() Token

Next returns the next token.

type Token Uses

type Token struct {
    Type Type   // The type of this item.
    Line int    // The line number on which this token appears
    Text string // The text of this item.
}

Token represents a token or text string returned from the scanner.

func (Token) String Uses

func (i Token) String() string

type Type Uses

type Type int

Type identifies the type of lex items.

const (
    EOF   Type = iota // zero value so closed channel delivers EOF
    Error             // error occurred; value is text of error
    Newline
    // Interesting things
    Assign         // '='
    Char           // printable ASCII character; grab bag for comma etc.
    GreaterOrEqual // '>='
    Identifier     // alphanumeric identifier
    LeftBrack      // '['
    LeftParen      // '('
    Number         // simple number
    Operator       // known operator
    Op             // "op", operator definition keyword
    Rational       // rational number like 2/3
    RightBrack     // ']'
    RightParen     // ')'
    Semicolon      // ';'
    Space          // run of spaces separating
    String         // quoted string (includes quotes)
)

func (Type) String Uses

func (i Type) String() string

Package scan imports 7 packages (graph) and is imported by 5 packages. Updated 2017-06-22. Refresh now. Tools for package owners.