Syntax analyzer of Golang source code.
import "lesphina"
var les = lesphina.Read("my_go_code.go")
Now most of language entries are in les.Meta structure.
q := les.Query()
var theEntryIWant Entry
// ByKind() and ByName() could be chained
// using First() or All() to resolve this query
theEntryIWant = q.ByKind(KindInterface).ByName("someName").First()
theInterfaceIWant, ok := theEntryIWant.(*Interface)
// use it if ok!
Once les := lesphina.Read()
is called, les.Query()
could be called many times and would return a clean query handle each time.
You can use ~
at the beginning or the end of query words in ByName()
:
entries := q.ByName("Prefix~").All()
entries2 := q.ByName("~Suffix").All()