adangel / summit-ast

Summit-AST translates parsed Apex source code into an abstract syntax tree

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Summit-AST

The Summit-AST library defines an abstract syntax tree (AST) data structure to represent Salesforce Apex source code, and it provides the translation of a parse tree into its AST representation.

This is not an official Google product.

Dependencies

This is built on top of the apex-parser Apex parser, which is a compiled ANTLR4 grammar.

All dependencies are downloaded and managed through the build system.

Build

This software is built using bazel.

$ bazel build ...

It is tested and working with the version listed in the .bazelversion file.

If you use Bazelisk to use Bazel, it will download the correct version.

Running

The primary output is an in-memory AST data structure. The library is intended to be integrated into other development tools.

There is a small SummitTool demonstration executable, which parses Apex source files, builds the AST, and prints basic information. It can be executed by running:

$ bazel run :SummitTool [files | directories ...]

Any directories will be recursively walked. The tool attempts to compile any files with the extension .cls or .trigger.

About

Summit-AST translates parsed Apex source code into an abstract syntax tree

License:Apache License 2.0


Languages

Language:Kotlin 96.2%Language:Starlark 3.8%