KS
Killer-Skills

create-sysy-testcase — how to use create-sysy-testcase how to use create-sysy-testcase, create-sysy-testcase setup guide, what is create-sysy-testcase, create-sysy-testcase alternative, create-sysy-testcase vs compiler test tools, strict sysy testcase conversion

v1.0.0
GitHub

About this Skill

Ideal for Compiler Agents requiring precise C/C++ to Strict SysY conversion and test data generation capabilities. create-sysy-testcase is a skill that converts C/C++ code to Strict SysY, a simplified C subset, and generates test data for compiler testing and validation.

Features

Converts C/C++ code to Strict SysY using implicit prototypes
Generates valid test data for compiler testing and validation
Adheres to non-negotiable grammar rules for accurate conversion
Supports reading of references/sysy_lang_grammar.md for syntax edge cases
Enforces strict grammar rules for deterministic testcase conversion

# Core Topics

oNya685 oNya685
[0]
[0]
Updated: 3/6/2026

Quality Score

Top 5%
36
Excellent
Based on code quality & docs
Installation
SYS Universal Install (Auto-Detect)
Cursor IDE Windsurf IDE VS Code IDE
> npx killer-skills add oNya685/SysYTest/create-sysy-testcase

Agent Capability Analysis

The create-sysy-testcase MCP Server by oNya685 is an open-source Categories.community integration for Claude and other AI agents, enabling seamless task automation and capability expansion. Optimized for how to use create-sysy-testcase, create-sysy-testcase setup guide, what is create-sysy-testcase.

Ideal Agent Persona

Ideal for Compiler Agents requiring precise C/C++ to Strict SysY conversion and test data generation capabilities.

Core Value

Empowers agents to convert standard C/C++ competitive programming code into Strict SysY, adhering to specific grammar rules, and generate valid test data for compiler engineers using Strict SysY grammar rules and test data generation protocols.

Capabilities Granted for create-sysy-testcase MCP Server

Converting C/C++ code to Strict SysY for compiler testing
Generating valid test data for compiler engineers
Refactoring code to adhere to Strict SysY grammar rules

! Prerequisites & Limits

  • Requires adherence to specific Strict SysY grammar rules
  • Limited to C/C++ competitive programming code conversion
Project
SKILL.md
5.5 KB
.cursorrules
1.2 KB
package.json
240 B
Ready
UTF-8

# Tags

[No tags]
SKILL.md
Readonly

SysY Testcase Conversion Workflow

You are an expert compiler engineer. Your goal is to convert standard C/C++ competitive programming code into Strict SysY (a simplified C subset) and generate valid test data.

Non-Negotiable Grammar Rules

Adhere to these rules strictly. Read references/sysy_lang_grammar.md only if you encounter an obscure syntax edge case not covered here.

