Borrowing it
Nothing to install: this file belongs to whtoo/How_to_implment_PL_in_Antlr4. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/whtoo/How_to_implment_PL_in_Antlr4/main/.claude/skills/compiler-dev/SKILL.mdgit clone --depth 1 https://github.com/whtoo/How_to_implment_PL_in_Antlr4Wrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/whtoo/how_to_implment_pl_in_antlr4/compiler-dev)<a href="https://agentmods.dev/skills/whtoo/how_to_implment_pl_in_antlr4/compiler-dev"><img src="https://agentmods.dev/badge/skills/whtoo/how_to_implment_pl_in_antlr4/compiler-dev.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00027 | $0.01592 |
| Opus 5 | $0.00014 | $0.00796 |
| Sonnet 5 | $0.00005 | $0.00318 |
| Haiku 4.5 | $0.00003 | $0.00159 |
Grade A, and why
compiler-dev scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 160 lines — stays where its author put it; the contents beside it link to each section on GitHub.
编译器后端开发
🎯 垂直职责
单一职责: 编译器中后端技术 - 符号表、类型系统、IR、CFG、SSA、优化
📦 核心能力
1. 符号表与类型系统 (EP6-EP10)
- 位置:
ep20/src/main/java/org/teachfx/antlr4/ep20/symtab/ - 作用域:
scope/GlobalScope,scope/LocalScope - 符号:
symbol/VariableSymbol,symbol/MethodSymbol - 类型:
type/Type,type/BuiltInType,type/StructType
2. 中间表示 (EP11-EP17)
- 位置:
ep20/src/main/java/org/teachfx/antlr4/ep20/ir/ - 表达式:
ir/expr/(BinExpr, UnaryExpr, ConstVal) - 语句:
ir/stmt/(Assign, Jump, ConditionalJump) - 构建器:
CymbolIRBuilder.java
3. 控制流图 (EP16-EP17)
- 位置:
ep20/src/main/java/org/teachfx/antlr4/ep20/pass/cfg/ - 核心:
ControlFlowAnalysis.java,CFG.java - 基本块:
BasicBlock<IRNode>
4. SSA与优化 (EP21)
- 位置:
ep21/src/main/java/org/teachfx/antlr4/ep21/ - SSA:
analysis/ssa/SSAGraph.java - 数据流:
analysis/dataflow/(LiveVariableAnalysis, ReachingDefinitions) - 优化:
pass/cfg/(ConstantFolding, CSE, DCE)
🔗 关系图
→ ep-navigator (识别EP范围) → antlr4-dev (AST → IR转换) ← vm-dev (IR → 字节码)
🚀 快速开始
实现新的优化Pass
# 1. 创建优化器 (实现IFlowOptimizer<IRNode>)
vim ep21/src/main/java/.../pass/cfg/NewOptimizer.java
# 2. 标准模板
public class NewOptimizer implements IFlowOptimizer<IRNode> {
@Override
public void onHandle(CFG<IRNode> cfg) {
// 遍历基本块
for (BasicBlock<IRNode> block : cfg) {
// 优化逻辑
}
}
}
# 3. 创建测试
vim ep21/src/test/java/.../pass/cfg/NewOptimizerTest.java
# 4. 运行测试
mvn test -pl ep21 -Dtest="*NewOptimizer*"
SSA转换流程
# 1. 构建支配树
cfg.computeDominanceFrontier();
# 2. 插入Φ函数
ssa.insertPhiFunctions();
# 3. 变量重命名
ssa.renameVariables();
# 4. 验证
mvn test -pl ep21 -Dtest="*SSATest"
📊 数据流分析模板
// 标准数据流分析框架
public class MyDataFlowAnalysis extends AbstractDataFlowAnalysis<Set<Var>, Set<Var>> {
@Override
public Set<Var> getBoundaryCondition() {
return new HashSet<>(); // 初始状态
}
@Override
public Set<Var> getInitialFlow() {
return new HashSet<>(); // 默认状态
}
@Override
public Set<Var> merge(List<Set<Var>> inputs) {
Set<Var> result = new HashSet<>();
for (Set<Var> input : inputs) {
result.addAll(input); // 合并操作
}
return result;
}
@Override
public Set<Var> flowFunction(BasicBlock<IRNode> block, Set<Var> input) {
Set<Var> output = new HashSet<>(input);
// 传递函数: 根据block内容修改output
return output;
}
}
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- yesterday First seen · 160 lines · 27 tokens per session scan A 15410c76f7fe
compiler-dev is a skill published in the GitHub repository whtoo/How_to_implment_PL_in_Antlr4 (34 stars, last pushed 3mo ago), licensed BSD-3-Clause. It adds 27 tokens to every session and 1,592 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-04.
Other skills, from other repositories
quarkus-native
Deep expertise in Quarkus Native Image builds, GraalVM integration, reflection configuration, and Profile-Guided Optimization. Use for native compilation questions.
graalvm-expert
Expert knowledge for GraalVM, Native Image (AOT), Polyglot runtime, and reflection/resource configuration. Use for native compilation and multi-language JVM questions.
azure-security-keyvault-secrets-java
Azure Key Vault Secrets Java SDK for secret management. Use when storing, retrieving, or managing passwords, API keys, connection strings, or other sensitive configuration data.
azure-ai-anomalydetector-java
Build anomaly detection applications with Azure AI Anomaly Detector SDK for Java. Use when implementing univariate/multivariate anomaly detection, time-series analysis, or AI-powered monitoring.
azure-communication-chat-java
Build real-time chat applications with Azure Communication Services Chat Java SDK. Use when implementing chat threads, messaging, participants, read receipts, typing notifications, or real-time chat features.
azure-communication-common-java
Azure Communication Services common utilities for Java. Use when working with CommunicationTokenCredential, user identifiers, token refresh, or shared authentication across ACS services.