cgrammar-0.6.0 has been yanked.
Visit the last successful build:
cgrammar-0.9.0
CGrammar
A comprehensive C language grammar parser library written in Rust, implementing the C23 standard (ISO/IEC 9899:2023).
Language Support
This library supports all major C23 features including:
- Lexical Elements: Keywords, identifiers, constants, string literals, and punctuators
- Expressions: All expression types from primary expressions to complex compound expressions
- Declarations: Variable declarations, function declarations, and type declarations
- Statements: Control flow, loops, jumps, and compound statements
- Functions: Function definitions with parameter lists and variadic arguments
- Preprocessor: Basic preprocessing token support
- Modern C Features:
- Binary constants (
0bprefix) - Digit separators in numeric literals
_BitInttype specifiertypeofandtypeof_unqualoperators_Decimal128,_Decimal32,_Decimal64types- And many more C23 additions
- Binary constants (
Quick Start
Add this to your Cargo.toml:
[]
= "0.2.0"
Basic Usage
use *;
License
This project is licensed under the Apache-2.0 License - see the LICENSE file for details.