Coder Social home page Coder Social logo

chyyuu / compiler_lab Goto Github PK

View Code? Open in Web Editor NEW
57.0 3.0 7.0 360 KB

Some toy labs for compiler course

License: GNU General Public License v2.0

Python 45.25% Lex 1.38% Shell 0.07% Yacc 0.40% Java 3.82% Kotlin 14.79% CSS 0.20% C++ 3.77% CMake 0.46% C 5.07% LLVM 0.04% Rust 22.07% Assembly 0.05% Pascal 1.72% BASIC 0.31% Makefile 0.36% Monkey C 0.26%
rust c python kotlin java llvm compiler lexer paser dfa

compiler_lab's Introduction

compiler_lab

All programs have been tested on ubuntu 17.04 64 bit, and some programs have been tested on windows 10 64bit.

lex & yacc

  1. count line num using lex&clang
  2. upper chars using lex&clang
  3. calculator using lex&yacc&clang
  4. calculator using jlex&cup&java
  5. calculator using ply&python
  6. some simple examples using ply&python
  7. calculator using rust
  8. lexers using rust/nom
  9. Solving LL(1) First/Follow/PS Sets

some automaton, turing machine codes

For understanding some concepts and internals of "Formal Languages and Automata"

automaton

From https://github.com/cforth/toys/tree/master/Automaton

书籍《计算的本质:深入剖析程序和计算机》中第三章以及第四章的自动机实现。

  1. section 3.1 确定性有限自动机(Deterministic Finite Automaton,DFA)
  2. section 3.2 非确定性有限自动机(Nondeterministic Finite Automata,NFA)
  3. section 3.3 正则表达式的实现
  4. section 3.4 NFA与DFA的等价性
  5. section 4.1 确定性下推自动机(Deterministic PushDown Automaton,DPDA)
  6. section 4.2 非确定性下推自动机(Nondeterministic Pushdown Automaton,NPDA)
  7. section 4.3.1 词法分析(Lexical Analyzer)
  8. section 4.3.2 语法分析(Grammar Analyzer)
  9. minimised DFA from DFA from NFA from Regular_Expression

automata in rust

  1. show nfa/dfa

turing machine

From https://github.com/cforth/toys/tree/master/Turing

《计算的本质:深入剖析程序和计算机》中第五章的图灵机实现。

  1. section 5.1 确定型图灵机(Deterministic Turing Machine,DTM)

compiler, interpreter, simulator

  1. Very basic IDE and vizualization/simulation of Mini-C compiler using kotlin
  2. BASIC language & interpreter using ply &python
  3. simple stack machine using python

little toy in rust

  1. interpreter in rust
  2. compiler in rust

compiler_lab's People

Contributors

chyyuu avatar chyyuu-tsinghua-cs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

compiler_lab's Issues

关于riscv-prebuilt.tar.gz文件的下载

老师,您好!
我正在配置实验的环境,请问除了从网络学堂下载 riscv-prebuilt.tar.gz的话,还有其他的途径吗?我不是清华的学生,我从网络上找不到如何下载该文件。

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.