Voxel resources
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* file: "tinyc.d" */ | |
/* Copyright (C) 2001 by Marc Feeley, All Rights Reserved. */ | |
// D port by Mr.Smith (C) 2014 | |
import std.stdio; | |
import std.algorithm : equal; | |
/* | |
* This is a compiler for the Tiny-C language. Tiny-C is a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* file: "tinyc.c" */ | |
/* originally from http://www.iro.umontreal.ca/~felipe/IFT2030-Automne2002/Complements/tinyc.c */ | |
/* Copyright (C) 2001 by Marc Feeley, All Rights Reserved. */ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Top-level declarations | |
static double parse_add(void); | |
static const char* state; | |
// Checks if state is a valid digit | |
static int is_digit(void) { | |
return *state >= '0' && *state <= '9'; | |
} | |
// Get the digit value of state |