# 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:
python -m pip install compilerlab5
After installation, the package can be used from any supported Python environment.
## Usage
### 1. LALR Bottom-Up Parser
compilerlab5 lalr
Example input:
i+i\*i
### 2. SLR(1) Parser
compilerlab5 slr
Example input:
dd
### 3. Three-Address Code Generator
compilerlab5 tac
Example input:
a+b\*c
### 4. Lexical Analyzer for Operators
compilerlab5 operator
Example input:
\+
### 5. Shift-Reduce Parser
compilerlab5 shift-reduce
Example input:
id+id\*id
## Individual Commands
The individual console commands are also available:
lalr-parser
slr-parser
tac-generator
operator-validator
shift-reduce-parser
## Python Module Usage
The package can also be executed through Python:
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:
python -m pip install --upgrade build
python -m build
Install the generated wheel:
python -m pip install dist/compilerlab5-0.1.1-py3-none-any.whl
## PyPI Publishing
Build the package:
python -m build
Check the generated distributions:
dir dist
Upload the distributions using Twine:
python -m twine upload dist/\*
For PyPI authentication, use the username:
\_\_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:
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.
Release files for compilerlab5 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| compilerlab5-0.1.1.tar.gz | 8.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| compilerlab5-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size:19.1 kB
Release files / compilerlab5-0.1.1.tar.gz
| Download URL | compilerlab5-0.1.1.tar.gz |
|---|---|
| Size | 8.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
94479c0639d253a3f512f30e63308e84e321368315568ee877eb18fdb183681f
|
|
BLAKE2b-256 checksum How to use checksums |
363a0f9ce7192674859890359c33fc333aac8a44d8f9a8a78083e3e8dc14332e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|
Release files / compilerlab5-0.1.1-py3-none-any.whl
| Download URL | compilerlab5-0.1.1-py3-none-any.whl |
|---|---|
| Size | 10.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dddfdd968f950bb7144f226b1fe1a9eb2b953ed1ec2e5e96f50c13305ea7ac0d
|
|
BLAKE2b-256 checksum How to use checksums |
05a5145bb8c440ea95c4803c6feff64ee6009ddfc5c9961586a8f8772069da90
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|