//Interpret the given list of token to meaningful query
Interpret the given list of token to meaningful query
// Interpret the given list of token to meaningful query
func Interpret(toks []FastToken) (*Query, error) {
	rules := MatchRules(toks)
	q := &Query{Tables: map[string]TableNode{}}
	for _, rule := range rules {
		for _, i := range rule.Matches {
			qu, err := rule.Resolve(*q, toks, i)
			if err != nil {
				fmt.Println("Couldn't apply the rule", rule.Name, "to the query at index", i, err)
				continue
			}
			*q = qu
		}
	}
	return q, nil
}
func Interpret ( toks [ ] FastToken ) ( * Query , error ) { rules := MatchRules ( toks ) q := & Query { Tables : map [ string ] TableNode { } } for _ , rule := range rules { for _ , i := range rule . Matches { qu , err := rule . Resolve ( * q , toks , i ) if err != nil { fmt . Println ( " " , rule . Name , " " , i , err ) continue } * q = qu } } return q , nil }
Interpret the given list of token to meaningful query
Interpret the given list of token to meaningful query
/*
	 * Will run the tokens through the rule match to get the rules to be run
	 * Then will run the rules on the tokens
	 */ //running through rules for finding matches //iterating through the rules to resolve them