Metadata-Version: 2.4
Name: ifs-cloud-parser
Version: 0.4.0
Summary: Parses the IFS Cloud source code, including nested SQL support.
Author-email: Sindre van der Linden <sindre@apply.no>
License-Expression: MIT
Project-URL: Homepage, https://github.com/graknol/ifs-parser
Keywords: incremental,parsing,tree-sitter,ifs-cloud-parser
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Compilers
Classifier: Topic :: Text Processing :: Linguistic
Classifier: Typing :: Typed
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: tree-sitter<0.26.0,>=0.25.0
Provides-Extra: dev
Requires-Dist: pytest>=6.0; extra == "dev"
Requires-Dist: black>=22.0; extra == "dev"
Requires-Dist: flake8>=4.0; extra == "dev"
Requires-Dist: wheel; extra == "dev"
Requires-Dist: build; extra == "dev"

# 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

```bash
# 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:**

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

**Use immediately:**

```python
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

```bash
# 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.
