Skip to main content

Questions tagged [compiler]

For reviews of code which implements any part of a compiler - lexing, parsing, code generation and optimization, etc. Also for any plugin for an existing compiler. Don't use this tag for code which is input to a compiler - tag it with the correct language instead.

6 votes
2 answers
395 views

I am trying to write a simple tokenizer for a basic arithmetic calculator. Here's the code: ...
user2338150's user avatar
8 votes
1 answer
351 views

Below is a C++ version of a lexer for the Monkey programming language, originally written in Go, as presented in the book Writing An Interpreter In Go. LOC: 262. (Excluding the tests.) Language: Copy ...
Madagascar's user avatar
  • 10.1k
4 votes
1 answer
164 views

Below is a C version of a lexer for the Monkey programming language, originally written in Go, as presented in the book Writing An Interpreter In Go. LOC: 371. (Excluding the tests.) Language: Copy ...
Madagascar's user avatar
  • 10.1k
1 vote
2 answers
147 views

In the process of creating my first toy language, I have created the base grammar for it (which can surely be improved upon, feel free to comment). I am emitting C at the moment. \begin{align} ...
Tsaras's user avatar
  • 157
6 votes
0 answers
305 views

Language: The Brainfuck programming language consists of eight commands: ...
Madagascar's user avatar
  • 10.1k
3 votes
3 answers
455 views

I have a code snippet here about 1D convolution in pure ANSI C code. Question: Is this most optimized C code, or can it be done in a more optimized way? In my ...
euraad's user avatar
  • 183
4 votes
2 answers
150 views

I recently finished cleaning up my code in a compiler/interpreter for a strongly-typed domain-specific language, which makes use of three sorts of types: Compile-time enumerated types: Have one of a ...
P...'s user avatar
  • 141
6 votes
2 answers
246 views

I have a lexer (program that turns source code into tokens) written in Go that I am re-writing in Rust. The lexer should take in a sequence of tokens, generally different special characters, integers, ...
John Allison's user avatar
4 votes
1 answer
474 views

I made an assembler for the "hack" assembly language, here's an example of what it looks like: ...
elonma1234's user avatar
3 votes
1 answer
958 views

Below is my code for building a call-flow graph from a Python abstract syntax tree. I'm not satisfied with it because the algorithm is very complicated. Perhaps much more complicated than it needs to ...
Gaslight Deceive Subvert's user avatar
3 votes
2 answers
395 views

I wrote a very simple VM to get a bit more familiar with Rust. The VM architecture was not the focus, so that I think that can safely ignored. Is my code idiomatic and clean? I felt that I was very ...
xilpex's user avatar
  • 289
4 votes
1 answer
270 views

This program compiles Brainfuck source code to an x86_64 ELF executable. It doesn't rely on any backend, just raw binary stream to a functional executable. In the implementation, each cell holds an 8-...
xiver77's user avatar
  • 419
3 votes
0 answers
113 views

I'm new here, therefore I hope to be clear in this question. Firstly, I want to underline that I'm not a programmer, and I attended only a beginner course in Python, but I like to solve problems ...
Davide Motta's user avatar
4 votes
1 answer
220 views

Now that my new compiler is capable of compiling programs such as the Analog Clock in AEC, I've decided to share the code of that compiler with you, to see what you think about it. File ...
FlatAssembler's user avatar
9 votes
1 answer
347 views

I wanted to make a script that would parse a main file (with int main()) look in its #include "..." local headers, and ...
milanHrabos's user avatar

15 30 50 per page
1
2 3 4 5