Mercurial > ~dholland > hg > ag > index.cgi
diff anagram/agcl/agcl.cpp @ 0:13d2b8934445
Import AnaGram (near-)release tree into Mercurial.
author | David A. Holland |
---|---|
date | Sat, 22 Dec 2007 17:52:45 -0500 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/anagram/agcl/agcl.cpp Sat Dec 22 17:52:45 2007 -0500 @@ -0,0 +1,50 @@ +/* + * AnaGram, A System for Syntax Directed Programming + * Copyright 1993-2002 Parsifal Software. All Rights Reserved. + * Copyright 2006, 2007 David A. Holland. All Rights Reserved. + * See the file COPYING for license and usage terms. + * + * agcl.cpp - main function for command line version + */ + +#include <stdio.h> +#include <stdlib.h> +#include "port.h" + +#define AG_EXE +#include "aglib.h" +#include "version.h" + +//#define INCLUDE_LOGGING +#include "log.h" + +#ifdef DUMMYGUI +void bailOut(const char *problem) { + LOGSECTION("bailOut"); + LOGV(problem); + LOGSTACK; + fprintf(stderr, "%s\nUnexpected program termination\n", problem); + exit(1); + //IAssertionFailure exception("problem", 0); + //throw(exception); +} +#endif + +int main(int argc, char *argv[]) { + LOGSECTION("Main Program"); + init(argv[0]); + + if (argc != 2) { + fprintf(stderr, "\n"); + fprintf(stderr, " AnaGram, A System for Syntax-Directed Programming\n"); + fprintf(stderr, " %s\n", VERSIONSTRING); + fprintf(stderr, " Copyright 1993-2002 Parsifal Software.\n"); + fprintf(stderr, " Copyright 2006, 2007 David A. Holland.\n"); + fprintf(stderr, " All Rights Reserved.\n"); + fprintf(stderr, "\n"); + fprintf(stderr, "Usage: agcl <file name>\n"); + return 1; + } + + return commandLineBuild(argv[1]); +}