The last time Hackerfall tried to access this page, it returned a not found error. A cached version of the page is below, or clickhereto continue anyway

Lexical Scanning in Go

A lexer initializes itself to lex a string and launches the state machine as a goroutine, returning the lexer itself and a channel of items. The API will change, don't worry about it now.

func lex(name, input string) (*lexer, chan item) {
    l := &lexer{
        name:  name,
        input: input,
        items: make(chan item),
    }
    go l.run()  // Concurrently run state machine.
    return l, l.items
}

Continue reading on cuddle.googlecode.com