All Projects → fkling → Astexplorer

fkling / Astexplorer

A web tool to explore the ASTs generated by various parsers.

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects
shell
77523 projects
EJS
674 projects

Projects that are alternatives of or similar to Astexplorer

Astexplorer.app
https://astexplorer.net with ES Modules support and Hot Reloading
Stars: ✭ 65 (-98.5%)
Mutual labels:  babel, ast, parser, postcss
Reshape
💠 transform html with javascript plugins
Stars: ✭ 314 (-92.75%)
Mutual labels:  babel, ast, postcss
Postcss
Transforming styles with JS plugins
Stars: ✭ 25,612 (+491.5%)
Mutual labels:  ast, parser, postcss
Babylon
PSA: moved into babel/babel as @babel/parser -->
Stars: ✭ 1,692 (-60.92%)
Mutual labels:  babel, ast, parser
postcss-rs
🚀 Fast and 100% API compatible postcss replacer, built in Rust
Stars: ✭ 414 (-90.44%)
Mutual labels:  postcss, ast
Webpack-Starter-Kit
Webpack 4 stater kit with SCSS, PostCSS, Babel & ESLint
Stars: ✭ 41 (-99.05%)
Mutual labels:  babel, postcss
Jsqlparser
JSqlParser parses an SQL statement and translate it into a hierarchy of Java classes. The generated hierarchy can be navigated using the Visitor Pattern
Stars: ✭ 3,405 (-21.36%)
Mutual labels:  ast, parser
Exprtk
C++ Mathematical Expression Parsing And Evaluation Library
Stars: ✭ 301 (-93.05%)
Mutual labels:  ast, parser
Gopablo
🐺 Static site generator.
Stars: ✭ 166 (-96.17%)
Mutual labels:  babel, postcss
Webpack Blocks
📦 Configure webpack using functional feature blocks.
Stars: ✭ 2,992 (-30.9%)
Mutual labels:  babel, postcss
I18nize React
Internationalize react apps within a lunch break
Stars: ✭ 389 (-91.02%)
Mutual labels:  babel, ast
astravel
👟 Tiny and fast ESTree-compliant AST walker and modifier.
Stars: ✭ 38 (-99.12%)
Mutual labels:  ast, ast-explorer
gogoAST
The simplest tool to parse/transform/generate code on ast
Stars: ✭ 29 (-99.33%)
Mutual labels:  ast, jscodeshift
react-enterprise-starter-kit
Highly Scalable Awesome React Starter Kit for an enterprise application with a very easy maintainable codebase. 🔥
Stars: ✭ 55 (-98.73%)
Mutual labels:  babel, postcss
Vanilla Back To Top
Simple and smooth Back To Top button
Stars: ✭ 179 (-95.87%)
Mutual labels:  babel, postcss
Bblfshd
A self-hosted server for source code parsing
Stars: ✭ 297 (-93.14%)
Mutual labels:  ast, parser
Astroid
A common base representation of python source code for pylint and other projects
Stars: ✭ 310 (-92.84%)
Mutual labels:  ast, parser
Pwa
An opinionated progressive web app boilerplate
Stars: ✭ 353 (-91.85%)
Mutual labels:  babel, postcss
Ratel Core
High performance JavaScript to JavaScript compiler with a Rust core
Stars: ✭ 367 (-91.52%)
Mutual labels:  ast, parser
Hops
Universal Development Environment
Stars: ✭ 158 (-96.35%)
Mutual labels:  babel, postcss

AST explorer

Join the chat at https://gitter.im/astexplorer/Lobby Build Status

Paste or drop code into the editor and inspect the generated AST on https://astexplorer.net/

The AST explorer provides following code parsers:

Experimental / custom syntax

Depending on the parser settings, it not only supports ES5/CSS3 but also

Transforms

Since future syntax is supported, the AST explorer is a useful tool for developers who want to create AST transforms. In fact, following transformers are included so you can prototype your own plugins:

More Features

  • Save and fork code snippets. Copy the URL to share them.
  • Copying an AST or dropping a file containing an AST into the window will parse the AST and update the code using escodegen.
  • Otherwise, the content of text editor will be replaced with the content of the file (i.e. you can drag and drop JS files).
  • Choose between multiple parsers and configure them.
  • shift+click on a node expands the full subtree.
  • Hovering over a node highlights the corresponding text in the source code
  • Editing the source or moving the cursor around will automatically highlight the corresponding AST node (or its ancestors of it isn't expanded)
  • You can use $node in the console to refer to the last opened/toggled AST node.

Contributions

I'm happy about any feedback, feature request or PR to make this tool as useful as possible!


How to add a new parser

  1. Go to website/.
  2. Install the new parser as dependency: yarn add theParser (or npm install -S theParser)
  3. Copy one of the existing examples in src/parsers/{language}.
  4. Adjust the code as necessary:
  • Update metadata.
  • Load the right parser (loadParser).
  • Call the right parsing method with the right/necessary options in parse.
  • Implement the nodeToRange method (this is for highlighting).
  • Implement the getNodeName method (this is for quick look through the tree).
  • Implement opensByDefault method for auto-expansion of specific properties.
  • Define _ignoredProperties set or implement forEachProperty generator method for filtering.
  • Provide a renderSettings method if applicable.

How to add a new transformer

  1. Go to website/.
  2. Install the new transformer as dependency.
  3. Copy one of the existing examples in src/parsers/{language}/transformers.
  4. Adjust the code as necessary:
  • Update metadata and defaultParserID.
  • Load the right transformer (loadTransformer).
  • Call the transformation method in transform.
  • Change sample transformation code in codeExample.txt.

Build your own version for development

  1. Clone the repository.
  2. Go to website/.
  3. Install all dependencies with yarn install (you can run npm install as well).

Run yarn run build for the final minimized version. Run yarn run watch for incremental builds.

Run yarn start to start a simple static webserver.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].