All pastes #976788 Raw Edit

Meins

public c v1 · immutable
·published 2008-04-08 12:55 UTC
rendered paste body
/* Cry! is (c) by DMA   Cry! is written in Year 2008 */#include <console>#define VERSION "Cry! 0.0.1"/* Global Set */#define GLB_DL 0#define GLB_CC 1#define GLB_CR 2#define GLB_CY 3#define GLB_KL 4#define GLB_CO 5#define WHITESPACE 5#define GLB_WS 0#define GLB_USE 1#define NEED_CLOSE 2/* Global Vars */new pos, newset, lastset;stock match(matchtext[]){	if(pos == 0) /* $ Zeichen */	{		if(matchtext[pos] == '$')		{			newset = GLB_DL			pos++			match(matchtext)		}	}	/* c muss gefunden werden */	if(newset == GLB_DL)	{		if(matchtext[pos] == 'c')		{			newset = GLB_CC			pos++			match(matchtext)		}	}	if(newset == GLB_CC)	{		if(matchtext[pos] == 'r')		{			newset = GLB_CR			pos++			match(matchtext)		}	}	if(newset == GLB_CR)	{		if(matchtext[pos] == 'y')		{			newset = GLB_CY			pos++			match(matchtext)			return 1		}	}	if(newset == GLB_CY || lastset == GLB_WS || newset == GLB_USE)	{		if(matchtext[pos] == ' ')		{			newset = WHITESPACE			pos++			match(matchtext)			return 1		}		if(matchtext[pos] == '{')		{			newset = GLB_KL			pos++			match(matchtext)			return 1		}	}	if(newset == WHITESPACE)	{		lastset = GLB_WS		pos++		match(matchtext)	}	if(newset == GLB_KL)	{		if(matchtext[pos] == 'c')		{			newset = GLB_USE			pos++			match(matchtext)		}		if(matchtext[pos] == ' ')		{			lastset = GLB_WS			pos++			match(matchtext)		}	}	if(newset == GLB_USE)	{		if(matchtext[pos] == 'o')		{			newset = GLB_CO			pos++			match(matchtext)		}	}	if(newset == GLB_CO)	{		if(matchtext[pos] == '2')		{			lastset = NEED_CLOSE			pos++			match(matchtext)		}	}		return 1 // Testweise einfach 1}main (){	printf "[Version %s]\n",VERSION	if(match("$cry {") == 1)	{		print "main init()\n"	}}