Metadata-Version: 2.4
Name: compilerlab5
Version: 0.1.1
Summary: Five Compiler Design laboratory programs from Experiments 6-10
Author: Compiler Lab Package
License: MIT
Keywords: compiler-design,lalr,slr,three-address-code,shift-reduce,lexical-analyzer
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

\# compilerlab5



A pip-installable package containing five Compiler Design laboratory programs based on \*\*Experiment 6-10.pdf\*\*:



1\. LALR bottom-up parser demo

2\. SLR(1) parsing demo

3\. Three-address code generator

4\. Lexical analyzer for operators

5\. Shift-reduce parser



\## Installation



Install the package from PyPI:



```bash

python -m pip install compilerlab5

```



After installation, the package can be used from any supported Python environment.



\## Usage



\### 1. LALR Bottom-Up Parser



```bash

compilerlab5 lalr

```



Example input:



```text

i+i\*i

```



\### 2. SLR(1) Parser



```bash

compilerlab5 slr

```



Example input:



```text

dd

```



\### 3. Three-Address Code Generator



```bash

compilerlab5 tac

```



Example input:



```text

a+b\*c

```



\### 4. Lexical Analyzer for Operators



```bash

compilerlab5 operator

```



Example input:



```text

\+

```



\### 5. Shift-Reduce Parser



```bash

compilerlab5 shift-reduce

```



Example input:



```text

id+id\*id

```



\## Individual Commands



The individual console commands are also available:



```bash

lalr-parser

slr-parser

tac-generator

operator-validator

shift-reduce-parser

```



\## Python Module Usage



The package can also be executed through Python:



```bash

python -m cpp lalr

python -m cpp slr

python -m cpp tac

python -m cpp operator

python -m cpp shift-reduce

```



Here, `cpp` is the internal Python package name, while `compilerlab5` is the public PyPI distribution name.



\## Local Testing



From the project directory:



```bash

python -m pip install --upgrade build

python -m build

```



Install the generated wheel:



```bash

python -m pip install dist/compilerlab5-0.1.1-py3-none-any.whl

```



\## PyPI Publishing



Build the package:



```bash

python -m build

```



Check the generated distributions:



```bash

dir dist

```



Upload the distributions using Twine:



```bash

python -m twine upload dist/\*

```



For PyPI authentication, use the username:



```text

\_\_token\_\_

```



and a valid PyPI API token as the password.



\## Portability



The Python package does \*\*not\*\* require GCC or Clang to run the Python implementations.



Python is required on the target system.



The original C source files from the supplied \*\*Experiment 6-10.pdf\*\* are also included under:



```text

src/cpp/c\_sources/

```



These source files are included for laboratory/reference purposes.



\## Package Information



\*\*Distribution name:\*\* `compilerlab5`



\*\*Python package/module:\*\* `cpp`



\*\*Current version:\*\* `0.1.1`



\*\*License:\*\* MIT



\## Educational Purpose



This is a teaching/laboratory package containing examples for Compiler Design experiments 6-10.



The parser examples intentionally follow the structure and terminology of the supplied laboratory material and are intended for educational use rather than as a production compiler toolkit.



