Smart Lexer

Submitted by Dickens A S on Sat, 08/29/2020 - 10:31

This is a small application/library initiative to use Lexical analysis to transform source codes to one format to another format

Example Use Case (SQL)

I have chosen SQL to transform from SQL server function to PLSL function

CHARINDEX('t', 'Customer')
INSTR('Customer', 't')

In case if the function name only needs to be replaced, then it is easy

But, here the parameter 1 becomes 2 and 2 becomes 1

Template Methodology

Currently experimenting with a complicated JSON structure like a database

"template":
[
    {
        "fr":
        {
            "name":"CHARINDEX",
            "args":
        },
        "to":
        {
            "name":"INSTR",
            "args":
        }
    }
]

This file should be named as "database.json" and put in the root folder

Example Output

Smart Lexer Screenshot

 

GitHub URL:  https://github.com/dickensas/smartlexer

 

 

Add new comment