Git Product home page Git Product logo

gcompiler's Introduction

文件目录

├─defense
│      debug.txt        //输出二元式、产生式、标识符表、临时变量表、四元式  
│      defense.md       //答辩文件  
│      GCompiler.exe    //程序  
│      in.txt           //缺省输入程序  
│      out.txt          //输出四元式、格式化源程序  
│      optiable.txt     //可优化输入程序  

参数设定

-i  指定输入的参数
-v  程序版本
-O  进行优化
-h  使用帮助

额外功能

  1. 源代码格式化输出
  2. 无用代码删除
  3. 公共子表达式消除

使用示例

Your/File/Path> .\GCompiler.exe -v
GCompiler Vision : 1.0.0-BETA
Your/File/Path> .\GCompiler.exe -h
[-i]      Choose the input file,the default read file is in.txt.
[-v]      Check the version.

[-O]      Open the optimization.
  1. 源代码格式化输出
Your/File/Path> .\GCompiler.exe
//>>out.txt
string y;
y = "yqw";
y = y * 9;
do
  y = y + "y"
while(y * 5 >= y * 2);
if(y + "e" == y + "v")
  start
    y = y + "l";
    y = y * 2;
  end
else
  y = y + "j"
;
  1. 无用代码删除
Your/File/Path> .\GCompiler.exe -i optiable.txt [-O]

删除前

//>>debug.txt
(0)(=,a,null,a)
(1)(=,b,null,b)
(2)(=,c,null,c)
(3)(=,d,null,d)
(4)(=,a,null,a)

删除后

//>>debug.txt
(0)(=,a,null,a)
(1)(=,b,null,b)
(2)(=,c,null,c)
(3)(=,d,null,d)
  1. 公共子表达式消除
Your/File/Path> .\GCompiler.exe -i optiable.txt [-O]

消除前

//>>debug.txt
(7)(+,a,b,T2)
(8)(=,T2,null,b)
(9)(+,a,b,T3)
(10)(=,T3,null,c)
(11)(+,a,b,T4)
(12)(=,T4,null,d)

消除后

//>>debug.txt
(6)(+,a,b,T2)
(7)(=,T2,null,b)
(8)(+,a,b,T3)
(9)(=,T3,null,c)
(10)(=,T3,null,d)

gcompiler's People

Contributors

doirycool avatar

Stargazers

Chen Wang avatar 星空菌K avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.