In fact all the classes generated by antlrworks2 from a .g4 file
The grammer file should be written for sql , it should only support select , delete , update and insert.
Please find the attached file for more info
Hi, I am an experienced java developer having 6 years of experience, so i hope i can help you in finishing this job as quick as possible. I went through the document attached, still i am not clear fully about the requirement. So could you please explain the requirement more clearly?
I have build a project used antlr 4 to parser SQL, it is same saleforce. It is example:
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
grammar saleforceSQL;
statement
: selectStatement ';' EOF;
//SELECT fieldList
//[TYPEOFtypeOfField whenExpression elseExpression END]
//FROM objectType
//[WHEREconditionExpression]
//[WITH [DATA CATEGORY] filteringExpression]
//[GROUP BYfieldGroupByList] | [GROUP BY ROLLUP|CUBE (fieldSubtotalGroupByList)]
//[HAVINGhavingConditionExpression]
//[ORDER BYfieldOrderByList ASC | DESC ? NULLS FIRST | LAST ?]
//[LIMIT ?]
//[OFFSET ?]
//[UPDATE VIEWSTAT ?]
selectStatement
:
selectClause
//(typeOfClause)?
fromClause
(whereClause)?
//(withClause)?
(groupByClause)?
(havingClause)?
(orderByClause)?
(limitClause)?
;
If you hide me, i will do it success