⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme.txt

📁 一个编译器的例子,基于c语言,在linux下开发 现在了简单的c语言例子
💻 TXT
字号:
#####################################  COMP510-4A  Project  final project    name: Yinghao Qin  ID:   0130348  Date: 5th July, 2004  ######################################  1 What I have done so far:==============================	1.1  three data types.  		char integer and float			1.2  implement array and structure	        array can be any data type even structure			1.3  String literals	        can recognise the literal strings			1.4  arithmetic expression		1.4.1  addition(+)		1.4.2  substraction(-)		1.4.3  multiplcation(*)		1.4.4  division(/)		1.4.5  remainder(%)		1.4.6  increment(++) 		1.4.7  decrement(--)		1.5  bit calculation	        1.5.1  shift left (<<)		1.5.2  shift right (>>)		1.5.3  bit and (&)		1.5.3  bit xor (^)		1.5.3  bit or (|)			1.6  relation expression		1.6.1  greater(>)		1.6.2  greater and equal(>=)		1.6.3  less(<)		1.6.4  less and equal(<=)		1.6.5  equal(==)		1.6.6  not equal(!=)		1.7  logical expression		1.7.1  AND(&&)		1.7.2  OR (||)		1.7.3  NOT (!)   	1.8  assignment	        1.8.1  bit assignment(>>=)		1.8.2  bit assignment(<<=)		1.8.3  add assignment(+=)		1.8.4  sub assignment(-=)		1.8.5  mul assignment(*=)		1.8.6  div assignment(/=)		1.8.7  mod assignment(%=)		1.8.8  xor assignment(^=)		1.8.9  or assignment(|=)		        1.9  flow control 	        1.9.1  if() {}	        1.9.2  if(){}else{}		1.9.3  switch case	     	1.10  while loop	        1.10.1 while{}	     	1.11  do-while loop	        do(){}while()			1.12  for loop	        for(;;){}			1.13  println	        println(a~b~c);		a,b,c can be string, int ,char or float		even a expression			1.14  functions	       1.14.1  call other function                1.14.2  call itself (recursion)	1.15  comments	       1.15.1  single line comment	       1.15.2  multi-line comment	       	1.16  output to stdout	       1.16.1  output int	       1.16.2  output float	       1.16.3  output char	       1.16.4  output literal strings	       1.16.5  output mixture of above	       	1.17  type checking	       	1.18  code optimisation		       2. How to make it run=================================2.1 just type "make", the executable will be generated named "c-".2.2 to compile the test files, type             "c- xxxx.c-"  (xxxx.c- is the test source file)             c- will call as and ld to generate the executable(named "XXXX") automatically      if there is no error occured.             The assembly file literal file and object file are also generated      during the compiling.    	       2.3 to run the generated file      just type the executable's name after "./"2.4 display parse tree and symbol table      using "-p" to display parse tree      using "-s" to display symbol table      i.e.  "c- XXXX.c- -p -s"  and "./XXXX" to run the executable	       3.   Files list:===============================c-.l              token takerc-.y              grammar and main functiondefine.h          system call definationstruct.h          defination of some structs and global                  varibals for the project    struct.c          the implementation of struct.hstack.h           head file for stack.cstack.c           implement a stackcompiler.c        the code to generate assembly languageishow.s           output int, char, float and string                  written in assembly langugesishow.o           the compiled ishow libsfshow.o           convert float into a stringMakefile          makefileTYPECHECK.txt     the report for type checking partOPTIMISATION.txt  the report for type optimisation partREADME.txt        myselftype checking example---------------------c-cast.c-c-wrong-cast.c-   optimisation example---------------------c-optimise.c-c-optimise.S      after optimizedc-bf-optimise.S   before optimizedtest files		  -----------------c-hello.c-        the "Hello World!" testc-arith_exp.c-    arithmetic expression testc-array.c-        array testc-assign.c-       assignment testc-bit.c-          bit operation testc-cast.c-         type coercionc-char.c-         char type testc-dowhile.c-      do-while loop testc-float.c-        test float typec-for.c-          for loop testc-while.c-        while loop testc-func.c-         function call testc-globalv.c-      global variables testc-if.c-           if statement testc-inc.c-          increment testc-int.c-          integer testc-localv.c-       local variables testc-mixv.c-         mixture of types  testc-parameterv.c-   arguments passing testc-recursive.c-    function recurrsion testc-relation.c-     relation comparison testc-return.c-       return statement testc-struct.c-       test structurec-switch.c-       test switch statementc-test.c-         a test.c-c-assign.c-       assignment test

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -