All Projects → chyyuu → compiler_lab

chyyuu / compiler_lab

Licence: GPL-2.0 license
Some toy labs for compiler course

Programming Languages

python
139335 projects - #7 most used programming language
rust
11053 projects
kotlin
9241 projects
c
50402 projects - #5 most used programming language
java
68154 projects - #9 most used programming language
C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to compiler lab

fauton
An ecosystem of packages to work with automaton and parsers (dfa/nfa/e-nfa/regex/cfg/pda)
Stars: ✭ 36 (-26.53%)
Mutual labels:  nfa, dfa
llvm-kaleidoscope
LLVM Tutorial: Kaleidoscope (Implementing a Language with LLVM)
Stars: ✭ 124 (+153.06%)
Mutual labels:  llvm, lexer
Regex
An implementation of regular expressions for Rust. This implementation uses finite automata and guarantees linear time matching on all inputs.
Stars: ✭ 2,125 (+4236.73%)
Mutual labels:  nfa, dfa
ugo
µGo编程语言(从头开发一个迷你Go语言编译器)
Stars: ✭ 38 (-22.45%)
Mutual labels:  llvm, lexer
ugo-compiler-book
📚 µGo语言实现(从头开发一个迷你Go语言编译器)[Go版本+Rust版本]
Stars: ✭ 996 (+1932.65%)
Mutual labels:  llvm, lexer
visual-automata
Visual Automata is a Python 3 library built as a wrapper for the Automata library to add more visualization features.
Stars: ✭ 55 (+12.24%)
Mutual labels:  nfa, dfa
snapdragon-lexer
Converts a string into an array of tokens, with useful methods for looking ahead and behind, capturing, matching, et cetera.
Stars: ✭ 19 (-61.22%)
Mutual labels:  lexer
ebpfault
A BPF-based syscall fault injector
Stars: ✭ 65 (+32.65%)
Mutual labels:  llvm
expreso
☕ A boolean expression parser and evaluator in Elixir.
Stars: ✭ 54 (+10.2%)
Mutual labels:  lexer
flextool
C++ compile-time programming (serialization, reflection, code modification, enum to string, better enum, enum to json, extend or parse language, etc.)
Stars: ✭ 32 (-34.69%)
Mutual labels:  llvm
Grimheart
Torture your LLVM Obfuscation
Stars: ✭ 29 (-40.82%)
Mutual labels:  llvm
SwiLex
A universal lexer library in Swift.
Stars: ✭ 29 (-40.82%)
Mutual labels:  lexer
pa.llvm
Program Analysis for LLVM
Stars: ✭ 37 (-24.49%)
Mutual labels:  llvm
rain
A programming language.
Stars: ✭ 20 (-59.18%)
Mutual labels:  llvm
pacxx-llvm
Programming Accelerators with C++ (PACXX)
Stars: ✭ 57 (+16.33%)
Mutual labels:  llvm
sycl
SYCL for Vitis: Experimental fusion of triSYCL with Intel SYCL oneAPI DPC++ up-streaming effort into Clang/LLVM
Stars: ✭ 80 (+63.27%)
Mutual labels:  llvm
clad
clad -- automatic differentiation for C/C++
Stars: ✭ 161 (+228.57%)
Mutual labels:  llvm
U-00DC-Sprache
"Ü" programming language development
Stars: ✭ 43 (-12.24%)
Mutual labels:  llvm
adorad
Fast, Expressive, & High-Performance Programming Language for those who dare
Stars: ✭ 54 (+10.2%)
Mutual labels:  llvm
sb-dynlex
Configurable lexer for PHP featuring a fluid API.
Stars: ✭ 27 (-44.9%)
Mutual labels:  lexer

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
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].