Added lexer stub

This commit is contained in:
Sasha Koshka 2022-08-07 15:18:59 -04:00
parent 68a6bdf511
commit 47234e9f36
1 changed files with 21 additions and 0 deletions

21
lexer/lexer.go Normal file
View File

@ -0,0 +1,21 @@
package lexer
import (
"github.com/sashakoshka/arf/file"
)
// LexingOperation holds information about an ongoing lexing operataion.
type LexingOperation struct {
file *file.File
}
// Tokenize converts a file into a slice of tokens (lexemes)
func Tokenize (file *file.File) (tokens []Token) {
lexer := LexingOperation { }
return lexer.tokenize(file)
}
// tokenize converts a file into a slice of tokens (lexemes)
func (lexer *LexingOperation) tokenize (file *file.File) (tokens []Token) {
return
}