Here is the first attempt
/*
* Simple program to parse regular expressions
* (C) Balbir Singh
* Permission to copy the program if and only if the (C) is
* maintained.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <errno.h>
#include <bitset>
#include <iostream>
#include <queue>
using namespace std;
static bool status = true;
#ifdef DEBUG
#define debug(x...) {\
printf("%s:%d ", __FUNCTION__, __LINE__); \
printf(x); \
}
#else
#define debug(x...)
#endif
#define pcr debug("current token is %c\n", s[idx]);
#define perr {\
fprintf(stderr, "%s:%d parse error at token is %c\n", \
__PRETTY_FUNCTION__, __LINE__, s[idx-1]); \
status = false; \
};
2 comments:
Ballu,
Please don't put code - it makes me scroll for like eternity, and still I haven't got anything out of it. How about code snippets - or why don't you link it from an other page?
BTW, the font size too makes it hard to read (particularly on IE)
Good point, I am fixing it right away. The test passed (or failed) I guess.
Post a Comment