Exemple #1
0
func parseUNQL(input string) {
	_ = C.parse(C.CString(input))
	log.Printf("after all")

	//x.tree.toStringTree(x.tree)

	//log.Printf("%+v", x)
	//log.Printf("%T", x.start)
	//log.Printf("%+v", x.start)
	//log.Printf("%T", x.tree)
	//log.Printf("%+v", x.tree)

	//log.Printf("%T", x.tree.super)
	//log.Printf("Here its:%+v", x.tree.super)

	//var y C.pANTLR3_COMMON_TREE = (C.pANTLR3_COMMON_TREE)(x.tree.super)

	//log.Printf("%T", y)
	//log.Printf("Now its: %+v", y)
	//log.Printf("Now its really type: %T", *y)
	//log.Printf("Now its really: %+v", *y)

	//log.Printf("Now its really type: %T", *(y.token))
	//log.Printf("Now its really: %+v", *(y.token))

}
Exemple #2
0
func Parse(source string) (code int, result string) {
	c_source := C.CString(source)
	c_result := C.CString("")

	code = int(C.parse(c_source, &c_result))
	result = C.GoString(c_result)

	C.free(unsafe.Pointer(c_source))
	C.free(unsafe.Pointer(c_result))

	return
}