Giter Club home page Giter Club logo

Comments (1)

hiro80 avatar hiro80 commented on August 11, 2024

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.

  1. 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.

  2. 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.

  3. Next, use the Antlr4 to generate a parser and a lexer code from the defined grammar.

  4. 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.

  5. Finally, make test code.

from minisqlparser.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.