aboutsummaryrefslogtreecommitdiff
path: root/lexem.go
diff options
context:
space:
mode:
Diffstat (limited to 'lexem.go')
-rw-r--r--lexem.go20
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"
+)