T
T
Tarasov Konstantin2015-04-14 04:06:01
Java
Tarasov Konstantin, 2015-04-14 04:06:01

Are there simple, but at the same time quite complete examples of compilers in nature?

I am writing my compiler in JVM bytecode, and I would really like to have an example of a sufficient complete compiler at hand. Because all that I could google myself was either the sources of large and serious compilers with tons of classes that you can’t figure out even in a month, or the “calculator compiler”, which are too elementary and cover only the most basic architecture issues. So I would like to have an example of a compiler (exactly an example in the code) for a full-fledged language (I don’t know, let’s say a stripped-down version of Pascal), have you met such?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
V
Vapaamies, 2015-04-14
@vapaamies

TCC, LCC, Pascal Pro, various Oberon compilers, it seems like someone made it for the Hummingbird OS. Borland seems to even open the sources of Turbo Pascal 6.0, I had them somewhere.

N
Nikolai Pavlov, 2015-04-14
@gurinderu

You can dig into the
groovy sources https://github.com/groovy/groovy-core
scala https://github.com/scala/scala

J
jackroll, 2015-04-14
@jackroll

https://www.youtube.com/playlist?list=PL8E78559021... - Dudes write their own virtual machine.

A
angry_cellophane, 2015-04-15
@angry_cellophane

on habré there was an article about the brainfuck compiler in java bytecode

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question