compilerlab5 0.1.1__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.
@@ -0,0 +1,15 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026
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.
@@ -0,0 +1 @@
1
+ include src/cpp/c_sources/*.c
@@ -0,0 +1,374 @@
1
+ Metadata-Version: 2.4
2
+ Name: compilerlab5
3
+ Version: 0.1.1
4
+ Summary: Five Compiler Design laboratory programs from Experiments 6-10
5
+ Author: Compiler Lab Package
6
+ License: MIT
7
+ Keywords: compiler-design,lalr,slr,three-address-code,shift-reduce,lexical-analyzer
8
+ Requires-Python: >=3.9
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE
11
+ Dynamic: license-file
12
+
13
+ \# compilerlab5
14
+
15
+
16
+
17
+ A pip-installable package containing five Compiler Design laboratory programs based on \*\*Experiment 6-10.pdf\*\*:
18
+
19
+
20
+
21
+ 1\. LALR bottom-up parser demo
22
+
23
+ 2\. SLR(1) parsing demo
24
+
25
+ 3\. Three-address code generator
26
+
27
+ 4\. Lexical analyzer for operators
28
+
29
+ 5\. Shift-reduce parser
30
+
31
+
32
+
33
+ \## Installation
34
+
35
+
36
+
37
+ Install the package from PyPI:
38
+
39
+
40
+
41
+ ```bash
42
+
43
+ python -m pip install compilerlab5
44
+
45
+ ```
46
+
47
+
48
+
49
+ After installation, the package can be used from any supported Python environment.
50
+
51
+
52
+
53
+ \## Usage
54
+
55
+
56
+
57
+ \### 1. LALR Bottom-Up Parser
58
+
59
+
60
+
61
+ ```bash
62
+
63
+ compilerlab5 lalr
64
+
65
+ ```
66
+
67
+
68
+
69
+ Example input:
70
+
71
+
72
+
73
+ ```text
74
+
75
+ i+i\*i
76
+
77
+ ```
78
+
79
+
80
+
81
+ \### 2. SLR(1) Parser
82
+
83
+
84
+
85
+ ```bash
86
+
87
+ compilerlab5 slr
88
+
89
+ ```
90
+
91
+
92
+
93
+ Example input:
94
+
95
+
96
+
97
+ ```text
98
+
99
+ dd
100
+
101
+ ```
102
+
103
+
104
+
105
+ \### 3. Three-Address Code Generator
106
+
107
+
108
+
109
+ ```bash
110
+
111
+ compilerlab5 tac
112
+
113
+ ```
114
+
115
+
116
+
117
+ Example input:
118
+
119
+
120
+
121
+ ```text
122
+
123
+ a+b\*c
124
+
125
+ ```
126
+
127
+
128
+
129
+ \### 4. Lexical Analyzer for Operators
130
+
131
+
132
+
133
+ ```bash
134
+
135
+ compilerlab5 operator
136
+
137
+ ```
138
+
139
+
140
+
141
+ Example input:
142
+
143
+
144
+
145
+ ```text
146
+
147
+ \+
148
+
149
+ ```
150
+
151
+
152
+
153
+ \### 5. Shift-Reduce Parser
154
+
155
+
156
+
157
+ ```bash
158
+
159
+ compilerlab5 shift-reduce
160
+
161
+ ```
162
+
163
+
164
+
165
+ Example input:
166
+
167
+
168
+
169
+ ```text
170
+
171
+ id+id\*id
172
+
173
+ ```
174
+
175
+
176
+
177
+ \## Individual Commands
178
+
179
+
180
+
181
+ The individual console commands are also available:
182
+
183
+
184
+
185
+ ```bash
186
+
187
+ lalr-parser
188
+
189
+ slr-parser
190
+
191
+ tac-generator
192
+
193
+ operator-validator
194
+
195
+ shift-reduce-parser
196
+
197
+ ```
198
+
199
+
200
+
201
+ \## Python Module Usage
202
+
203
+
204
+
205
+ The package can also be executed through Python:
206
+
207
+
208
+
209
+ ```bash
210
+
211
+ python -m cpp lalr
212
+
213
+ python -m cpp slr
214
+
215
+ python -m cpp tac
216
+
217
+ python -m cpp operator
218
+
219
+ python -m cpp shift-reduce
220
+
221
+ ```
222
+
223
+
224
+
225
+ Here, `cpp` is the internal Python package name, while `compilerlab5` is the public PyPI distribution name.
226
+
227
+
228
+
229
+ \## Local Testing
230
+
231
+
232
+
233
+ From the project directory:
234
+
235
+
236
+
237
+ ```bash
238
+
239
+ python -m pip install --upgrade build
240
+
241
+ python -m build
242
+
243
+ ```
244
+
245
+
246
+
247
+ Install the generated wheel:
248
+
249
+
250
+
251
+ ```bash
252
+
253
+ python -m pip install dist/compilerlab5-0.1.1-py3-none-any.whl
254
+
255
+ ```
256
+
257
+
258
+
259
+ \## PyPI Publishing
260
+
261
+
262
+
263
+ Build the package:
264
+
265
+
266
+
267
+ ```bash
268
+
269
+ python -m build
270
+
271
+ ```
272
+
273
+
274
+
275
+ Check the generated distributions:
276
+
277
+
278
+
279
+ ```bash
280
+
281
+ dir dist
282
+
283
+ ```
284
+
285
+
286
+
287
+ Upload the distributions using Twine:
288
+
289
+
290
+
291
+ ```bash
292
+
293
+ python -m twine upload dist/\*
294
+
295
+ ```
296
+
297
+
298
+
299
+ For PyPI authentication, use the username:
300
+
301
+
302
+
303
+ ```text
304
+
305
+ \_\_token\_\_
306
+
307
+ ```
308
+
309
+
310
+
311
+ and a valid PyPI API token as the password.
312
+
313
+
314
+
315
+ \## Portability
316
+
317
+
318
+
319
+ The Python package does \*\*not\*\* require GCC or Clang to run the Python implementations.
320
+
321
+
322
+
323
+ Python is required on the target system.
324
+
325
+
326
+
327
+ The original C source files from the supplied \*\*Experiment 6-10.pdf\*\* are also included under:
328
+
329
+
330
+
331
+ ```text
332
+
333
+ src/cpp/c\_sources/
334
+
335
+ ```
336
+
337
+
338
+
339
+ These source files are included for laboratory/reference purposes.
340
+
341
+
342
+
343
+ \## Package Information
344
+
345
+
346
+
347
+ \*\*Distribution name:\*\* `compilerlab5`
348
+
349
+
350
+
351
+ \*\*Python package/module:\*\* `cpp`
352
+
353
+
354
+
355
+ \*\*Current version:\*\* `0.1.1`
356
+
357
+
358
+
359
+ \*\*License:\*\* MIT
360
+
361
+
362
+
363
+ \## Educational Purpose
364
+
365
+
366
+
367
+ This is a teaching/laboratory package containing examples for Compiler Design experiments 6-10.
368
+
369
+
370
+
371
+ 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.
372
+
373
+
374
+
@@ -0,0 +1,362 @@
1
+ \# compilerlab5
2
+
3
+
4
+
5
+ A pip-installable package containing five Compiler Design laboratory programs based on \*\*Experiment 6-10.pdf\*\*:
6
+
7
+
8
+
9
+ 1\. LALR bottom-up parser demo
10
+
11
+ 2\. SLR(1) parsing demo
12
+
13
+ 3\. Three-address code generator
14
+
15
+ 4\. Lexical analyzer for operators
16
+
17
+ 5\. Shift-reduce parser
18
+
19
+
20
+
21
+ \## Installation
22
+
23
+
24
+
25
+ Install the package from PyPI:
26
+
27
+
28
+
29
+ ```bash
30
+
31
+ python -m pip install compilerlab5
32
+
33
+ ```
34
+
35
+
36
+
37
+ After installation, the package can be used from any supported Python environment.
38
+
39
+
40
+
41
+ \## Usage
42
+
43
+
44
+
45
+ \### 1. LALR Bottom-Up Parser
46
+
47
+
48
+
49
+ ```bash
50
+
51
+ compilerlab5 lalr
52
+
53
+ ```
54
+
55
+
56
+
57
+ Example input:
58
+
59
+
60
+
61
+ ```text
62
+
63
+ i+i\*i
64
+
65
+ ```
66
+
67
+
68
+
69
+ \### 2. SLR(1) Parser
70
+
71
+
72
+
73
+ ```bash
74
+
75
+ compilerlab5 slr
76
+
77
+ ```
78
+
79
+
80
+
81
+ Example input:
82
+
83
+
84
+
85
+ ```text
86
+
87
+ dd
88
+
89
+ ```
90
+
91
+
92
+
93
+ \### 3. Three-Address Code Generator
94
+
95
+
96
+
97
+ ```bash
98
+
99
+ compilerlab5 tac
100
+
101
+ ```
102
+
103
+
104
+
105
+ Example input:
106
+
107
+
108
+
109
+ ```text
110
+
111
+ a+b\*c
112
+
113
+ ```
114
+
115
+
116
+
117
+ \### 4. Lexical Analyzer for Operators
118
+
119
+
120
+
121
+ ```bash
122
+
123
+ compilerlab5 operator
124
+
125
+ ```
126
+
127
+
128
+
129
+ Example input:
130
+
131
+
132
+
133
+ ```text
134
+
135
+ \+
136
+
137
+ ```
138
+
139
+
140
+
141
+ \### 5. Shift-Reduce Parser
142
+
143
+
144
+
145
+ ```bash
146
+
147
+ compilerlab5 shift-reduce
148
+
149
+ ```
150
+
151
+
152
+
153
+ Example input:
154
+
155
+
156
+
157
+ ```text
158
+
159
+ id+id\*id
160
+
161
+ ```
162
+
163
+
164
+
165
+ \## Individual Commands
166
+
167
+
168
+
169
+ The individual console commands are also available:
170
+
171
+
172
+
173
+ ```bash
174
+
175
+ lalr-parser
176
+
177
+ slr-parser
178
+
179
+ tac-generator
180
+
181
+ operator-validator
182
+
183
+ shift-reduce-parser
184
+
185
+ ```
186
+
187
+
188
+
189
+ \## Python Module Usage
190
+
191
+
192
+
193
+ The package can also be executed through Python:
194
+
195
+
196
+
197
+ ```bash
198
+
199
+ python -m cpp lalr
200
+
201
+ python -m cpp slr
202
+
203
+ python -m cpp tac
204
+
205
+ python -m cpp operator
206
+
207
+ python -m cpp shift-reduce
208
+
209
+ ```
210
+
211
+
212
+
213
+ Here, `cpp` is the internal Python package name, while `compilerlab5` is the public PyPI distribution name.
214
+
215
+
216
+
217
+ \## Local Testing
218
+
219
+
220
+
221
+ From the project directory:
222
+
223
+
224
+
225
+ ```bash
226
+
227
+ python -m pip install --upgrade build
228
+
229
+ python -m build
230
+
231
+ ```
232
+
233
+
234
+
235
+ Install the generated wheel:
236
+
237
+
238
+
239
+ ```bash
240
+
241
+ python -m pip install dist/compilerlab5-0.1.1-py3-none-any.whl
242
+
243
+ ```
244
+
245
+
246
+
247
+ \## PyPI Publishing
248
+
249
+
250
+
251
+ Build the package:
252
+
253
+
254
+
255
+ ```bash
256
+
257
+ python -m build
258
+
259
+ ```
260
+
261
+
262
+
263
+ Check the generated distributions:
264
+
265
+
266
+
267
+ ```bash
268
+
269
+ dir dist
270
+
271
+ ```
272
+
273
+
274
+
275
+ Upload the distributions using Twine:
276
+
277
+
278
+
279
+ ```bash
280
+
281
+ python -m twine upload dist/\*
282
+
283
+ ```
284
+
285
+
286
+
287
+ For PyPI authentication, use the username:
288
+
289
+
290
+
291
+ ```text
292
+
293
+ \_\_token\_\_
294
+
295
+ ```
296
+
297
+
298
+
299
+ and a valid PyPI API token as the password.
300
+
301
+
302
+
303
+ \## Portability
304
+
305
+
306
+
307
+ The Python package does \*\*not\*\* require GCC or Clang to run the Python implementations.
308
+
309
+
310
+
311
+ Python is required on the target system.
312
+
313
+
314
+
315
+ The original C source files from the supplied \*\*Experiment 6-10.pdf\*\* are also included under:
316
+
317
+
318
+
319
+ ```text
320
+
321
+ src/cpp/c\_sources/
322
+
323
+ ```
324
+
325
+
326
+
327
+ These source files are included for laboratory/reference purposes.
328
+
329
+
330
+
331
+ \## Package Information
332
+
333
+
334
+
335
+ \*\*Distribution name:\*\* `compilerlab5`
336
+
337
+
338
+
339
+ \*\*Python package/module:\*\* `cpp`
340
+
341
+
342
+
343
+ \*\*Current version:\*\* `0.1.1`
344
+
345
+
346
+
347
+ \*\*License:\*\* MIT
348
+
349
+
350
+
351
+ \## Educational Purpose
352
+
353
+
354
+
355
+ This is a teaching/laboratory package containing examples for Compiler Design experiments 6-10.
356
+
357
+
358
+
359
+ 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.
360
+
361
+
362
+