allkeywords

command
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

all-keywords generates sql/lexbase/keywords.go from sql.y.

It is generically structured with Go templates to allow for quick prototyping of different code generation structures for keyword token lookup. Previous attempts:

Using github.com/cespare/mph to generate a perfect hash function. Was 10% slower. Also attempted to populate the mph.Table with a sparse array where the index correlated to the token id. This generated such a large array (~65k entries) that the mph package never returned from its Build call.

A `KeywordsTokens = map[string]int32` map from string -> token id.

Jump to

Keyboard shortcuts

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