-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathREADME
45 lines (31 loc) · 1.25 KB
/
README
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
Pas2C pascal to C Source Code Converter
Build dependencies:
Bison, Yacc and gcc. astyle if you want to use the converter script.
How to Build:
Pas2C uses cmake. you can build the project with these steps:
1. enter the project directory.
2. mkdir build
3. cd build
4. cmake ../
5. make
How To Use:
Use the converter as this:
sh converter.sh input_file output_file
if no output file given, it creates a file named output.c.
if you want to use stdin/stdout, you can call pas2c directly.
Current Features:
Converting program %program_name%; to int main()
Converting var and const blocks.
Converting any valid sequence of begin end block to proper {}
Converting statements, regardless of the position relative to blocks.
except the main block. every statement has to be in it.
Converting integer value and variable operations:
+,-,*,/ operations can be converted recursively.
Converting integer declarations.
Converting integer assignments:
Converting functions:
currently write/ln and read/ln implemented.
unlimited parameters can be passed, also mathematical expressions can be used as parameters.
Converting of strings:
strings starting with single quotation marks and ends with it can be converted.
escaping not implemented.