/[ascend]/trunk/pygtk/main.cpp
ViewVC logotype

Contents of /trunk/pygtk/main.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 531 - (show annotations) (download) (as text)
Mon Apr 24 02:04:02 2006 UTC (18 years, 2 months ago) by johnpye
Original Path: trunk/interface/main.cpp
File MIME type: text/x-c++src
File size: 671 byte(s)
Removing extra subdir level in pygtk path
1 #include <unistd.h>
2
3 #include "library.h"
4 #include "type.h"
5 #include "instance.h"
6 #include "symchar.h"
7 #include "reporter.h"
8
9 void esc_seq(char *s="0",FILE *f=stderr){
10 fprintf(f,"%c[%sm",char(27),s);
11 }
12
13 int red_error(ERROR_REPORTER_CALLBACK_ARGS){
14 bool red=false;
15 if((int)sev >= (int)ASC_PROG_NOTE) red=true;
16
17 if(red)esc_seq("31;2");
18 vfprintf(stderr,fmt,args);
19 if(red)esc_seq();
20 }
21
22 int main(void){
23 Reporter *reporter = Reporter::Instance();
24 reporter->setErrorCallback(red_error);
25
26 Library *l;
27 l = new Library();
28 l->load("simple_fs.a4c");
29 Type t;
30 t = l->findType("test_controller");
31 Instanc i = t.getInstance("tc"); // speling is deliberate
32 //i.solve();
33 }
34

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22