Skip to content

Instantly share code, notes, and snippets.

@dcolish
Created April 23, 2010 06:09
Show Gist options
  • Save dcolish/376257 to your computer and use it in GitHub Desktop.
Save dcolish/376257 to your computer and use it in GitHub Desktop.
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