Skip to main content

Parses the IFS Cloud source code, including nested SQL support.

Project description

Tree-sitter PL/SQL IFS

🚀 High-performance parser for IFS Cloud PL/SQL variant

Status: ✅ 100% success rate on entire IFS Cloud codebase (9,748 files)

Quick Start

# 1. Clone and setup
git clone <repository>
cd ifs-parser/grammars/ifs-cloud-parser

# 2. Generate grammar
npm run generate

# 3. Run tests
npm test
npm run full-codebase-test

# 4. Package for your language
npm run package python    # Creates Python wheel
npm run package node      # Creates Node.js package
npm run package csharp    # Creates C# package
npm run package all       # Creates all packages

That's it! 🎉

What You Get

Python Package (npm run package python)

dist/
├── ifs_cloud_parser-0.1.0-py3-none-any.whl  # Ready to install
└── python/                                        # Source package
    ├── setup.py                                   # Build config
    ├── pyproject.toml                            # Modern Python config
    ├── binding.cc                                # C++ binding
    ├── src/parser.c                              # Generated parser
    ├── src/tree_sitter/parser.h                  # Headers
    └── README.md                                 # Usage instructions

Install anywhere:

pip install ifs_cloud_parser-0.1.0-py3-none-any.whl

Use immediately:

import ifs_cloud_parser
from tree_sitter import Language, Parser

# Create language and parser (tree-sitter 0.25.0)
language = Language(ifs_cloud_parser.language())
parser = Parser(language)

# Parse IFS Cloud PL/SQL code
code = b"PROCEDURE Test___ IS BEGIN NULL; END;"
tree = parser.parse(code)

# Explore the syntax tree
print(tree.root_node.sexp())
print(f"Root node type: {tree.root_node.type}")
print(f"Child count: {tree.root_node.child_count}")

Features

  • 100% compatibility with IFS Cloud codebase
  • 🚀 Ultra-fast parsing with Tree-sitter
  • 📦 Simple packaging - one command creates distributable packages
  • 🔧 Auto-dependency handling - installs required build tools
  • 🎯 Clean output - flat directory structure, ready to use
  • 🔄 Multiple languages - Python, Node.js, C# support

Architecture

The parser supports:

  • Complete IFS Cloud PL/SQL variant syntax
  • IFS-specific annotations and pragmas
  • Advanced expression handling
  • EXTRACT function and built-ins
  • Comprehensive error recovery

Development

# Generate grammar from grammar.js
npm run generate

# Run grammar tests
npm test

# Test against full IFS codebase
npm run full-codebase-test

# Clean build artifacts
npm run clean

Package Structure

Each language package includes:

  • Generated parser (src/parser.c) - The core Tree-sitter parser
  • Headers (src/tree_sitter/parser.h) - Tree-sitter interface
  • Metadata (grammar.json, node-types.json) - Grammar definitions
  • Language bindings - Native interface for target language
  • Build configuration - Ready-to-build package structure
  • Usage examples - Complete documentation

Requirements

  • Node.js 16+ (for grammar generation and packaging)
  • Python 3.8+ (for Python packages)
  • C++ compiler (for building native extensions)

The packaging script automatically installs language-specific build dependencies.


Built for IFS Cloud development - This parser has been tested and validated on the complete IFS Cloud codebase, ensuring maximum compatibility and reliability.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ifs_cloud_parser-0.4.0.tar.gz (159.0 kB view details)

Uploaded Source

File details

Details for the file ifs_cloud_parser-0.4.0.tar.gz.

File metadata

  • Download URL: ifs_cloud_parser-0.4.0.tar.gz
  • Upload date:
  • Size: 159.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for ifs_cloud_parser-0.4.0.tar.gz
Algorithm Hash digest
SHA256 ceda5a95326f2f07e605b95e8880362dfeb47275e5238084961870e586de4f6e
MD5 936a68f0576646a36d50ca0603a43f23
BLAKE2b-256 4e7f868570edd9fb4f6d7dbc734ea25812cd452c394bdf0a0f87883e9b4a4fe3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page