FeatureConstraintFix / Refactor
PrototypesImplicitDo NOT write int getint(); or int printf(...);.
Memory / SizeMax 4MB Total (MARS Limit)Scale Down Constants. 1e6 $\to$ 1e4. Total int elements < 500,000.
PreprocessorBANNED (#include, #define, #ifdef)Use const int for constants. Delete imports.
Typesint, void ONLYNo long long, float, double, char, bool.
PointersBANNED (int *p, &x, *ptr)Pass arrays as int a[]. Use return values for scalar outputs (no void f(int *res)).
Arrays1D Arrays ONLYFlatten int a[N][M] $\to$ int a[N*M]. No VLAs.
Loopsfor loops ONLY. No declarations inside ()Move vars out: int i; for(i=0;...). No do-while. No while. turn while(1) into for(;;).
ReturnsNon-void funcs MUST returnAdd dummy return 0; at end of function, even after infinite loops.
Conditions As ValuesExp → AddExp (arithmetic only)Do NOT use relational / logical expressions as values, e.g. return a < b; or x = (a < b);. Rewrite: if (a < b) return 1; return 0; or x = 0; if (a < b) x = 1;.
Inputint getint() ONLYNo scanf, cin, getchar.
Outputprintf ONLYFormat string is a SysY StringConst: only %d is allowed as a format placeholder, and the only escape sequence is \n (backslash may appear only in \n). No other format specifiers/modifiers (e.g. %c, %s, %%, %05d) and no other escapes (e.g. \\, \", \t, \r, \0). Ensure the number of , Exp arguments equals the number of %d.
ParenthesesPrimaryExp → '(' Exp ')' and Exp → AddExp(...) as an expression can wrap arithmetic only. Besides mandatory syntax like if (Cond) / for (...; Cond; ...), do NOT add extra parentheses around conditions (any `== != < > <= >= &&
OperatorsNo Bitwise (<<, >>, &, `, ^`)
StructsBANNEDSplit into parallel arrays (e.g., x[N], y[N]).
GlobalsEncouraged for large arraysPrevent stack overflow in SysY runtime, keep totol size < 4MB.
Input DataStrictly 1 Integer Per Line (in.txt)No spaces (1 2). Must be 1\n2. Matches MIPS syscall. If testfile.txt uses a sentinel to stop reading (e.g., if (ch == 0) break;, while (x != 0), while (1) { x=getint(); if (x==0) break; }), then in.txt must explicitly include that sentinel value as the last integer. Do not rely on EOF behaving like 0: SysY MIPS getint() is implemented via syscall 5 and does not implement “EOF → 0”.

Execution Protocol

Follow these steps sequentially.

Step 1: Initialize

Use the helper script to create the directory and placeholder files.

bash
1python3 .codex/skills/create-sysy-testcase/scripts/init_case.py <TARGET_DIR>

Step 2: Write Logic (The Intelligence Part)

Translate the source logic into Strict SysY. Focus your "thinking" here.

  • Scale Down: If original code has MAXN = 100000, change it smaller to fix up to MARS's address space limit(about 4MB). Ensure logic consistency.
  • Refactor logic to fit the constraints above (e.g., flatten 2D arrays).
  • Write the code to testfile.txt.
  • Write input data to in.txt (newline-separated integers only) matching your scaled-down size. If the program reads until a sentinel (e.g., 0) rather than a known count, put that sentinel explicitly as the last integer; do not rely on EOF.
bash
1cat <<'EOF' > <TARGET_DIR>/testfile.txt 2// ... your converted SysY code ... 3EOF 4 5cat <<'EOF' > <TARGET_DIR>/in.txt 6// ... your input numbers ... 7EOF

Step 3: Compile, Run & Verify

Use the runner script. It automatically wraps your code with C headers, compiles it (gcc/clang), runs it against in.txt, and generates ans.txt.

bash
1python3 .codex/skills/create-sysy-testcase/scripts/run_case.py <TARGET_DIR>

Step 4: Fix & Retry

If Step 3 reports a COMPILE ERROR or RUNTIME ERROR:

  1. Read the error output.
  2. Fix the logic in testfile.txt.
  3. Rerun Step 3.

Translation Strategy Tips

  • SysY input (in.txt) must be newline-separated integers.
  • If the original problem uses strings (e.g., "PUSH", "POP"), map them to integers (e.g., 1, 2) in your translation logic.
  • MIPS Compatibility Check: in.txt must not contain spaces between numbers.
  • Never use EOF as a terminator: if the program’s input loop expects a terminator value (commonly 0, sometimes -1/-999), put that value explicitly at the end of in.txt (and keep it on its own line).
  • Strengthen in.txt slightly: prefer including a mix of small/edge values (e.g., 0/1/-1, min/max for scaled constraints) and a few typical values, while still matching the program’s expected format and counts; always end the file with a trailing newline.

Related Skills

Looking for an alternative to create-sysy-testcase or building a Categories.community AI Agent? Explore these related open-source MCP Servers.

View All

widget-generator

Logo of f
f

widget-generator is an open-source AI agent skill for creating widget plugins that are injected into prompt feeds on prompts.chat. It supports two rendering modes: standard prompt widgets using default PromptCard styling and custom render widgets built as full React components.

149.6k
0
Design

chat-sdk

Logo of lobehub
lobehub

chat-sdk is a unified TypeScript SDK for building chat bots across multiple platforms, providing a single interface for deploying bot logic.

73.0k
0
Communication

zustand

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
Communication

data-fetching

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
Communication