rocambole - Recursively walk and transform EcmaScript AST

  •        40

Recursively walk and add extra information/helpers to Esprima / Mozilla SpiderMonkey Parser API compatible AST.The main difference between other tools is that it also keeps information about tokens and white spaces and it is meant to be used to transform the tokens and not the string values itself.

https://github.com/millermedeiros/rocambole

Dependencies:

esprima : ~2.7.1

Tags
Implementation
License
Platform

   




Related Projects

node-falafel - transform the ast on a recursive walk

  •    Javascript

Transform the ast on a recursive walk.This modules uses acorn to create an AST from source code.

ast-types - Esprima-compatible implementation of the Mozilla JS Parser API

  •    Javascript

This module provides an efficient, modular, Esprima-compatible implementation of the abstract syntax tree type hierarchy pioneered by the Mozilla Parser API. Because it understands the AST type system so thoroughly, this library is able to provide excellent node iteration and traversal mechanisms.

node-burrito - Walk and transform the javascript AST with rice and beans on the side

  •    Javascript

Burrito makes it easy to do crazy stuff with the javascript AST.This is super useful if you want to roll your own stack traces or build a code coverage tool.

espree - An Esprima-compatible JavaScript parser

  •    Javascript

Espree started out as a fork of Esprima v1.2.2, the last stable published released of Esprima before work on ECMAScript 6 began. Espree is now built on top of Acorn, which has a modular architecture that allows extension of core functionality. The goal of Espree is to produce output that is similar to Esprima with a similar API so that it can be used in place of Esprima. The primary goal is to produce the exact same AST structure and tokens as Esprima, and that takes precedence over anything else. (The AST structure being the ESTree API with JSX extensions.) Separate from that, Espree may deviate from what Esprima outputs in terms of where and how comments are attached, as well as what additional information is available on AST nodes. That is to say, Espree may add more things to the AST nodes than Esprima does but the overall AST structure produced will be the same.

csstree - A tool set for working with CSS including fast detailed parser, walker, generator and lexer based on W3C specs and browser implementations

  •    Javascript

CSSTree is a tool set to work with CSS, including fast detailed parser (string->AST), walker (AST traversal), generator (AST->string) and lexer (validation and matching) based on knowledge of spec and browser implementations. The main goal is to be efficient and W3C spec compliant, with focus on CSS analyzing and source-to-source transforming tasks. NOTE: The project is in alpha stage since some parts need further improvements, AST format and API are subjects to change. However it's stable enough and used by packages like CSSO (CSS minifier) and SVGO (SVG optimizer) in production.


esprima - ECMAScript parsing infrastructure for multipurpose analysis

  •    TypeScript

Esprima (esprima.org, BSD license) is a high performance, standard-compliant ECMAScript parser written in ECMAScript (also popularly known as JavaScript). Esprima is created and maintained by Ariya Hidayat, with the help of many contributors. Esprima can be used to perform lexical analysis (tokenization) or syntactic analysis (parsing) of a JavaScript program.

recast - JavaScript syntax tree transformer, nondestructive pretty-printer, and automatic source map generator

  •    Javascript

In less poetic terms, Recast exposes two essential interfaces, one for parsing JavaScript code (require("recast").parse) and the other for reprinting modified syntax trees (require("recast").print). See ast-types (especially the def/core.js) module for a thorough overview of the ast api.

node-findit - Walk a directory tree in node.js

  •    Javascript

Recursively walk directory trees. Think /usr/bin/find.Return an event emitter finder that performs a recursive walk starting at basedir.

jstransform - A simple utility for pluggable JS syntax transforms using the esprima parser.

  •    Javascript

A simple utility for pluggable JS syntax transforms using the esprima parser. Note: If you're looking for a library for writing new greenfield JS transformations, consider looking at Babel or Recast instead of jstransform. We are still supporting jstransform (and intend to for a little while), but longer term we would like to direct efforts toward other open source projects that do a far better job of supporting a multi-pass JS transformation pipeline. This is important when attempting to apply many transformations to a source file. jstransform does a single pass resulting in performance benefits, but the tradeoff is that many transformations are much harder to write.

