-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
cpc.1
490 lines (488 loc) · 17.7 KB
/
cpc.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
.\" Automatically generated by Pandoc 3.1.2
.\"
.\" Define V font for inline verbatim, using C font in formats
.\" that render this, and otherwise B font.
.ie "\f[CB]x\f[]"x" \{\
. ftr V B
. ftr VI BI
. ftr VB B
. ftr VBI BI
.\}
.el \{\
. ftr V CR
. ftr VI CI
. ftr VB CB
. ftr VBI CBI
.\}
.TH "CPC" "1" "September 8, 2023" "cpc 0.1.3" "User Manual"
.hy
.SH NAME
.PP
cpc - An interpreter for CAIE Pseudocode.
.SH SYNOPSIS
.PP
\f[B]cpc\f[R] [\f[I]FILE_PATHS\f[R]] [\f[I]OPTIONS\f[R]]
.SH DESCRIPTION
.PP
\f[B]cpc\f[R] is a simple interpreter for \f[I]C\f[R]AIE
\f[I]P\f[R]seudo\f[I]c\f[R]ode written in Python3.
The language regulated by CAIE has a really retro grammar and even some
grammar will not benefit both developers and the interpreter.
Thus, some unimportant grammars are changed in this interpreter and even
some new grammars are added.
For more detailed information about this, you may look at README or
<https://github.com/iewnfod/CAIE_Code>.
.SH OPTIONS
.TP
\f[B]-c\f[R], \f[B]\[en]config\f[R]
To set configs of this interpreter
.TP
\f[B]-d\f[R], \f[B]\[en]document\f[R]
To show the official document
.TP
\f[B]-h\f[R], \f[B]\[en]help\f[R]
To show the help page
.TP
\f[B]-k\f[R], \f[B]\[en]keywords\f[R]
To show all the keywords
.TP
\f[B]-m\f[R], \f[B]\[en]migrate\f[R]
To migrate .p files in a specified directory
.TP
\f[B]-p\f[R], \f[B]\[en]parse\f[R]
To show parse information during running
.TP
\f[B]-t\f[R], \f[B]\[en]time\f[R]
To show the time for the script to run
.TP
\f[B]-u\f[R], \f[B]\[en]update\f[R]
To check or update the version (only if \f[I]cpc\f[R] is installed with
git)
.TP
\f[B]-v\f[R], \f[B]\[en]version\f[R]
To show the version of installed \f[I]cpc\f[R]
.TP
\f[B]-gt\f[R], \f[B]\[en]get-tree\f[R]
To show the tree of the program after being parsed
.TP
\f[B]-lc\f[R], \f[B]\[en]list-configs\f[R]
To show all configs of the interpreter
.TP
\f[B]-ne\f[R], \f[B]\[en]no-error\f[R]
To remove all error messages
.TP
\f[B]-rc\f[R], \f[B]\[en]reset-configs\f[R]
To reset all the configs of the interpreter
.SS CONFIGS
.TP
\f[B]remote\f[R] - \f[I]Github\f[R] \f[I]Gitee\f[R]
To decide the update source
.TP
\f[B]dev\f[R] - \f[I]true\f[R] \f[I]false\f[R]
To toggle the developer mod
.TP
\f[B]branch\f[R] - \f[I]stable\f[R] \f[I]nightly\f[R] \f[I]dev\f[R]
To deicide the update branch
.TP
\f[B]recursion-limit(rl)\f[R] - \f[I]all integer\f[R]
To set the recursion depth limit of the interpreter
.SS EXAMPLE
.PP
\f[I]cpc test/test.cpc test/recursive_test.cpc -r 10000 -t -gt\f[R]
.SH PLAYGROUND OPTIONS
.TP
\f[B]clear\f[R]
To remove all commands before in the playground
.TP
\f[B]help\f[R]
To show the help page
.TP
\f[B]update\f[R]
To check or update the version (only if \f[I]cpc\f[R] is installed with
git)
.SH AUTHOR
.PP
Iewnfod <https://github.com/iewnfod>
.SH LICENSE
.SH Mozilla Public License Version 2.0
.SS 1. Definitions
.PP
1.1.
\[lq]Contributor\[rq] means each individual or legal entity that
creates, contributes to the creation of, or owns Covered Software.
.PP
1.2.
\[lq]Contributor Version\[rq] means the combination of the Contributions
of others (if any) used by a Contributor and that particular
Contributor\[cq]s Contribution.
.PP
1.3.
\[lq]Contribution\[rq] means Covered Software of a particular
Contributor.
.PP
1.4.
\[lq]Covered Software\[rq] means Source Code Form to which the initial
Contributor has attached the notice in Exhibit A, the Executable Form of
such Source Code Form, and Modifications of such Source Code Form, in
each case including portions thereof.
.PP
1.5.
\[lq]Incompatible With Secondary Licenses\[rq] means
.IP
.nf
\f[C]
(a) that the initial Contributor has attached the notice described
in Exhibit B to the Covered Software; or
(b) that the Covered Software was made available under the terms of
version 1.1 or earlier of the License, but not also under the
terms of a Secondary License.
\f[R]
.fi
.PP
1.6.
\[lq]Executable Form\[rq] means any form of the work other than Source
Code Form.
.PP
1.7.
\[lq]Larger Work\[rq] means a work that combines Covered Software with
other material, in a separate file or files, that is not Covered
Software.
.PP
1.8.
\[lq]License\[rq] means this document.
.PP
1.9.
\[lq]Licensable\[rq] means having the right to grant, to the maximum
extent possible, whether at the time of the initial grant or
subsequently, any and all of the rights conveyed by this License.
.PP
1.10.
\[lq]Modifications\[rq] means any of the following:
.IP
.nf
\f[C]
(a) any file in Source Code Form that results from an addition to,
deletion from, or modification of the contents of Covered
Software; or
(b) any new file in Source Code Form that contains any Covered
Software.
\f[R]
.fi
.PP
1.11.
\[lq]Patent Claims\[rq] of a Contributor means any patent claim(s),
including without limitation, method, process, and apparatus claims, in
any patent Licensable by such Contributor that would be infringed, but
for the grant of the License, by the making, using, selling, offering
for sale, having made, import, or transfer of either its Contributions
or its Contributor Version.
.PP
1.12.
\[lq]Secondary License\[rq] means either the GNU General Public License,
Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU
Affero General Public License, Version 3.0, or any later versions of
those licenses.
.PP
1.13.
\[lq]Source Code Form\[rq] means the form of the work preferred for
making modifications.
.PP
1.14.
\[lq]You\[rq] (or \[lq]Your\[rq]) means an individual or a legal entity
exercising rights under this License.
For legal entities, \[lq]You\[rq] includes any entity that controls, is
controlled by, or is under common control with You.
For purposes of this definition, \[lq]control\[rq] means (a) the power,
direct or indirect, to cause the direction or management of such entity,
whether by contract or otherwise, or (b) ownership of more than fifty
percent (50%) of the outstanding shares or beneficial ownership of such
entity.
.SS 2. License Grants and Conditions
.PP
2.1.
Grants
.PP
Each Contributor hereby grants You a world-wide, royalty-free,
non-exclusive license:
.IP "(a)" 4
under intellectual property rights (other than patent or trademark)
Licensable by such Contributor to use, reproduce, make available,
modify, display, perform, distribute, and otherwise exploit its
Contributions, either on an unmodified basis, with Modifications, or as
part of a Larger Work; and
.IP "(b)" 4
under Patent Claims of such Contributor to make, use, sell, offer for
sale, have made, import, and otherwise transfer either its Contributions
or its Contributor Version.
.PP
2.2.
Effective Date
.PP
The licenses granted in Section 2.1 with respect to any Contribution
become effective for each Contribution on the date the Contributor first
distributes such Contribution.
.PP
2.3.
Limitations on Grant Scope
.PP
The licenses granted in this Section 2 are the only rights granted under
this License.
No additional rights or licenses will be implied from the distribution
or licensing of Covered Software under this License.
Notwithstanding Section 2.1(b) above, no patent license is granted by a
Contributor:
.IP "(a)" 4
for any code that a Contributor has removed from Covered Software; or
.IP "(b)" 4
for infringements caused by: (i) Your and any other third party\[cq]s
modifications of Covered Software, or (ii) the combination of its
Contributions with other software (except as part of its Contributor
Version); or
.IP "(c)" 4
under Patent Claims infringed by Covered Software in the absence of its
Contributions.
.PP
This License does not grant any rights in the trademarks, service marks,
or logos of any Contributor (except as may be necessary to comply with
the notice requirements in Section 3.4).
.PP
2.4.
Subsequent Licenses
.PP
No Contributor makes additional grants as a result of Your choice to
distribute the Covered Software under a subsequent version of this
License (see Section 10.2) or under the terms of a Secondary License (if
permitted under the terms of Section 3.3).
.PP
2.5.
Representation
.PP
Each Contributor represents that the Contributor believes its
Contributions are its original creation(s) or it has sufficient rights
to grant the rights to its Contributions conveyed by this License.
.PP
2.6.
Fair Use
.PP
This License is not intended to limit any rights You have under
applicable copyright doctrines of fair use, fair dealing, or other
equivalents.
.PP
2.7.
Conditions
.PP
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
in Section 2.1.
.SS 3. Responsibilities
.PP
3.1.
Distribution of Source Form
.PP
All distribution of Covered Software in Source Code Form, including any
Modifications that You create or to which You contribute, must be under
the terms of this License.
You must inform recipients that the Source Code Form of the Covered
Software is governed by the terms of this License, and how they can
obtain a copy of this License.
You may not attempt to alter or restrict the recipients\[cq] rights in
the Source Code Form.
.PP
3.2.
Distribution of Executable Form
.PP
If You distribute Covered Software in Executable Form then:
.IP "(a)" 4
such Covered Software must also be made available in Source Code Form,
as described in Section 3.1, and You must inform recipients of the
Executable Form how they can obtain a copy of such Source Code Form by
reasonable means in a timely manner, at a charge no more than the cost
of distribution to the recipient; and
.IP "(b)" 4
You may distribute such Executable Form under the terms of this License,
or sublicense it under different terms, provided that the license for
the Executable Form does not attempt to limit or alter the
recipients\[cq] rights in the Source Code Form under this License.
.PP
3.3.
Distribution of a Larger Work
.PP
You may create and distribute a Larger Work under terms of Your choice,
provided that You also comply with the requirements of this License for
the Covered Software.
If the Larger Work is a combination of Covered Software with a work
governed by one or more Secondary Licenses, and the Covered Software is
not Incompatible With Secondary Licenses, this License permits You to
additionally distribute such Covered Software under the terms of such
Secondary License(s), so that the recipient of the Larger Work may, at
their option, further distribute the Covered Software under the terms of
either this License or such Secondary License(s).
.PP
3.4.
Notices
.PP
You may not remove or alter the substance of any license notices
(including copyright notices, patent notices, disclaimers of warranty,
or limitations of liability) contained within the Source Code Form of
the Covered Software, except that You may alter any license notices to
the extent required to remedy known factual inaccuracies.
.PP
3.5.
Application of Additional Terms
.PP
You may choose to offer, and to charge a fee for, warranty, support,
indemnity or liability obligations to one or more recipients of Covered
Software.
However, You may do so only on Your own behalf, and not on behalf of any
Contributor.
You must make it absolutely clear that any such warranty, support,
indemnity, or liability obligation is offered by You alone, and You
hereby agree to indemnify every Contributor for any liability incurred
by such Contributor as a result of warranty, support, indemnity or
liability terms You offer.
You may include additional disclaimers of warranty and limitations of
liability specific to any jurisdiction.
.SS 4. Inability to Comply Due to Statute or Regulation
.PP
If it is impossible for You to comply with any of the terms of this
License with respect to some or all of the Covered Software due to
statute, judicial order, or regulation then You must: (a) comply with
the terms of this License to the maximum extent possible; and (b)
describe the limitations and the code they affect.
Such description must be placed in a text file included with all
distributions of the Covered Software under this License.
Except to the extent prohibited by statute or regulation, such
description must be sufficiently detailed for a recipient of ordinary
skill to be able to understand it.
.SS 5. Termination
.PP
5.1.
The rights granted under this License will terminate automatically if
You fail to comply with any of its terms.
However, if You become compliant, then the rights granted under this
License from a particular Contributor are reinstated (a) provisionally,
unless and until such Contributor explicitly and finally terminates Your
grants, and (b) on an ongoing basis, if such Contributor fails to notify
You of the non-compliance by some reasonable means prior to 60 days
after You have come back into compliance.
Moreover, Your grants from a particular Contributor are reinstated on an
ongoing basis if such Contributor notifies You of the non-compliance by
some reasonable means, this is the first time You have received notice
of non-compliance with this License from such Contributor, and You
become compliant prior to 30 days after Your receipt of the notice.
.PP
5.2.
If You initiate litigation against any entity by asserting a patent
infringement claim (excluding declaratory judgment actions,
counter-claims, and cross-claims) alleging that a Contributor Version
directly or indirectly infringes any patent, then the rights granted to
You by any and all Contributors for the Covered Software under Section
2.1 of this License shall terminate.
.PP
5.3.
In the event of termination under Sections 5.1 or 5.2 above, all end
user license agreements (excluding distributors and resellers) which
have been validly granted by You or Your distributors under this License
prior to termination shall survive termination.
.SS 6. Disclaimer of Warranty
.PP
Covered Software is provided under this License on an \[lq]as is\[rq]
basis, without warranty of any kind, either expressed, implied, or
statutory, including, without limitation, warranties that the Covered
Software is free of defects, merchantable, fit for a particular purpose
or non-infringing.
The entire risk as to the quality and performance of the Covered
Software is with You.
Should any Covered Software prove defective in any respect, You (not any
Contributor) assume the cost of any necessary servicing, repair, or
correction.
This disclaimer of warranty constitutes an essential part of this
License.
No use of any Covered Software is authorized under this License except
under this disclaimer.
.SS 7. Limitation of Liability
.PP
Under no circumstances and under no legal theory, whether tort
(including negligence), contract, or otherwise, shall any Contributor,
or anyone who distributes Covered Software as permitted above, be liable
to You for any direct, indirect, special, incidental, or consequential
damages of any character including, without limitation, damages for lost
profits, loss of goodwill, work stoppage, computer failure or
malfunction, or any and all other commercial damages or losses, even if
such party shall have been informed of the possibility of such damages.
This limitation of liability shall not apply to liability for death or
personal injury resulting from such party\[cq]s negligence to the extent
applicable law prohibits such limitation.
Some jurisdictions do not allow the exclusion or limitation of
incidental or consequential damages, so this exclusion and limitation
may not apply to You.
.SS 8. Litigation
.PP
Any litigation relating to this License may be brought only in the
courts of a jurisdiction where the defendant maintains its principal
place of business and such litigation shall be governed by laws of that
jurisdiction, without reference to its conflict-of-law provisions.
Nothing in this Section shall prevent a party\[cq]s ability to bring
cross-claims or counter-claims.
.SS 9. Miscellaneous
.PP
This License represents the complete agreement concerning the subject
matter hereof.
If any provision of this License is held to be unenforceable, such
provision shall be reformed only to the extent necessary to make it
enforceable.
Any law or regulation which provides that the language of a contract
shall be construed against the drafter shall not be used to construe
this License against a Contributor.
.SS 10. Versions of the License
.PP
10.1.
New Versions
.PP
Mozilla Foundation is the license steward.
Except as provided in Section 10.3, no one other than the license
steward has the right to modify or publish new versions of this License.
Each version will be given a distinguishing version number.
.PP
10.2.
Effect of New Versions
.PP
You may distribute the Covered Software under the terms of the version
of the License under which You originally received the Covered Software,
or under the terms of any subsequent version published by the license
steward.
.PP
10.3.
Modified Versions
.PP
If you create software not governed by this License, and you want to
create a new license for such software, you may create and use a
modified version of this License if you rename the license and remove
any references to the name of the license steward (except to note that
such modified license differs from this License).
.PP
10.4.
Distributing Source Code Form that is Incompatible With Secondary
Licenses
.PP
If You choose to distribute Source Code Form that is Incompatible With
Secondary Licenses under the terms of this version of the License, the
notice described in Exhibit B of this License must be attached.
.SS Exhibit A - Source Code Form License Notice
.PP
This Source Code Form is subject to the terms of the Mozilla Public
License, v.
2.0.
If a copy of the MPL was not distributed with this file, You can obtain
one at http://mozilla.org/MPL/2.0/.
.PP
If it is not possible or desirable to put the notice in a particular
file, then You may include the notice in a location (such as a LICENSE
file in a relevant directory) where a recipient would be likely to look
for such a notice.
.PP
You may add additional accurate notices of copyright ownership.
.SS Exhibit B - \[lq]Incompatible With Secondary Licenses\[rq] Notice
.PP
This Source Code Form is \[lq]Incompatible With Secondary Licenses\[rq],
as defined by the Mozilla Public License, v.
2.0.