如何使用antlr以所需优先级的顺序解析语句?

时间:2017-08-02 11:18:02

标签: antlr4

我定义了RSQL语法:

<?php
require APPPATH . '/controllers/user/Usercontroller.php';

class PaginationController extends Usercontroller{

    public function __construct(){
        parent::__construct();
        $this->load->model("Usermodel","",true);    
    }

    private $perPage = 5;

    public function index(){
        $tutorId=$this->session->userdata('cp_userid');
        $categorycourses=$this->Usermodel->getcourses($tutorId);

        $count = $categorycourses->num_rows();

        $data['details']=$categorycourses;          
        $this->load->view("user/pagination_view",$data,true);
    }
}
?>

无论我如何尝试解析此(侦听器/访问者),带括号的语句总是按顺序进行评估。我的理解是规则中的顺序是优先顺序。但是,“name == foo,(name == bar; age = gt = 35)”之类的语句的解析树始终是

enter image description here

无论括号出现在何处。请帮我发现我错过的东西。谢谢!

0 个答案:

没有答案