redbaron - Bottom-up approach to refactoring in python

  •    Python

RedBaron is a python library and tool powerful enough to be used into IPython solely that intent to make the process of writing code that modify source code as easy and as simple as possible. That include writing custom refactoring, generic refactoring, tools, IDE or directly modifying you source code into IPython with a higher and more powerful abstraction than the advanced texts modification tools that you find in advanced text editors and IDE. RedBaron guaranteed you that it will only modify your code where you ask him to. To achieve this, it is based on Baron a lossless AST for Python that guarantees the operation ast_to_code(code_to_ast(source_code)) == source_code. (Baron's AST is called an FST, a Full Syntax Tree).

hast - Hypertext Abstract Syntax Tree format

  •    Javascript

Hypertext Abstract Syntax Tree format. hast is a specification for representing HTML (and embedded SVG or MathML) as an abstract syntax tree. It implements the unist spec.

mdast - Markdown Abstract Syntax Tree format

  •    Javascript

Markdown Abstract Syntax Tree. mdast is a specification for representing Markdown in a syntax tree. It implements the unist spec. It can represent several flavours of Markdown, such as CommonMark and GitHub Flavored Markdown.

react-syntax-highlighter - syntax highlighting component for react with prismjs or highlightjs ast using inline styles

  •    Javascript

Check out a small demo here and see the component in action highlighting the generated test code here. There are other syntax highlighters for React out there so why use this one? The biggest reason is that all the others rely on triggering calls in componentDidMount and componentDidUpdate to highlight the code block and then insert it in the render function using dangerouslySetInnerHTML or just manually altering the DOM with native javascript. This utilizes a syntax tree to dynamically build the virtual dom which allows for updating only the changing DOM instead of completely overwriting it on any change, and because of this it is also using more idiomatic React and allows the use of pure function components brought into React as of 0.14.

treehugger - JavaScript AST (Abstract Syntax Tree) transformation tools

  •    Javascript

JavaScript AST (Abstract Syntax Tree) transformation tools

unist - Universal Syntax Tree used by @unifiedjs

  •    Javascript

Universal Syntax Tree. unist is a specification for syntax trees. It has a big ecosystem of utilities in JavaScript for working with these trees. It’s implemented by several other specifications.

c2rust - C to Rust translation, refactoring, and cross-checking

  •    Rust

The ast-exporter extracts from a C file the abstract syntax tree and type information produced by Clang and serializes it into CBOR files. The ast-importer consumes these CBOR files and generates Rust source code preserving the semantics (as understood under C99) of the initial C program. The translated Rust files will not depend directly on each other like normal Rust modules. They will export and import functions through the C API. These modules can be compiled together into a single static Rust library.

Tree-sitter - An incremental parsing system for programmings tools

  •    Rust

Tree-sitter is a parser generator tool and an incremental parsing library. It can build a concrete syntax tree for a source file and efficiently update the syntax tree as the source file is edited. It is robust and parse any programming language. It is enough to provide useful results even in the presence of syntax errors.

detective - Find all calls to require() no matter how deeply nested using a proper walk of the AST

  •    Javascript

Give some source body src, return an array of all the require() calls with string arguments. The options parameter opts is passed along to detective.find().

PGIrony - Tookit & Examples for AST Generation with Irony

  •    

A tool-kit to ease AST generation,, and further ease grammr construction, with Irony.

cmark - CommonMark parsing and rendering library and program in C

  •    C

It provides a shared library (libcmark) with functions for parsing CommonMark documents to an abstract syntax tree (AST), manipulating the AST, and rendering the document to HTML, groff man, LaTeX, CommonMark, or an XML representation of the AST. It also provides a command-line program (cmark) for parsing and rendering CommonMark documents. Portable. The library and program are written in standard C99 and have no external dependencies. They have been tested with MSVC, gcc, tcc, and clang.






We have large collection of open source products. Follow the tags from Tag Cloud >>


Open source products are scattered around the web. Please provide information about the open source projects you own / you use. Add Projects.