diff options
author | Alexander Kiryukhin <a.kiryukhin@mail.ru> | 2021-03-06 22:30:32 +0300 |
---|---|---|
committer | Alexander Kiryukhin <a.kiryukhin@mail.ru> | 2021-03-06 22:30:32 +0300 |
commit | 93740d2d153b3da3a1be5707db1400106e3f6491 (patch) | |
tree | ddf705b638434710fa6304201f560f018f4864fe /lexem.go |
Initial
Diffstat (limited to 'lexem.go')
-rw-r--r-- | lexem.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lexem.go b/lexem.go new file mode 100644 index 0000000..bd24ea9 --- /dev/null +++ b/lexem.go @@ -0,0 +1,20 @@ +package unilex + +// Lexem represents part of parsed string. +type Lexem struct { + Type LexType // Type of Lexem. + Value string // Value of Lexem. + Start int // Start position at input string. + End int // End position at input string. +} + +// LexType represents type of current lexem. +type LexType string + +// Some std lexem types +const ( + // LError represents lexing error. + LError LexType = "ERROR" + // LEOF represents end of input. + LEOF LexType = "EOF" +) |