Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/victor-wiki/codeparser
Parse code using antlr.
https://github.com/victor-wiki/codeparser
antlr code cpp csharp java javascript parse parser php python
Last synced: about 10 hours ago
JSON representation
Parse code using antlr.
- Host: GitHub
- URL: https://github.com/victor-wiki/codeparser
- Owner: victor-wiki
- Created: 2020-02-25T08:56:48.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-11-21T02:24:45.000Z (almost 2 years ago)
- Last Synced: 2024-11-02T16:39:23.478Z (12 days ago)
- Topics: antlr, code, cpp, csharp, java, javascript, parse, parser, php, python
- Language: C#
- Size: 7.64 MB
- Stars: 23
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CodeParser
Parse code using antlr.* The lexer and parser classes in **CodeParser** are generated by [Antlr grammar file](https://github.com/antlr/grammars-v4).
* 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")
~~~* parser test output
~~~
Class:HelloWorld
{
Field:owner
Field:target
Method:sayHello
}
~~~
## Viewer
![CodePaser Viewer](https://github.com/victor-wiki/StaticResources/blob/master/StaticResources/images/projs/CodeParser/Viewer.png?raw=true&rid=1)![CodePaser Viewer](https://github.com/victor-wiki/StaticResources/blob/master/StaticResources/images/projs/CodeParser/Viewer2.png?raw=true&rid=1)
## Use Case
The library [SqlAnalyser.Core](https://github.com/victor-wiki/DatabaseManager/tree/master/DatabaseConverter/SqlAnalyser.Core) of [DatabaseManager](https://github.com/victor-wiki/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.