All Projects → bblfsh → documentation

bblfsh / documentation

Licence: CC-BY-SA-4.0 license
Babelfish documentation (GitBook)

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to documentation

FreeBSD-Ask
FreeBSD 教程——FreeBSD 从入门到跑路。
Stars: ✭ 113 (+182.5%)
Mutual labels:  gitbook
openfisca-doc
User guide of OpenFisca
Stars: ✭ 15 (-62.5%)
Mutual labels:  gitbook
TypeScript-Library-Checklist
Your pre-launch checklist.
Stars: ✭ 19 (-52.5%)
Mutual labels:  gitbook
doc
Documentation repository for wallabag v2.
Stars: ✭ 18 (-55%)
Mutual labels:  gitbook
OSODOS
Open Science, Open Data, Open Source
Stars: ✭ 23 (-42.5%)
Mutual labels:  gitbook
gitbook-plugin-autotheme
GitBook自动换肤插件
Stars: ✭ 13 (-67.5%)
Mutual labels:  gitbook
mpspider
公众号文章抓取&生成kindle电子书
Stars: ✭ 51 (+27.5%)
Mutual labels:  gitbook
redux-saga-in-korean
redux-saga 공식문서의 한국어 번역 프로젝트.
Stars: ✭ 73 (+82.5%)
Mutual labels:  gitbook
myBook
使用GitBook记录开发笔记
Stars: ✭ 30 (-25%)
Mutual labels:  gitbook
user-stories-applied
敏捷的用户故事方法
Stars: ✭ 33 (-17.5%)
Mutual labels:  gitbook
creating-controls-in-assembler
Gitbook: https://mrfearless.gitbooks.io/creating-controls-in-assembler
Stars: ✭ 20 (-50%)
Mutual labels:  gitbook
jekyll-gitbook
Build Jekyll site with GitBook style!
Stars: ✭ 226 (+465%)
Mutual labels:  gitbook
vuepress-theme-book
A VuePress theme inspired by Gitbook
Stars: ✭ 107 (+167.5%)
Mutual labels:  gitbook
ydkjs-vim
📖 You Don't Know Js in Vim doc
Stars: ✭ 14 (-65%)
Mutual labels:  gitbook
content
Synced content from our gitbook site.
Stars: ✭ 37 (-7.5%)
Mutual labels:  gitbook
gitbook-plugin-search-plus
gitbook powerful search plugin
Stars: ✭ 27 (-32.5%)
Mutual labels:  gitbook
Xcode-Error-Collection
总结的Xcode报错问题以及解决方法,希望在开发的路上都可以少走一些弯路。
Stars: ✭ 45 (+12.5%)
Mutual labels:  gitbook
gitbook-plugin-tags
Tags plugin for GitBook
Stars: ✭ 18 (-55%)
Mutual labels:  gitbook
thegreatmarkdown
《了不起的 Markdown》
Stars: ✭ 44 (+10%)
Mutual labels:  gitbook
master
This is an Open-Source, community-driven project for the creation of a documentation hub for Raspberry Pi and ARM Cardano Stake Pool Operators.
Stars: ✭ 18 (-55%)
Mutual labels:  gitbook

Babelfish - Universal Code Parser

Introduction

Babelfish is a self-hosted server for source code parsing. The Babelfish service can parse any file, in any supported language, extracting an Abstract Syntax Tree (AST) from it and converting it into a Universal Abstract Syntax Tree (UAST). The UAST enables further analysis and transformations with either the included tools or your own tools by providing a standard open format. Jump to the Getting Started section to start using it!

Motivation & Scope

Babelfish was created as a solution for large scale code analysis. To analyze the source code from millions of repositories, at each revision.

The current scope is to enable parsing of single files in any popular programming language and producing a Universal Abstract Syntax Tree (UAST).

This current scope is expected to expand in the near future to full project analysis, where the source code can be analyzed with its full context, and not just per-file.

For more information about how Babelfish compares to other similar systems, see this page.

Use Cases

Some of the use cases that we aim to support with UAST are:

  • Feature extraction for Machine Learning on Code: For example, extracting a list of all tokens for every file, or a list of all function calls, etc.
  • Language-agnostic static analysis: making it easy to write static analyzers in any language, analyzing any supported language
  • UAST diffs: Understanding changes made to code with finer-grained granularity. Is this commit changing variable names? Is it adding a loop?
  • Uniform import extraction: Extracting all imports from every language in a uniform way.
  • Statistical analysis of language features: How many people use for-comprehension in Python.

Current status

Universal AST coverage

Not all constructs are converted in a language-independent way yet. As of Q1 2019, every language driver is expected to support Identifiers, String literals, Imports, and Functions in the Universal AST schema.

That is sufficient to examine the symbols exported by the package, but not control flow (yet).

Meanwhile, in order to identify constructs that are not covered by the UAST schema yet - one can look for a @role field. A Role is added to every native AST node and it contains a language-independent annotations. However, the tree structure for a role construct may be different between languages.

Protocol v2

Currently, Babelfish is in the process of transition to an updated data model, denoted UAST v2, which includes a new node representation and canonicalized ("semantic") UAST structures.

All the beta+ drivers support UAST v2 in their latest versions. UAST v2 support requires bblfshd ≥ 2.6.1.

Libuast has been updated to support the new node format, but some of the the clients may still work in v1 compatibility mode to be able to execute XPath queries.

See v2 transition options for details.

Further Reading

This repository contains the project documentation, which you can also see properly rendered at https://docs.sourced.tech/babelfish.

License

This work is licensed under a Creative Commons — Attribution-ShareAlike 4.0 International License. See LICENSE.

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].