All Projects → vickenty → Lang C

vickenty / Lang C

Licence: other
Lightweight C parser for Rust

Programming Languages

c
50402 projects - #5 most used programming language
rust
11053 projects

Projects that are alternatives of or similar to Lang C

Postcss
Transforming styles with JS plugins
Stars: ✭ 25,612 (+33162.34%)
Mutual labels:  ast, parser
Method log
Trace the history of an individual method in a git repository (experimental)
Stars: ✭ 73 (-5.19%)
Mutual labels:  ast, parser
Tolerant Php Parser
An early-stage PHP parser designed for IDE usage scenarios.
Stars: ✭ 717 (+831.17%)
Mutual labels:  ast, parser
Tenko
An 100% spec compliant ES2021 JavaScript parser written in JS
Stars: ✭ 490 (+536.36%)
Mutual labels:  ast, parser
Spoon
Spoon is a metaprogramming library to analyze and transform Java source code (up to Java 15). 🥄 is made with ❤️, 🍻 and ✨. It parses source files to build a well-designed AST with powerful analysis and transformation API.
Stars: ✭ 1,078 (+1300%)
Mutual labels:  ast, parser
Webassemblyjs
Toolchain for WebAssembly
Stars: ✭ 566 (+635.06%)
Mutual labels:  ast, parser
Php Parser
PHP parser written in Go
Stars: ✭ 787 (+922.08%)
Mutual labels:  ast, parser
Javaparser
Java 1-15 Parser and Abstract Syntax Tree for Java, including preview features to Java 13
Stars: ✭ 3,972 (+5058.44%)
Mutual labels:  ast, parser
Ical Rs
Rust parser for ics (rfc5545) and vcard (rfc6350)
Stars: ✭ 46 (-40.26%)
Mutual labels:  parser, rust-library
Metric Parser
📜 AST-based advanced mathematical parser written by Typescript.
Stars: ✭ 26 (-66.23%)
Mutual labels:  ast, parser
Tiny Compiler
A tiny compiler for a language featuring LL(2) with Lexer, Parser, ASM-like codegen and VM. Complex enough to give you a flavour of how the "real" thing works whilst not being a mere toy example
Stars: ✭ 425 (+451.95%)
Mutual labels:  ast, parser
Astexplorer.app
https://astexplorer.net with ES Modules support and Hot Reloading
Stars: ✭ 65 (-15.58%)
Mutual labels:  ast, parser
Php Parser
🌿 NodeJS PHP Parser - extract AST or tokens (PHP5 and PHP7)
Stars: ✭ 400 (+419.48%)
Mutual labels:  ast, parser
Meriyah
A 100% compliant, self-hosted javascript parser - https://meriyah.github.io/meriyah
Stars: ✭ 690 (+796.1%)
Mutual labels:  ast, parser
Astexplorer
A web tool to explore the ASTs generated by various parsers.
Stars: ✭ 4,330 (+5523.38%)
Mutual labels:  ast, parser
Esprima
ECMAScript parsing infrastructure for multipurpose analysis
Stars: ✭ 6,391 (+8200%)
Mutual labels:  ast, parser
Astroid
A common base representation of python source code for pylint and other projects
Stars: ✭ 310 (+302.6%)
Mutual labels:  ast, parser
Ratel Core
High performance JavaScript to JavaScript compiler with a Rust core
Stars: ✭ 367 (+376.62%)
Mutual labels:  ast, parser
Proposal Binary Ast
Binary AST proposal for ECMAScript
Stars: ✭ 831 (+979.22%)
Mutual labels:  ast, parser
Csstree
A tool set for CSS including fast detailed parser, walker, generator and lexer based on W3C specs and browser implementations
Stars: ✭ 1,121 (+1355.84%)
Mutual labels:  ast, parser

Lang-C

Build Status Documentation

Ligtweight parser of C language for Rust users. Almost full support for C11 revision of the language. Several GCC and Clang extensions are also supported as an option.

extern crate lang_c;
use lang_c::driver::{Config, parse}; 

fn main() {
    let config = Config::default();
    println!("{:?}", parse(&config, "example.c"));
}

Bugs

Just open an issue, bug reports and patches are most welcome.

License

Dual-licenced under Apache 2.0 or MIT licenses (see LICENSE-APACHE and LICENSE-MIT for legal terms).

Development

A number of external tools are used during development:

Parser (src/parser.rs) is built from a PEG grammar in grammar.rustpeg. It is updated manually and then committed, not generated on every build, thus no rust-peg in the list of dependencies.

For debugging purposes, it is handy to have a version rust-peg built with tracing enabled.

A makefile is used to script the development process:

  • make update parser, build the library and run the tests;
  • make trace rebuilds parser using rust-peg-trace, which is expected to be a version of rust-peg command with trace feature enabled
  • make check can be used as pre-commit git hook to make sure parser is up to date
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].