lord-tejal 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- lord_tejal-0.1.0/LICENSE +21 -0
- lord_tejal-0.1.0/PKG-INFO +87 -0
- lord_tejal-0.1.0/README.md +39 -0
- lord_tejal-0.1.0/cmd.txt +43 -0
- lord_tejal-0.1.0/compiler +0 -0
- lord_tejal-0.1.0/expr.c +25 -0
- lord_tejal-0.1.0/expr.h +11 -0
- lord_tejal-0.1.0/input.c +3 -0
- lord_tejal-0.1.0/lex.yy.c +1951 -0
- lord_tejal-0.1.0/lexer +0 -0
- lord_tejal-0.1.0/loop_optimizer +0 -0
- lord_tejal-0.1.0/parser.tab.c +1703 -0
- lord_tejal-0.1.0/parser.tab.h +100 -0
- lord_tejal-0.1.0/prac10 +0 -0
- lord_tejal-0.1.0/prac6.l +47 -0
- lord_tejal-0.1.0/prac6.y +136 -0
- lord_tejal-0.1.0/practical-10 +0 -0
- lord_tejal-0.1.0/practical-10.cpp +128 -0
- lord_tejal-0.1.0/practical-1_2.ipynb +629 -0
- lord_tejal-0.1.0/practical-3.l +155 -0
- lord_tejal-0.1.0/practical-4 +0 -0
- lord_tejal-0.1.0/practical-4.l +38 -0
- lord_tejal-0.1.0/practical-4.y +79 -0
- lord_tejal-0.1.0/practical-5 +0 -0
- lord_tejal-0.1.0/practical-5.l +82 -0
- lord_tejal-0.1.0/practical-5.y +124 -0
- lord_tejal-0.1.0/practical3_lex.c +2051 -0
- lord_tejal-0.1.0/practical5 +0 -0
- lord_tejal-0.1.0/practical7.l +53 -0
- lord_tejal-0.1.0/practical7.y +117 -0
- lord_tejal-0.1.0/practical8.l +43 -0
- lord_tejal-0.1.0/practical8.y +167 -0
- lord_tejal-0.1.0/practical9 +0 -0
- lord_tejal-0.1.0/practical9.c +115 -0
- lord_tejal-0.1.0/practical9.cpp +70 -0
- lord_tejal-0.1.0/practical9.l +46 -0
- lord_tejal-0.1.0/practical9.y +84 -0
- lord_tejal-0.1.0/pyproject.toml +66 -0
- lord_tejal-0.1.0/semantic_analyzer +0 -0
- lord_tejal-0.1.0/src/lord_tejal/__init__.py +23 -0
- lord_tejal-0.1.0/src/lord_tejal/py.typed +0 -0
- lord_tejal-0.1.0/tac +0 -0
- lord_tejal-0.1.0/temp.c +7 -0
- lord_tejal-0.1.0/tests/__init__.py +0 -0
- lord_tejal-0.1.0/y.tab.c +1667 -0
- lord_tejal-0.1.0/y.tab.h +98 -0
lord_tejal-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Your Name
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: lord-tejal
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: lord-tejal: A minimal, modern Python package.
|
|
5
|
+
Project-URL: Homepage, https://github.com/yourname/lord-tejal
|
|
6
|
+
Project-URL: Repository, https://github.com/yourname/lord-tejal
|
|
7
|
+
Project-URL: Issues, https://github.com/yourname/lord-tejal/issues
|
|
8
|
+
Author-email: Your Name <you@example.com>
|
|
9
|
+
License: MIT License
|
|
10
|
+
|
|
11
|
+
Copyright (c) 2026 Your Name
|
|
12
|
+
|
|
13
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
15
|
+
in the Software without restriction, including without limitation the rights
|
|
16
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
17
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
18
|
+
furnished to do so, subject to the following conditions:
|
|
19
|
+
|
|
20
|
+
The above copyright notice and this permission notice shall be included in all
|
|
21
|
+
copies or substantial portions of the Software.
|
|
22
|
+
|
|
23
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
24
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
25
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
26
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
27
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
28
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
29
|
+
SOFTWARE.
|
|
30
|
+
License-File: LICENSE
|
|
31
|
+
Keywords: lord-tejal,package,python
|
|
32
|
+
Classifier: Development Status :: 3 - Alpha
|
|
33
|
+
Classifier: Intended Audience :: Developers
|
|
34
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
35
|
+
Classifier: Programming Language :: Python :: 3
|
|
36
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
37
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
38
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
39
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
40
|
+
Classifier: Typing :: Typed
|
|
41
|
+
Requires-Python: >=3.9
|
|
42
|
+
Provides-Extra: dev
|
|
43
|
+
Requires-Dist: mypy>=1.10; extra == 'dev'
|
|
44
|
+
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
|
|
45
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
46
|
+
Requires-Dist: ruff>=0.4; extra == 'dev'
|
|
47
|
+
Description-Content-Type: text/markdown
|
|
48
|
+
|
|
49
|
+
# PCD
|
|
50
|
+
|
|
51
|
+
> A minimal, modern Python package — ready for local development and PyPI publishing.
|
|
52
|
+
|
|
53
|
+
## Installation
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# from PyPI (once published)
|
|
57
|
+
pip install PCD
|
|
58
|
+
|
|
59
|
+
# for local development
|
|
60
|
+
git clone https://github.com/yourname/PCD.git
|
|
61
|
+
cd PCD
|
|
62
|
+
pip install -e ".[dev]"
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Quick Start
|
|
66
|
+
|
|
67
|
+
```python
|
|
68
|
+
from PCD import hello
|
|
69
|
+
|
|
70
|
+
print(hello("Alice"))
|
|
71
|
+
# Hello, Alice! from PCD 0.1.0
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Development
|
|
75
|
+
|
|
76
|
+
| Task | Command |
|
|
77
|
+
|------|---------|
|
|
78
|
+
| Run tests | `pytest` |
|
|
79
|
+
| Lint | `ruff check src tests` |
|
|
80
|
+
| Format | `ruff format src tests` |
|
|
81
|
+
| Type-check | `mypy src` |
|
|
82
|
+
| Build wheel | `python -m build` |
|
|
83
|
+
| Publish | `twine upload dist/*` |
|
|
84
|
+
|
|
85
|
+
## License
|
|
86
|
+
|
|
87
|
+
[MIT](LICENSE)
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# PCD
|
|
2
|
+
|
|
3
|
+
> A minimal, modern Python package — ready for local development and PyPI publishing.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# from PyPI (once published)
|
|
9
|
+
pip install PCD
|
|
10
|
+
|
|
11
|
+
# for local development
|
|
12
|
+
git clone https://github.com/yourname/PCD.git
|
|
13
|
+
cd PCD
|
|
14
|
+
pip install -e ".[dev]"
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Quick Start
|
|
18
|
+
|
|
19
|
+
```python
|
|
20
|
+
from PCD import hello
|
|
21
|
+
|
|
22
|
+
print(hello("Alice"))
|
|
23
|
+
# Hello, Alice! from PCD 0.1.0
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Development
|
|
27
|
+
|
|
28
|
+
| Task | Command |
|
|
29
|
+
|------|---------|
|
|
30
|
+
| Run tests | `pytest` |
|
|
31
|
+
| Lint | `ruff check src tests` |
|
|
32
|
+
| Format | `ruff format src tests` |
|
|
33
|
+
| Type-check | `mypy src` |
|
|
34
|
+
| Build wheel | `python -m build` |
|
|
35
|
+
| Publish | `twine upload dist/*` |
|
|
36
|
+
|
|
37
|
+
## License
|
|
38
|
+
|
|
39
|
+
[MIT](LICENSE)
|
lord_tejal-0.1.0/cmd.txt
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
|
|
2
|
+
1. Update Package Lists
|
|
3
|
+
sudo apt update
|
|
4
|
+
|
|
5
|
+
2. Install Flex and Bison
|
|
6
|
+
|
|
7
|
+
sudo apt install flex bison
|
|
8
|
+
|
|
9
|
+
3. Verify the Installation
|
|
10
|
+
|
|
11
|
+
flex --version
|
|
12
|
+
bison --version
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
1. Process the Bison Parser File
|
|
16
|
+
|
|
17
|
+
Run Bison first to generate the parser C code and the token header file (y.tab.h or parser.tab.h), which the lexer needs:
|
|
18
|
+
|
|
19
|
+
bison -d parser.y
|
|
20
|
+
|
|
21
|
+
Note: This generates parser.tab.c and parser.tab.h (or y.tab.c/y.tab.h depending on your version).
|
|
22
|
+
|
|
23
|
+
2. Process the Flex Lexer File
|
|
24
|
+
|
|
25
|
+
Run Flex to generate the lexer C code:
|
|
26
|
+
|
|
27
|
+
flex lexer.l
|
|
28
|
+
|
|
29
|
+
Note: This generates a file named lex.yy.c.
|
|
30
|
+
|
|
31
|
+
3. Compile the Generated C Files
|
|
32
|
+
|
|
33
|
+
Compile all the generated C files together using gcc and link the Flex library (-lfl):
|
|
34
|
+
|
|
35
|
+
gcc parser.tab.c lex.yy.c -lfl -o my_program
|
|
36
|
+
|
|
37
|
+
(If your code includes a custom main() function and doesn't rely on the default flex library library, you can omit -lfl).
|
|
38
|
+
|
|
39
|
+
4. Run the Executable
|
|
40
|
+
|
|
41
|
+
Execute your compiled program:
|
|
42
|
+
|
|
43
|
+
./my_program
|
|
Binary file
|
lord_tejal-0.1.0/expr.c
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#include <stdio.h>
|
|
2
|
+
#include <stdlib.h>
|
|
3
|
+
#include <string.h>
|
|
4
|
+
#include "expr.h"
|
|
5
|
+
|
|
6
|
+
static int temp_count = 0;
|
|
7
|
+
static int label_count = 0;
|
|
8
|
+
|
|
9
|
+
char *newtemp(void) {
|
|
10
|
+
char temp[20];
|
|
11
|
+
sprintf(temp, "t%d", ++temp_count);
|
|
12
|
+
|
|
13
|
+
char *s = malloc(strlen(temp) + 1);
|
|
14
|
+
strcpy(s, temp);
|
|
15
|
+
return s;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
char *newlabel(void) {
|
|
19
|
+
char temp[20];
|
|
20
|
+
sprintf(temp, "L%d", ++label_count);
|
|
21
|
+
|
|
22
|
+
char *s = malloc(strlen(temp) + 1);
|
|
23
|
+
strcpy(s, temp);
|
|
24
|
+
return s;
|
|
25
|
+
}
|
lord_tejal-0.1.0/expr.h
ADDED
lord_tejal-0.1.0/input.c
ADDED