Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
T

toyc

> 编程语言
Open source

玩具c编译器,基于栈顶缓存的策略生成Linux和MacOS平台的x86-64汇编

99 stars0 likes2 views
WebsiteGitHub

About

玩具c编译器,基于栈顶缓存的策略生成Linux和MacOS平台的x86-64汇编

C编译器功能TODO

Note: ccc is no longer an active project. The successor is subc-llvm.

声明

  • 存储类声明说明符(extern、static、auto、register、typedef)
  • 类型限定符(const、volatile、restrict)
  • 声明说明符(char、short、int、long)
  • 指针说明符(*)
  • 直接说明符([]、())
  • 结构体说明符(struct or union {struct-declaration*}、struct or union tag{struct-declaration*})
  • 枚举说明符
  • 函数声明符(inline)

语句

  • if-else
  • switch-case-default
  • while
  • do-while
  • for
  • goto-label
  • break
  • continue
  • blockStmt

表达式

  • 逗号表达式(,)
  • 赋值表达式(=)
  • 赋值表达式(+=、-=、*=、/= 、%=、>=、&=、|=、^=)
  • 条件表达式(?:)
  • 逻辑或表达式(||)
  • 逻辑与表达式(&&)
  • 按位或表达式(|)
  • 按位异或表达式(^)
  • 按位与表达式(&)
  • 相等表达式(==、!=)
  • 关系表达式(>、>=、>)
  • 加法表达式(+、-)
  • 乘法表达式(*、/)
  • 乘法表达式(%)
  • case表达式 ((type-name) unary-expression)
  • 一元表达式(+、-、&、*)
  • 一元表达式(++、- -)
  • 一元表达式(~、!)
  • 一元表达式(sizeof unary-expression)
  • 一元表达式(sizeof (type-name))
  • 后缀表达式([ ]、( )、.、→)
  • 后缀表达式(++、 - -)
  • 基本表达式(id、num、(Expr)、StmtExpr)

词素

  • 整数解析(八进制、十进制、十六进制、后缀)
  • 浮点数解析 (后缀)
  • 字符解析(包含转义字符)
  • 字符串解析(包含转义字符)
  • 标识符(包含关键字)
  • 运算符、标点符号、分界符

操作系统平台

  • Linux
  • MacOSX

指令集

  • X86-64

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C++

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言