comparison 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
comparison
equal deleted inserted replaced
-1:000000000000 0:13d2b8934445
1 /*
2 * AnaGram, A System for Syntax Directed Programming
3 * Copyright 1993-2002 Parsifal Software. All Rights Reserved.
4 * Copyright 2006, 2007 David A. Holland. All Rights Reserved.
5 * See the file COPYING for license and usage terms.
6 *
7 * agcl.cpp - main function for command line version
8 */
9
10 #include <stdio.h>
11 #include <stdlib.h>
12 #include "port.h"
13
14 #define AG_EXE
15 #include "aglib.h"
16 #include "version.h"
17
18 //#define INCLUDE_LOGGING
19 #include "log.h"
20
21 #ifdef DUMMYGUI
22 void bailOut(const char *problem) {
23 LOGSECTION("bailOut");
24 LOGV(problem);
25 LOGSTACK;
26 fprintf(stderr, "%s\nUnexpected program termination\n", problem);
27 exit(1);
28 //IAssertionFailure exception("problem", 0);
29 //throw(exception);
30 }
31 #endif
32
33 int main(int argc, char *argv[]) {
34 LOGSECTION("Main Program");
35 init(argv[0]);
36
37 if (argc != 2) {
38 fprintf(stderr, "\n");
39 fprintf(stderr, " AnaGram, A System for Syntax-Directed Programming\n");
40 fprintf(stderr, " %s\n", VERSIONSTRING);
41 fprintf(stderr, " Copyright 1993-2002 Parsifal Software.\n");
42 fprintf(stderr, " Copyright 2006, 2007 David A. Holland.\n");
43 fprintf(stderr, " All Rights Reserved.\n");
44 fprintf(stderr, "\n");
45 fprintf(stderr, "Usage: agcl <file name>\n");
46 return 1;
47 }
48
49 return commandLineBuild(argv[1]);
50 }