Skip to content

Commit

Permalink
initial commit for lexer
Browse files Browse the repository at this point in the history
  • Loading branch information
Anumodh Narayanankutty committed Jun 13, 2016
1 parent 7a1d18d commit 025acad
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 98 deletions.
61 changes: 0 additions & 61 deletions lexer.go

This file was deleted.

24 changes: 0 additions & 24 deletions lexer_test.go

This file was deleted.

11 changes: 0 additions & 11 deletions state_functions.go

This file was deleted.

18 changes: 16 additions & 2 deletions token.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,30 @@
package regnet_lex_parse

type tokenType int
type TokenType int

const (
IILEGAL tokenType = iota
IILEGAL TokenType = iota
KEY
EQUALS
PERCENT
START_BRACE
END_BRACE
REG_TEXT
WHITE_SPACE
EOF
SOME_TEXT_UNMARKED
)

const eof = rune(0)

type Position int

type Token struct {
Type TokenType
Pos Position
Text string
}

func (t Token) String() string {
return t.Text
}

0 comments on commit 025acad

Please sign in to comment.