Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

67 Commits

Repository files navigation

CEDARScript AST Parser

PyPI versionPython VersionsCode style: blackLicense

CEDARScript AST Parser is a Python library for parsing and interpreting CEDARScript, a SQL-like language designed for concise code analysis, manipulation, and refactoring tasks.

What is CEDARScript?

CEDARScript (Concise Examination, Development, And Refactoring Script) is a domain-specific language that aims to improve how AI coding assistants interact with codebases and communicate their code modification intentions. It provides a standardized way to express complex code modification and analysis operations, making it easier for AI-assisted development tools to understand and execute these tasks.

Features

  • Parse CEDARScript Abstract Syntax Tree (AST) that was generated by Tree-Sitter into a list of commands
  • Support for various code manipulation and analysis commands (CREATE, UPDATE, RM, MV, SELECT)
  • Return results in XML format for easier parsing and processing by LLM systems

Installation

You can install CEDARScript Parser using pip:

pip install cedarscript-ast-parser

Usage

Here's a quick example of how to use CEDARScript Parser:

fromcedarscript_ast_parserimportCEDARScriptASTParserparser=CEDARScriptASTParser()
code="""CREATE FILE "example.py"UPDATE FILE "example.py" INSERT AT END OF FILE CONTENT print("Hello, World!") END CONTENTEND UPDATE"""commands, errors=parser.parse_script(code)
iferrors:
forerrorinerrors:
print(f"Error: {error}")
else:
forcommandincommands:
print(f"Parsed command: {command}")

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License.

About

Lib for parsing and interpreting CEDARScript, a SQL-like language for code analysis and transformations

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages