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 ...
6
votes
0answers
26 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
454 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
206 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 ...
10
votes
2answers
278 views
+, -, *, /, () expression calculator
In an effort to understand how compilers work, I wrote a simple expression calculator in C#. A CalculatorExpression takes an infix string, converts the infix string ...
8
votes
1answer
101 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
94 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
140 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
174 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 ...
14
votes
3answers
632 views
Reverse Polish Notation Compiler
Description
A reverse polish notation based compiler.
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 ...