书栈网 · BookStack 本次搜索耗时 0.016 秒,为您找到 39 个相关结果.
  • 第03章 中间代码 Pcode (上)

    第03章 中间代码 Pcode (上) 第03章 中间代码 Pcode (上) 上一章中介绍了 TinyC 源程序的语法,本章及下一章介绍中间代码 Pcode 的语法,同时介绍 Pcode 虚拟机的内部结构、如何用 Pcode 模拟器运行 Pcode 、以及 Pcode 命令与 TinyC 程序之间的对应关系。
  • Conditional compilation

    Conditional compilation Compile time code $if condition $embed_file $tmpl for embedding and parsing V template files $env $compile_error and $compile_warn Environment s...
  • 2.6 关键字

    2.6 关键字 2.6 关键字 TinyC 中的关键字只有下面这些: void , int , while , if , else , return , break , continue , print , readint
  • 6.4 特别致谢

    6.4 特别致谢 6.4 特别致谢 本章以及后面的第 07 ~ 13 章的内容大量的参考了 stanford 的编译原理网络教程的内容,其网址为: http://web.stanford.edu/class/archive/cs/cs143/cs143.1128/ TinyC 编译器也是本人在自学该教程的过程中编写的,在此特别向 stanf...
  • 5.4 实例

    5.4 实例 5.4 实例 最后让我们用第 2 章的典型程序来练习一下吧: TinyC: #include "for_gcc_build.hh" // only for gcc, TinyC will ignore it.   int main () { int i ; i = 0 ; ...
  • 2.4 控制及循环语句

    2.4 控制及循环语句 2.4 控制及循环语句 TinyC 仅支持 if/else 和 while 语句, while 循环中支持 continue 和 break 。不支持 for 、 switch 、 goto 等其他语句。if/else 和 while 的执行体必须用花括号括起来。如: if ( x > 0 ) y = 1 ...
  • 5.1 函数定义

    5.1 函数定义 5.1 函数定义 函数定义的翻译在上一章其实讲的差不多了,函数的开头和结尾分别改成 FUNC 和 ENDFUNC 就可以了,FUNC 后接 @ + func_name + ”:” ,若函数有参数,则在函数体的第一行加 arg + 参数列表,具体如下: TinyC: int foo ( int a , int b ) ...
  • 14.3 第 1.0 版

    14.3 第 1.0 版 14.3 第 1.0 版 继续在第 0.5 版的基础上升级,增加 if 和 while 语句、比较运算符和逻辑运算符以及 readint 命令,就形成了完整的 TinyC 前端。一共有 7 个文件: 词法分析文件: scanner.l %{ #define YYSTYPE char * #include ...
  • 2.5 函数调用

    2.5 函数调用 2.5 函数调用 TinyC 支持函数调用,支持递归。
  • 2.3 输入及输出

    2.3 输入及输出 2.3 输入及输出 TinyC 提供两个基本的 io 命令, print 和 readint 。如: print ( "x = %d, y = %d" , 2 , 3 ); // 输出: x = 2, y = 3 x = readint ( "Please input an integer" ...