Comments (1)
Thank you very much for your cooperation ! Cooperation for you to implement DDL is not spare. So, please ask me anything you do not understand.
The following outlines the steps for implementing DDL.
-
First of all, I think that the implementation starts from the point of defining the syntax of DDL. I used only DML statements as a reference from the grammar definitions published in sqlite-parser. After that, I added and changed the grammar so that I could cope with other DBMS to some extent. So the syntax of sqlite-parser may be helpful.
-
Next, create a class that inherits from the Node class for Statements and its lower level grammar elements. This class is a class that generates each node of Syntax tree output by miniSqlParser. It is necessary to determine which grammar element to make a class.
-
Next, use the Antlr4 to generate a parser and a lexer code from the defined grammar.
-
Next, create a callback function called from the parser in MakeASTListener.cs (and MakeASTListener_Expr.cs, MakeASTListener_Predicate.cs). These functions correspond to individual grammar elements. When a SQL statement is parsed, if a grammar element is found, the corresponding function is called.
The function creates an object from the class corresponding to the grammar element and puts it on the stack (MakeASTListener._stack). In the callback function of the upper grammar element, Pop out the object pushed by the callback function of the lower grammar element, store the fetched object in the object corresponding to the upper grammar element and push it. -
Finally, make test code.
from minisqlparser.
Related Issues (8)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from minisqlparser.