Giter VIP home page Giter VIP logo

drifter1 / compiler Goto Github PK

View Code? Open in Web Editor NEW
165.0 2.0 41.0 666 KB

Implementing a complete Compiler for a simple C-like language using the C-tools Flex and Bison

License: GNU General Public License v3.0

C 76.56% Lex 4.82% Yacc 18.05% Makefile 0.15% Assembly 0.42%
lexical-analysis syntax-analysis symbol-table bison flex compiler-design compiler semantic-analysis machine-code lexer

compiler's Introduction

compiler

Compiler Design Steps

A short Description of this repository:
It contains all the Code from my "Writing a simple Compiler on my own" series on Steemit (step by step / article by article), where I am implementing a complete Compiler for a simple C-like Language using the C-tools Flex and Bison and self-written Custom Structures and Code.

Articles

It's worth noting that not all articles contain actual Code. Compiler design in general is mostly about understanding how everything needs to work. After understanding the basic principle, the implementation is much easier, which is why some articles are more or less 90% theory!

Until now we covered the following...

General Knowledge and Lexical Analysis

Syntax Analysis

Semantic Analysis (1)

Intermediate Code Generation (AST)

Semantic Analysis (2)

Machine Code Generation

Next Up

What remains now is:

  • Machine Code generation in MIPS Assembly (remaining cases)
  • Various Optimizations in the Compiler's Code

After doing all that we could also get into Optimizations, Extensions and even more if you like :)

compiler's People

Contributors

drifter1 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  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

compiler's Issues

Syntax error problem

As you said, I did everything and it worked. But when I try to compile the example file, it gives me an Syntax error on line 6. Can you help me?
I think it is because of an initialization of array
image

Wrong name

In your project Combining Flex and Bison, the '[' token in lexer.l should be named LBRACK rather than RBRACK, which will prone to subtle, hard-to-find errors in parsing

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.