A compiler is a computer program (or set of programs) that transforms source code written in a programming language (the source language) into another computer language (the target language, often having a binary form known as object code). The most common reason for converting a source code is to ...
1
vote
0answers
34 views
Handwritten parser for a language similar to C
I recently asked on a review about my C lexer. I've since learned more about parsing and Backus-Naur Form to make a Parser.
I'm planning to eventually install an AST to this Parser and create a ...
3
votes
2answers
44 views
Adding numbers of any type
I'm writing an interpreter, and I'm designing the abstract syntax tree currently. Right now, I'm trying to figure out a way to add (or do other operations with) two ...
13
votes
0answers
140 views
Brainfuck to x86 Assembly Compiler
After my Brainfuck Interpreter written in x86 Assembly I decided that it was time to get to the next step, writing a Brainfuck Compiler in Java that generates x86 Assembly and compiles that to an ...
10
votes
1answer
356 views
Assembler for CPU
I recently put together an assembler for a CPU I designed. I'm looking for feedback on my program structure, formatting, or anything else. I'm self taught on all of this so I don't have opportunities ...
0
votes
0answers
27 views
Tag that prints expressions for my template language
This is the PrintNode class from my template language Aegis. This class' purpose is to enable printing expressions (strings, variables, numbers, ...) in the language. eg:
...
1
vote
0answers
33 views
Bytecode for a custom programming language [closed]
Sorry for the tags, there wasn't a bytecode tag, and this technically has to do something with a compiler and interpreter :P.
I am working on a programming language that compiles into my custom ...
3
votes
1answer
214 views
Runtime compiler for getting/setting runtime property values
I've been playing about with runtime compilation to allow me to get/set runtime property values in C#, and so far I have come up with a class.
This allows me to write code like the following which ...
0
votes
1answer
47 views
Compiler for grond, a language-in-the-making
I'm working on a language called grond (see it on GitHub); the compiler is so small it is included in this post.
My gut tells me that this code is awful, but it works. I am hesitant to change things ...
2
votes
0answers
172 views
Cyther: The Cross Platform Cython/Python Compiler (Take 2)
I recently posted an earlier version of this code on Code Review, and now with the given suggestions and many other improvements, I am back. I included the description of exactly what Cyther is ...
8
votes
2answers
350 views
Cyther: The Cross Platform Cython/Python Compiler
The newer version of this question is located here: Cyther: The Cross Platform Cython/Python Compiler (Take 2)
I am currently writing a Python library (soon to be published)that automatically ...
8
votes
2answers
98 views
Compiler for a minimal LISP dialect to run on the Java Virtual Machine
As the title states, this is a compiler written in C with a ruby build script that translates a minimal LISP dialect and spits out an executable jar file. I designed this LISP dialect and named it ...
3
votes
2answers
1k views
Lexer for C# source code
This code reads a .cs source file in the \bin folder and parses the C# code in it. The program outputs keywords, identifiers, separators and numerical constants.
How could it be improved?
...
6
votes
2answers
151 views
Brainf*ck to NASM converter written in C
I have made a very simple Brainfuck to NASM converter, that is usable for practically all programs. It has one trivial optimisation (to subsitute ADD for ...
2
votes
2answers
105 views
Build script for an operating system written in C++
I recently started following the James M Kernel Dev tutorials and was able to create an operating system in C++.
Here is the source on GitHub.
I have a couple of questions:
Is my coding style ok?
...
5
votes
1answer
37 views
Pseudoportable C script pattern - follow-up
See the initial/previous iteration.
I have rewritten the script following the answer of @200_success.
Now it looks like this:
...
5
votes
1answer
64 views
Pseudoportable C script pattern
(See the next iteration.)
From time to time, while working with a command line in *nix family of operating systems, we have to write those scripts doing a rather specific task. Usually we use ...
14
votes
3answers
476 views
BF#: Round 2 (Fight!)
So I've completely changed how BrainfuckSharp does things, and added some features. This is obviously a follow up to: Interpreting Brainfuck code to C#, then compiling to a .exe
It now features an <...
6
votes
1answer
102 views
Brainfuck to Java converter
Similar to the previous post Brainfuck Interpreter: Slower than a Snail?, it runs BF in java. The only difference is that the converter will convert the BF code into a compilable and fairly readable ...
11
votes
3answers
444 views
Interpreting Brainfuck code to C#, then compiling to a .exe
This is a C# programme to convert Brainfuck to C#, then convert that C# to a .exe. So basically, it's a Brainfuck to Windows exe file converter/compiler.
This requires any of:
.NET 2.0 in C:\Windows\...
7
votes
1answer
89 views
Nothing compiler/interpreter, Part 2
Part 1
I've followed some of the suggestions:
Adding newlines to error messages
Implementing options (I decided to use boost instead of getopt)
Using strerror for fstream failure
Allow multiple ...
10
votes
3answers
599 views
Fastest possible text template for repeated use?
While reviewing Sending templatized e-mail to a million contacts, I wrote this implementation to illustrate an alternate approach. It is designed to be the fastest possible way to generate templated ...
12
votes
2answers
376 views
Abstract syntax tree for simple Lisp-like interpreter
A week or so ago, I wrote a binary expression calculator with the hope of better understanding how interpreters and compilers work. In the same vein, I've tried to write a lisp like language ...
9
votes
1answer
165 views
A BrainF*ck-ish compiler in C
-ish because I removed the input functionality from the compiler. And, the compiler does not support nested loops
I've been recently reading up on compilers and how they work. Although this doesn't ...
3
votes
1answer
137 views
Simple flex-based lexer
I am trying to learn flex and have created this simple program. The rule for comments works correctly for single line comments such as:
// this is a comment
and ...
5
votes
1answer
166 views
JavaCC Android port User Interface (Activity) class
I have been working on a port of JavaCC for Android. It is mainly an interface. I needed only to modify the original source to redirect output to a TextView. The point of this project is to rekindle ...
2
votes
0answers
467 views
C++ makefile for CPLEX with environment loading
CPLEX is a solver for mathematical problems made by IBM, and it offers callable C libraries.
My usual project configuration is a main.cpp file will all the important code and a simple cpxmacro.h file ...
15
votes
3answers
1k views
Reverse Polish notation based compiler
Description
Very small subset of Forth
This is a proof of concept level compiler, no optimizations or over/underflow checking
See the embedded POD for more information
NASM is used as assembler
gcc ...
2
votes
1answer
194 views
Using a compiler specified on the command line or automatically detected
Here is part of my build system.
...