项目作者: victor-wiki

项目描述 :
Parse code using antlr.
高级语言: C#
项目地址: git://github.com/victor-wiki/CodeParser.git
创建时间: 2020-02-25T08:56:48Z
项目社区:https://github.com/victor-wiki/CodeParser

开源协议:

下载


CodeParser

Parse code using antlr.

  • The lexer and parser classes in CodeParser are generated by Antlr grammar file.
  • The CodeParser.Test demonstrates how to parse source code file to extract class and interface with their properties and methods.
  • The CodeParser.Viewer is a visual tool to analyse the parser rules.

Example

Python

  • source code
    ~~~

    !/usr/bin/python3

class HelloWorld():
owner = “”
target = “”
def sayHello(self, word):
print(word)

x = HelloWorld()

x.sayHello(“Hello”)

  1. * parser test output

Class:HelloWorld
{
Field:owner
Field:target
Method:sayHello
}
~~~

Viewer

CodePaser Viewer

CodePaser Viewer

Use Case

The library SqlAnalyser.Core of DatabaseManager project uses the TSqlParser, MySqlParser, PlSqlParser and PostgreSqlParser to parse and translate view, function, procedure and table trigger between SqlServer, MySql, Oracle and Postgres.