31 مستودعات
Tools for modifying and rewriting syntax trees to generate new code structures.
Distinct from Syntax Tree Construction: Focuses on the mutation and transformation of the tree nodes rather than the initial construction of the tree.
Explore 31 awesome GitHub repositories matching software engineering & architecture · Syntax Tree Transformers. Refine with filters or upvote what's useful.
This project is a unified toolchain for JavaScript and TypeScript development, providing a suite of specialized tools for bundling, parsing, linting, and formatting source code. The toolchain is implemented in Rust and utilizes a shared internal representation to allow multiple tools to operate on the same parsed source code. It employs a parallelized analysis pipeline and single-pass parsing with error recovery to process files across CPU cores. The suite covers several core capability areas, including static analysis for identifying programmatic errors, automated style standardization, and
Implements tools for modifying and rewriting syntax trees to perform linting and formatting tasks.
oxc is a high-performance JavaScript toolchain developed in Rust for parsing, transforming, and analyzing JavaScript and TypeScript source code. It provides a set of core utilities including a parser that converts code into an abstract syntax tree, a linter for identifying problematic patterns, a formatter for standardizing visual style, and a minifier for reducing production file sizes. The project focuses on high-performance execution through a system design that utilizes single-pass parsing, zero-copy string slicing, and parallel worker processing to handle large codebases. It further opti
Implements a biphasic system that separates syntax tree analysis from code generation to optimize transformation speed.
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
Implements syntax tree transformers to rewrite language constructs into JavaScript.
Prepack is a build-time code evaluator and JavaScript bundle optimizer. It functions as a static analysis compiler that pre-evaluates static code and precalculates function results and global assignments during the build phase to accelerate startup times and reduce bundle size. The project specifically targets JSX optimization by processing syntax and node serialization to improve user interface rendering efficiency. It utilizes a partial evaluation engine and static execution analysis to replace runtime computations with precalculated constants. The tool covers a range of capabilities inclu
Implements syntax tree transformations to inline expressions and strip type annotations during the build process.
YAPF هي أداة تنسيق كود Python وأداة امتثال للأسلوب. تعمل كمُنسق قائم على AST يستخدم أشجار بناء الجملة الملموسة لضمان الاتساق الهيكلي وعرض مرئي موحد عبر ملفات المصدر. يستخدم المحرك مُحسِّن تخطيط قائماً على العقوبة لتحديد أفضل فواصل الأسطر عن طريق حساب تكاليف رقمية لخيارات التنسيق المختلفة. يستخدم معالج كود متعدد العمليات لتوزيع تنسيق ملفات متعددة عبر عدة أنوية CPU. تغطي الأداة إعادة تنسيق الكود المصدري من خلال تعديلات الملف في مكانه، وتحليل الفرق، ومعالجة أجزاء الكود الجزئية. تتضمن نظام تكوين قائماً على القواعد لإدارة إعدادات الأسلوب المسبقة، وقواعد التخطيط، وإعدادات مستوى المشروع. تشمل قدرات التكامل التحقق من امتثال الأسلوب لخطوط أنابيب التكامل المستمر، وأتمتة git hook، ووظيفة التنسيق عند الحفظ القائمة على المحرر.
Reconstructs source code by modifying concrete syntax tree representations while preserving the original structural integrity.
AST Explorer هو أداة قائمة على الويب لتحليل الكود المصدري إلى أشجار بناء جملة مجردة (AST) وتصور هيكل الشجرة الناتج. يعمل كمفتش للكود وملعب للتحويل، مما يسمح للمستخدمين باستكشاف التمثيل الهيكلي للغات برمجة مختلفة من خلال واجهة متصفح تفاعلية. توفر الأداة بيئة تحويل حيث يمكن للمستخدمين تطبيق قواعد التعديل على الأشجار المحللة لاختبار منطق تعديل الكود. تتميز برسم خرائط ثنائي الاتجاه يسلط الضوء على عقد الشجرة المطابقة والنص المصدري في وقت واحد أثناء تحرك المؤشر عبر المحرر. تدعم المنصة استيراد الكود عبر تحميل الملفات أو واجهات السحب والإفلات وتسمح بمشاركة حالات كود محددة وتكوينات المحلل من خلال عناوين URL مشفرة بالحالة.
Provides a pipeline for applying modification functions to a syntax tree to rewrite the underlying code.
SWIG is a tool that generates wrapper code to expose C and C++ libraries to a wide range of higher-level programming languages. It reads annotated C/C++ header files and produces language-specific bindings from a single interface definition, supporting languages such as Python, Java, Ruby, C#, Perl, and many others. The generated wrapper code is free from the project's GPL license, allowing users to distribute it under their own terms. The tool handles modern C++ features including templates, namespaces, smart pointers, and constructs up to C++20 through specialized parsing and code generatio
Builds an internal parse tree from C/C++ source and transforms it into target language bindings.
ts-morph هي مكتبة لمعالجة شجرة بناء الجملة المجردة (AST) في TypeScript وغلاف عالي المستوى لواجهة برمجة تطبيقات مترجم TypeScript. توفر واجهة برمجية لتحليل وتعديل وتوليد كود مصدر TypeScript، وتعمل كأداة لإعادة هيكلة الكود الآلية وتوليد كود المصدر. تبسط المكتبة عملية التنقل وفحص هياكل المشاريع من خلال تقديم تجريد موجه للكائنات فوق واجهة برمجة تطبيقات المترجم الأساسية. تسمح بالتحويل البرمجي لقواعد الكود الموجودة لأتمتة التحديثات الهيكلية وعمليات ترحيل الكود بالجملة. تغطي قدراتها التحليل الثابت للكود، والتنقل في عناصر الكود، وإدارة ملفات المصدر من خلال الاستيراد والتوليد والحذف. يدمج المشروع التحقق من النوع ويستخدم اكتشاف الملفات القائم على glob للحفاظ على تمثيل في الذاكرة لقاعدة الكود، والذي يمكن بعد ذلك حفظه مرة أخرى في نظام الملفات المادي.
Provides tools for modifying and rewriting TypeScript syntax trees to generate new code structures.
Lark هي مجموعة أدوات تحليل لـ Python تُستخدم لتعريف القواعد النحوية وتحويل النص الخام إلى أشجار تحليل مشروحة. تعمل كمولد لشجرة بناء الجملة المجردة ولغة تعريف قواعد نحوية لتحديد قواعد اللغة من خلال الرموز الطرفية والتعبيرات النمطية. توفر المكتبة تنفيذين أساسيين للتحليل: مكتبة تحليل Earley قادرة على التعامل مع جميع اللغات الخالية من السياق، بما في ذلك تلك التي تحتوي على غموض وعودية يسارية، ومكتبة تحليل LALR عالية الأداء مصممة للغات الحتمية ذات النفقات العامة المنخفضة للذاكرة. بعيداً عن التحليل الأساسي، تتضمن مجموعة الأدوات قدرات لتكوين القواعد النحوية المعيارية، وتحويل الشجرة القائم على القواعد، وتتبع الإحداثيات لمواقع المصدر. كما تدعم تسلسل قواعد LALR النحوية في وحدات محلل مستقلة.
Uses a visitor-pattern mechanism to transform parse trees into custom data structures via specific grammar branch mappings.
ts-migrate هي أداة ترحيل آلية مصممة لتحويل كود مصدر JavaScript إلى ملفات TypeScript قابلة للتجميع. تعمل كإطار عمل لترحيل الكود يستخدم أشجار بناء الجملة المجردة (AST) لإجراء عمليات إعادة هيكلة واسعة النطاق وتغييرات هيكلية عبر المشروع. توفر الأداة إطار عمل قابلاً للتخصيص لتعريف قواعد التحويل القائمة على الإضافات (plugins)، مما يسمح بأتمتة تغييرات برمجية محددة. تتضمن محركات متخصصة لتحويل تعريفات أنواع JSDoc إلى تعليقات توضيحية أصلية في TypeScript، وأداة لقمع أخطاء المترجم عن طريق إدراج تأكيدات النوع أو تعليقات التجاهل. يغطي النظام مجموعة واسعة من قدرات الترحيل، بما في ذلك تحويل أنواع خصائص React وطرق دورة الحياة، وتطبيع تعريفات الفئات، والقدرة على استهداف أدلة محددة بشكل تدريجي من خلال التصفية القائمة على الأنماط.
Modifies syntax trees to reorganize class members and apply accessibility modifiers.
Hy هو تطبيق Lisp للغة Python يسمح بكتابة صيغة Lisp التي يتم تجميعها إلى بايت كود Python. يعمل كلكنة Lisp قائمة على Python ولغة S-expression، مما يوفر وصولاً كاملاً إلى مكتبة Python القياسية والنظام البيئي. تركز اللغة على البرمجة الوصفية القائمة على الماكرو، وتتميز بنظام ماكرو يمشي في شجرة بناء الجملة المجردة (AST) وماكرو القارئ التي تسمح بتحويلات الصيغة المخصصة وقواعد التحليل. تمكن من التلاعب بشجرة بناء الجملة المجردة لتوسيع قدرات اللغة. يتضمن المشروع حلقة قراءة-تقييم-طباعة (REPL) للتطوير التفاعلي ويدعم تنفيذ النصوص البرمجية المستقلة. يغطي قدرات البرمجة الوظيفية مثل مطابقة الأنماط الهيكلية وتطوير البرامج غير المتزامنة باستخدام بنيات async وawait. يمكن ترجمة الكود المصدري إلى ملفات مصدر Python مكافئة للفحص أو التوزيع.
Provides a macro system for creating custom syntax transformations that modify the abstract syntax tree.
Recast هو محلل وطابعة AST بلغة JavaScript مصمم لإعادة هيكلة الكود المؤتمت. يقوم بتحويل الكود المصدري إلى أشجار بناء جملة مجردة يمكن تعديلها ثم طباعتها مرة أخرى إلى كود مصدري. يركز المشروع على التحويلات التي تحافظ على التنسيق، حيث يخزن البيانات الوصفية الأصلية للمسافات البيضاء والمسافات البادئة داخل عقد شجرة البناء لإعادة بناء الكود دون فقدان تخطيطه الأصلي. كما يولد خرائط مصدر على مستوى الأحرف للحفاظ على مراسلات دقيقة بين المدخلات الأصلية والمخرجات المحولة. تتضمن مجموعة الأدوات أدوات مساعدة للتلاعب بشجرة البناء باستخدام نمط الزائر (visitor pattern)، بالإضافة إلى خيارات لطباعة الأنماط العامة الجميلة. يتم توفير واجهة سطر أوامر لتنفيذ دوال التحويل هذه على الملفات المستهدفة وكتابة النتائج على القرص.
Provides tools for modifying and rewriting syntax trees to perform complex code transformations.
Poi هو مجمع وحدات ومترجم أصول قابل للتوسيع وبدون تكوين لتطوير الواجهة الأمامية الحديث. يعمل كنظام بناء يحول JavaScript و JSX و CSS إلى ملفات متوافقة مع المتصفح ويجمعها في حزم واحدة لتسليم الويب. تم بناء الأداة حول بنية المكونات الإضافية التي تسمح بامتدادات مخصصة لخط أنابيب البناء وإضافة منطق معالجة الأصول المتخصص. يستخدم نظام تعيين قائم على الاتفاقية لأتمتة إعدادات البناء والمخرجات المستهدفة دون الحاجة إلى ملفات تكوين يدوية. يغطي المشروع مجموعة واسعة من قدرات التجميع، بما في ذلك تجميع إطار عمل الواجهة الأمامية، ودقة الأصول التلقائية، ومعالجة الملفات الثابتة. يستخدم تحويلات شجرة بناء الجملة المجردة لتمكين التعديل البرمجي والتجميع الخاص بإطار العمل للكود المصدري.
Implements syntax tree transformations to enable programmatic modification and framework-specific compilation of source code.
Unified هو محرك معالجة شجرة بناء الجملة ونظام بيئي للمحتوى مصمم لتحليل وتحويل وتسلسل محتوى النص. يعمل كخط أنابيب محتوى قائم على الإضافات يحول النص الخام إلى أشجار بناء جملة مجردة منظمة باستخدام كائنات JavaScript عادية للفحص والتعديل البرمجي. يتميز المشروع ببنية نمطية تمكن من الترجمة عبر النظام البيئي، مما يسمح بتحويل أشجار بناء الجملة بين مواصفات مختلفة مثل HTML و Markdown. يستخدم نظامًا لاستنساخ المعالج غير القابل للتغيير وحاويات الحالة المشتركة، مما يضمن إمكانية توسيع وتخصيص خطوط أنابيب المعالجة دون تغيير التكوينات الأصلية. يوفر النظام قدرات شاملة لإدارة شجرة بناء الجملة، بما في ذلك الاجتياز من العمق أولاً، واختيار العقدة القائم على CSS، والتحويلات العودية. يمتد سطح معالجته إلى تحليل اللغة الطبيعية، وتحليل GitHub Flavored Markdown، ورسم خرائط أشجار بناء الجملة إلى عناصر DOM افتراضية لتصور المتصفح. يمكن دمج منطق المعالجة في تطبيقات الويب عبر مجمعات الوحدات أو شبكات توصيل المحتوى (CDNs).
Runs sequences of plugins to modify or analyze syntax trees before serialization.
TSDoc هو معيار توثيق ومواصفات لكتابة التعليقات المهيكلة في كود TypeScript. يوفر نظاماً قابلاً للنقل لتعريف البيانات الوصفية، والوسوم، والمراجع التبادلية داخل الكود المصدري لضمان التحليل والعرض المتسق عبر الأدوات المختلفة. يتضمن المشروع محلل تعليقات توثيق يقوم بتحويل التعليقات إلى شجرة بناء جملة مهيكلة، ومدققاً يفرض اتساق بناء الجملة. يسمح بتعريف وسوم توثيق مخصصة من خلال ملفات تكوين خارجية ويدعم أوضاع التحقق من بناء الجملة المتعددة للمساعدة في الامتثال للمواصفات. تغطي المواصفات مجموعة واسعة من احتياجات توثيق API، بما في ذلك تحديد مراحل الإصدار، والاستقرار، والإهمال. تدعم تفصيل معاملات الدوال، وقيم الإرجاع، وأنواع الاستثناءات، بالإضافة إلى إدارة الرؤية الداخلية، والوراثة، والمراجع التبادلية بين الإعلانات.
Converts structured syntax trees back into plain text comments to allow for automated modification of source code.
Lost is a CSS grid system and PostCSS plugin designed to define column widths and positions using mathematical calculations for responsive screen designs. It functions as a build-time tool that processes custom grid rules into browser-compatible CSS layouts. The framework transforms non-standard layout declarations into native CSS Grid and Flexbox properties. It uses a PostCSS-based pipeline to calculate exact coordinates and column widths, ensuring that the resulting styles are compatible with standard web browsers. The project operates as a preprocessor-agnostic middleware layer, allowing
Implements a PostCSS-based transformation of the CSS abstract syntax tree to modify layout properties.
Myth هي أداة بناء ومعالج مسبق لـ CSS تقوم بتحويل مواصفات التصميم الحديثة والترميز المستقبلي إلى كود متوافق مع متصفحات الويب الحالية. تعمل كأداة polyfill، حيث تحول الميزات المتقدمة إلى CSS قياسي لضمان عرض متسق عبر المتصفحات. يوفر المشروع بادئات البائعين المؤتمتة بناءً على بيانات دعم المتصفح ويحل متغيرات CSS إلى قيم ثابتة لتوافق المتصفحات القديمة. كما يتعامل مع تحويل أسماء مستعارة لاستعلامات الوسائط المخصصة ومعالجة وظائف الألوان المتقدمة إلى تنسيقات قياسية. تتضمن مجموعة الأدوات واجهة سطر أوامر لتجميع أوراق الأنماط، وتتميز بضغط المخرجات للتصغير وتوليد خرائط المصدر لتصحيح الأخطاء. كما تدعم الحسابات الرياضية في وقت البناء ومراقبة تغيير الملفات لأتمتة مسار المعالجة.
Uses an abstract syntax tree to transform modern CSS specifications into browser-compatible code.
pyupgrade is a static code modernizer and syntax upgrader for Python. It automatically rewrites source code to implement modern language features and syntax based on a specified target version. The tool focuses on removing technical debt by deleting deprecated imports, compatibility shims, and obsolete version-specific conditional blocks. It also refactors type annotations to use current standards, such as simplified generic aliases and union operators. Its capability surface includes updating standard library usage, optimizing built-in function calls, and converting verbose collection const
Implements transformations on concrete syntax trees to ensure that original source formatting and comments are preserved during rewriting.
csso is a CSS minifier and optimizer that reduces stylesheet file sizes through structural analysis and algebraic transformations. It functions as an abstract syntax tree processor, converting styles into a structured tree to perform deep analysis and semantic-preserving code transformations while maintaining the original visual presentation. The project distinguishes itself through usage-aware optimization, analyzing external HTML markup and class identifiers to prune unused styles and reorganize rules based on actual document usage. It also performs structural refactoring by identifying and
Implements a transformation system that modifies the CSS abstract syntax tree to optimize style rules.
unplugin-auto-import is a build-time import automation plugin and AST-based code transformer. It analyzes source code to identify missing identifiers and automatically injects the required import statements during the bundling process. The project functions as a cross-bundler build plugin, providing a unified abstraction layer that ensures consistent behavior across Vite, Webpack, and Rollup. It utilizes a pattern-based module resolver to scan local directories via glob patterns and employs a TypeScript declaration generator to maintain type definition files for IDE autocompletion. Its capab
Parses source code into a structural tree to identify missing identifiers and inject import statements.