The last time Hackerfall tried to access this page, it returned a not found error. A cached version of the page is below, or click here to 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  // Concurrently run state machine.
    return l, l.items

Continue reading on