Created
April 23, 2010 06:09
-
-
Save dcolish/376257 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import vector "container/vector" | |
import "fmt" | |
type Fsa struct { | |
States *vector.StringVector | |
Alpha *vector.StringVector | |
Current string | |
} | |
func main() { | |
states := new(vector.StringVector) | |
alpha := new(vector.StringVector) | |
str := []string{"q1","q2"} | |
for i := range str { | |
states.Push(str[i]) | |
} | |
str2 := []string{"a", "b"} | |
for i := range str2 { | |
alpha.Push(str2[i]) | |
} | |
foo := &Fsa{states, alpha, "q1"} | |
for i := 0 ; i < foo.States.Len(); i++ { | |
fmt.Println(foo.States.At(i)) | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment