30 open-source projects similar to lotabout/write-a-c-interpreter, ranked by how many features they have in common. Compare stars, activity and what each one does to find the best Write A C Interpreter alternative.
Esprima is a JavaScript parser that converts source code into a structured abstract syntax tree. It implements a specification-driven grammar to ensure compliance with ECMAScript standards, enabling the programmatic analysis and transformation of JavaScript programs. The project provides capabilities for lexical tokenization to break source code into individual symbols and static syntax validation to verify that scripts are well-formed without executing the code. Its functional surface covers JavaScript static analysis, lexical analysis, and the generation of abstract syntax trees.
This project is a compiler development tutorial that provides a series of guides and exercises for building a complete compiler from scratch. It focuses on the implementation of a structured compilation pipeline to transform high-level source code into executable machine instructions. The project covers the creation of a machine code generator for specific processor architectures and a static analysis framework. This framework includes methodologies for implementing type checking and constant folding to verify logic correctness before the final execution phase. The instructional material enc
PHP-Parser is a tool that converts PHP source code into an abstract syntax tree for static analysis and programmatic manipulation. It functions as a parser, a code generator, and a static analysis framework. The project enables the programmatic construction of abstract syntax tree nodes through a fluent interface and provides the ability to transform these trees back into formatted source code. It includes a serializer that exports abstract syntax trees to JSON format and reconstructs them from strings. The toolset covers several capability areas, including namespace resolution, constant exp
Acorn is a JavaScript parser that converts source text into a structured abstract syntax tree. It follows the ESTree specification to produce a standardized JSON tree format, enabling consistent analysis of code structure and language versions. The project features a plugin-based grammar extension system that allows the base parser to be extended with custom rules for experimental or non-standard language features. It also includes syntax error recovery, which inserts placeholder nodes into the tree when encountering invalid code to allow parsing to continue. The toolset covers static analys
This project is a regular expression lexer library and lexical analysis engine used to break input strings into typed token streams. It serves as a foundational component for constructing compilers or interpreters by identifying and categorizing substrings into discrete tokens. The library provides a token stream navigator featuring a cursor-based interface. This allows for sequential traversal of tokenized input and non-destructive lookahead, enabling the inspection of future tokens without advancing the internal position pointer. It includes specific support for recursive descent parsing t
This project is an educational compiler implementation and architecture demo. It serves as a small-scale C-style language compiler designed to demonstrate the fundamental stages of transforming source code into executable machine instructions. The codebase functions as a tool for compiler architecture education and design prototyping. It illustrates the process of building an educational language implementation to help users understand the mechanics of parsing and code generation. The implementation covers the primary stages of a compiler pipeline, including regular expression tokenization,
CoffeeScript is a source-to-source transpiler that transforms a concise high-level syntax into standard JavaScript. It enables the development of logic for web applications and server-side environments by converting source code into a format compatible with browsers and server runtimes. The project provides a workflow for rapid prototyping and script execution automation, allowing users to run source files through a compiler and execute the resulting code immediately without a manual build step. The tooling leverages lexical analysis and abstract syntax tree transformations to manipulate cod
Regulex is a tool that parses regular expressions into interactive syntax diagrams, rendering them directly on an HTML canvas. It converts a regex string into an abstract syntax tree and visualizes the structure as a navigable diagram, making the internal logic of a regular expression visually accessible. Beyond basic visualization, Regulex provides syntax validation that detects and reports precise errors, including invalid back references and octal escapes. It also offers a state-machine visualization mode that maps regex AST nodes to NFA-like states and transitions, rendered as a directed
The .NET Compiler Platform is a collection of open-source APIs for C# and Visual Basic that provides deep code analysis, refactoring, and automated source code generation. It serves as the core infrastructure for building development tools, offering a platform to inspect, modify, and understand source code through immutable syntax trees and semantic models. The platform distinguishes itself by providing full-fidelity syntax trees that preserve every character of source code, including whitespace and comments, alongside an incremental compilation pipeline that enables near-instant feedback dur
PHP_CodeSniffer is a static analysis tool, coding standard linter, and command-line validator for PHP. It scans files and directories to detect and report formatting errors and language-specific coding violations without executing the code. The project functions as an automated code formatter capable of correcting detected style and formatting violations to bring source code into compliance with defined standards. It uses token-based lexical analysis to match code patterns against rule sets, ensuring consistency across a codebase. The tool provides comprehensive capabilities for recursive fi
This project is the JavaScript reference implementation of the GraphQL specification. It provides a query engine and schema parser designed to parse, validate, and execute queries to retrieve or mutate data based on a defined schema. The implementation includes a framework for mapping codebase structures to a strongly typed system and a tool for converting query strings into abstract syntax trees for programmatic analysis. The library covers the full surface of GraphQL API implementation, including schema definition, language parsing, and query validation. It provides the necessary infrastru
c4 is a minimalist C compiler and programming tool designed to translate C source code into executable machine code using a small set of functions. It functions as a stripped-down compilation utility focused on a tiny codebase. The project serves as an educational tool for studying the internal mechanics of the compilation process. It implements minimalist C compilation to demonstrate how source files are transformed into low-level binary executables. The compiler utilizes a single-pass compilation model with recursive descent parsing and direct-to-binary emission. It manages the translation
The Rust RFCs repository is the formal home for the Rust language evolution process, housing the structured design documents and community review mechanisms that govern changes to the Rust programming language, its compiler, and its standard library. It defines the complete lifecycle for proposing, discussing, and implementing substantial changes through RFC documents, from initial submission and community feedback through final comment periods and sub-team sign-offs. The repository codifies the governance and collaboration processes that shape Rust's development, including mechanisms for com
JSON5 is a parser and serializer for a human-readable configuration format that extends JSON. It serves as a JavaScript-based data parser that allows for a more flexible version of the JSON specification to simplify manual editing of data files. The project provides capabilities to support comments, trailing commas, and multi-line strings. It includes utilities to convert this extended syntax into standard JSON for compatibility with tools requiring strict specifications. The library covers data serialization, string parsing, and structural syntax validation. It also provides integration for
sqlglot is a SQL parser and transpiler that represents queries as abstract syntax trees to enable structural analysis, modification, and semantic transformation. It functions as a dialect translator and query optimizer, converting SQL code between different database engines and simplifying syntax trees through rule-based normalization. The project provides a framework for defining custom SQL dialects by overriding tokenizers, parsers, and generators. It includes a lineage analyzer to track data flow from source tables through complex queries to identify the origin of specific columns. Additi
ANTLR is a grammar-based code generator and multi-language parser generator used to design and implement custom languages. It functions as a toolkit for transforming formal language definitions into executable source code for processing structured text or binary files, while providing a framework for automatically constructing and traversing hierarchical parse trees. The project is distinguished by its ability to generate lexers and parsers in various target programming languages from a single shared grammar definition. It supports grammars containing direct left recursion and utilizes adapti
Emmet is a markup code generator and web development productivity toolkit. It serves as an expansion engine that converts shorthand abbreviations and CSS-like selectors into full HTML, XML, and other markup structures. The project features a dedicated CSS shorthand expansion engine that transforms concise property codes into full style declarations, including the automatic generation of vendor prefixes and gradients. It distinguishes itself by offering a programmable expansion process through custom snippet definitions, abbreviation alias mapping, and script-based extensibility. The toolkit
Cppcheck is a static analysis tool and linter for C and C++ source code designed to detect programming errors, memory leaks, and security violations without executing the program. It functions as a bug detection engine and quality assurance tool to identify concurrency issues, type cast errors, and compliance with secure coding standards. The project provides a graphical user interface for selecting files and reviewing errors, alongside a linter for enforcing naming conventions and coding standards. It supports the creation of custom analysis rules using regular expressions to identify specif
UglifyJS2 is a suite of tools designed for parsing, beautifying, mangling, and minifying JavaScript code. It functions by converting source code into an abstract syntax tree to enable programmatic analysis and transformation, and it includes a dedicated generator for creating associated source maps. The project optimizes web production builds by compressing script logic and removing unreachable code. It utilizes name mangling to shorten variable and property names and implements a beautifier to reconstruct compressed scripts into a human-readable layout. The toolset covers broad capability a
ESTree is a formal schema and set of object interfaces used to represent JavaScript source code as a standardized abstract syntax tree. It serves as a common tree format and parser standard to ensure interoperability between different JavaScript parsers and transformation tools. The specification provides a consistent way to model language constructs, including statements, expressions, and module declarations. It includes detailed representations for modern language features such as classes, private identifiers, and short-circuiting logic like nullish coalescing and optional chaining. The pr
syn is a Rust syntax tree parser and token stream converter. It serves as a toolkit for procedural macro development, providing a framework to parse Rust source code into structured syntax trees for analysis and transformation. The project enables the manipulation of Rust abstract syntax trees through specialized visitor and folder patterns for traversing and mutating nodes. It provides a bidirectional mapping that allows developers to convert token streams into structured trees and print those trees back into tokens for code generation. The library covers a broad range of syntax analysis ca
yaml-cpp is a C++ library for parsing and emitting YAML 1.2 documents. It provides a complete YAML processing pipeline, from reading YAML content into a traversable node tree to writing in-memory data structures back as YAML text. The library represents parsed YAML as a mutable tree of typed nodes, supporting scalars, sequences, maps, and aliases. It uses a recursive-descent parser to build this node tree, and a stream-based emitter to generate YAML output incrementally. Template-based type conversion enables compile-time serialization between YAML nodes and C++ types, including support for c
Otto is a Go implementation of a JavaScript interpreter and embedded scripting engine. It provides a runtime environment for executing JavaScript code within native applications and includes a parser that converts source code into an abstract syntax tree for analysis and processing. The project enables the creation of custom scripting interfaces by binding native Go functions into the JavaScript global scope. It also includes a utility to translate JavaScript regular expression patterns into compatible formats for other programming languages. The engine supports safe script sandboxing throug
This is an educational tutorial that walks through implementing a complete JSON library from scratch in C. The project covers the full data lifecycle of JSON, including parsing text into structured in-memory representations, validating input against the specification, serializing data back into standard JSON output, and providing structured access to elements within parsed arrays and objects. The implementation is built around a hand-written recursive descent parser that processes JSON text by matching grammar rules to build a structured data tree. Parsed values are stored in a tagged union r
PegJS is a parsing expression grammar tool and JavaScript parser generator. It functions as a grammar compiler that transforms formal grammar specifications into executable JavaScript code for analyzing structured text and processing complex input strings. The system generates deterministic parsers that avoid the ambiguity of context-free grammars. It utilizes a packrat parsing model with memoization to ensure linear time complexity and employs recursive descent parsing to process input in a top-down hierarchical manner. The toolset supports the implementation of domain-specific languages an
This library is a PHP source code tokenizer and static analysis tool that converts raw PHP code into discrete tokens and structured XML representations. It functions as a serializer that transforms token streams into a machine-readable format for programmatic analysis and source tree manipulation. The project uses stream-based XML serialization and fragment-based buffer writing to maintain low memory overhead when processing large files. It allows for custom XML namespace configuration to ensure schema compatibility and avoid naming collisions during the transformation process. The toolkit c
KaTeX is a typesetting library and web math renderer that transforms TeX and LaTeX mathematical notation into high-quality HTML and CSS for web browsers. It functions as a math notation parser and LaTeX to HTML converter, capable of operating as both a client-side library and a server-side math renderer to generate static HTML expressions. The project supports a wide range of specialized mathematical rendering, including chemical equation rendering, Bra-ket notation for quantum mechanics, and mathematical logic typesetting. It provides comprehensive controls for structural layouts such as mat
JSHint is a JavaScript static analysis tool and linter designed to detect errors and enforce coding standards. It functions as a syntax validator that scans source code to identify potential logic problems and programming mistakes before the code is executed. The tool provides a command line interface for analyzing files and directories. It supports the export of analysis results into standardized formats such as Checkstyle for integration with external build tools. Analysis is managed through a system of linting rule management and environment global configuration. This includes the ability
Yaegi is a Go language interpreter and embedded scripting engine that executes Go source code at runtime without requiring a separate compilation step. It provides a mechanism for evaluating Go expressions and files dynamically, functioning as both a library for compiled applications and a standalone read-eval-print-loop environment. The project enables the integration of dynamic Go scripts into compiled programs to allow for runtime extensibility and plugin development. It facilitates the conversion of interpreted symbols from evaluated scripts into usable interfaces and types within a compi