这是一个基于sysy语法范式,对目标平台Armv7 Architecture生成A32指令的编译器,主要包括两个模块:
-
词法、语法分析、对Intermediate Representation的优化工作。
-
中间代码到目标指令集的等效表达
-
dev分支为开发分支,合并来自上游仓库的稳定版本,请确保当前dev分支的最新提交解决了正在解决的问题后合并到main分支。
-
main分支的每次提交往往合并自dev分支提交的稳定版本,main分支的每次提交一般可以直接提交到oj平台。
dev分支使用cmake工具构建工程,构建步骤如下:
cd build
cmake ..
make
后在仓库第一级路径得到单一的编译器可执行文件compiler
main分支为了符合oj编译方式,采用make工具构建工程,构建步骤如下:
make
后在仓库第一级路径得到单一的编译器可执行文件compiler
progress | check |
---|---|
GNU assembler syntax support | ✅ |
Public Interface Callable | ✅ |
Zero Init Section | ✅ |
SIMD | ⬜ |
计算机系统能力大赛(CSCC)提供测试样例库
公开样例与运行时库/functional · master · CSC-Compiler / Compiler2023 · GitLab (eduxiji.net)
example | correction |
---|---|
functional | |
00_main.sy | ✔️ |
01_var_defn2.sy | ✔️ |
02_var_defn3.sy | ✔️ |
03_arr_defn2.sy | ✔️ |
04_arr_defn3.sy | ✔️ |
05_arr_defn4.sy | ✔️ |
06_const_var_defn2.sy | ✔️ |
07_const_var_defn3.sy | ✔️ |
08_const_array_defn.sy | ✔️ |
09_func_defn.sy | ✔️ |
10_var_defn_func.sy | ✔️ |
11_add2.sy | ✔️ |
12_addc.sy | ✔️ |
13_sub2.sy | ✔️ |
14_subc.sy | ✔️ |
15_mul.sy | ✔️ |
16_mulc.sy | ✔️ |
17_div.sy | ✔️ |
18_divc.sy | ✔️ |
19_mod.sy | ✔️ |
20_rem.sy | ❌ |
21_if_test2.sy | ✔️ |
22_if_test3.sy | ✔️ |
23_if_test4.sy | ✔️ |
24_if_test5.sy | ✔️ |
25_while_if.sy | ✔️ |
26_while_test1.sy | ✔️ |
27_while_test2.sy | ✔️ |
28_while_test3.sy | ✔️ |
29_break.sy | ✔️ |
30_continue.sy | ✔️ |
31_while_if_test1.sy | ✔️ |
32_while_if_test2.sy | ✔️ |
33_while_if_test3.sy | ✔️ |
34_arr_expr_len.sy | ✔️ |
35_op_priority1.sy | ✔️ |
36_op_priority2.sy | ✔️ |
37_op_priority3.sy | ✔️ |
38_op_priority4.sy | ✔️ |
39_op_priority5.sy | ✔️ |
40_unary_op.sy | ✔️ |
41_unary_op2.sy | ✔️ |
42_empty_stmt.sy | ✔️ |
43_logi_assign.sy | ✔️ |
44_stmt_expr.sy | ✔️ |
45_comment1.sy | ✔️ |
46_hex_defn.sy | ✔️ |
47_hex_oct_add.sy | ✔️ |
48_assign_complex_expr.sy | ❌ |
49_if_complex_expr.sy | ✔️ |
50_short_circuit.sy | ✔️ |
51_short_circuit3.sy | ✔️ |
52_scope.sy | ✔️ |
53_scope2.sy | ✔️ |
54_hidden_var.sy | ✔️ |
55_sort_test1.sy | ✔️ |
56_sort_test2.sy | ✔️ |
57_sort_test3.sy | ✔️ |
58_sort_test4.sy | ✔️ |
59_sort_test5.sy | ✔️ |
60_sort_test6.sy | ✔️ |
61_sort_test7.sy | ✔️ |
62_percolation.sy | ✔️ |
63_big_int_mul.sy | ✔️ |
64_calculator.sy | ✔️ |
65_color.sy | ✔️ |
66_exgcd.sy | ✔️ |
67_reverse_output.sy | ✔️ |
68_brainfk.sy | ✔️ |
69_expr_eval.sy | ✔️ |
70_dijkstra.sy | ✔️ |
71_full_conn.sy | ✔️ |
72_hanoi.sy | ✔️ |
73_int_io.sy | ✔️ |
74_kmp.sy | ✔️ |
75_max_flow.sy | ✔️ |
76_n_queens.sy | ✔️ |
77_substr.sy | ✔️ |
78_side_effect.sy | ✔️ |
79_var_name.sy | ✔️ |
80_chaos_token.sy | ✔️ |
81_skip_spaces.sy | ✔️ |
82_long_func.sy | ✔️ |
83_long_array.sy | ✔️ |
84_long_array2.sy | ✔️ |
85_long_code.sy | ✔️ |
86_long_code2.sy | ✔️ |
87_many_params.sy | ❌ |
88_many_params2.sy | ✔️ |
89_many_globals.sy | ✔️ |
90_many_locals.sy | ✔️ |
91_many_locals2.sy | ✔️ |
92_register_alloc.sy | ✔️ |
93_nested_calls.sy | ✔️ |
94_nested_loops.sy | ✔️ |
95_float.sy | ❌ |
96_matrix_add.sy | ✔️ |
97_matrix_sub.sy | ✔️ |
98_matrix_mul.sy | ✔️ |
99_matrix_tran.sy | ✔️ |
hidden_function | |
00_comment2.sy | ✔️ |
01_multiple_returns.sy | ✔️ |
02_ret_in_block.sy | ❌ |
03_branch.sy | ✔️ |
04_break_continue.sy | ✔️ |
05_param_name.sy | ✔️ |
06_func_name.sy | ✔️ |
07_arr_init_nd.sy | ✔️ |
08_global_arr_init.sy | ✔️ |
09_BFS.sy | ✔️ |
10_DFS.sy | ✔️ |
11_BST.sy | ✔️ |
12_DSU.sy | ✔️ |
13_LCA.sy | ✔️ |
14_dp.sy | ✔️ |
15_graph_coloring.sy | ✔️ |
16_k_smallest.sy | ✔️ |
17_maximal_clique.sy | ✔️ |
18_prim.sy | ❌ |
19_search.sy | ✔️ |
20_sort.sy | ✔️ |
21_union_find.sy | ✔️ |
22_matrix_multiply.sy | ✔️ |
23_json.sy | ✔️ |
24_array_only.sy | ✔️ |
25_scope3.sy | ❌ |
26_scope4.sy | ✔️ |
27_scope5.sy | ✔️ |
28_side_effect2.sy | ✔️ |
29_long_line.sy | ❌ |
30_many_dimensions.sy | ✔️ |
31_many_indirections.sy | ✔️ |
32_many_params3.sy | ✔️ |
33_multi_branch.sy | ✔️ |
34_multi_loop.sy | ✔️ |
35_math.sy | ❌ |
36_rotate.sy | ❌ |
37_dct.sy | ❌ |
38_light2d.sy | ❌ |
39_fp_params.sy | ❌ |