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

Contents of /trunk/pygtk/name.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 669 - (show annotations) (download) (as text)
Wed Jun 21 07:00:45 2006 UTC (17 years, 11 months ago) by johnpye
File MIME type: text/x-c++src
File size: 879 byte(s)
Merged changes from DAE branch (revisions 702 to 819) back into trunk.
This adds the Integration API to the ASCEND solver (in base/generic).
Also provides pre-alpha support for 'IDA' from the SUNDIALS suite, a DAE solver.
Many other minor code clean-ups, including adoption of new 'ASC_NEW' and friends (to replace 'ascmalloc')
Added some very sketchy stuff providing 'DIFF(...)' syntax, although it is anticipated that this will be removed.
1 #include <iostream>
2 #include <stdexcept>
3 #include <sstream>
4 using namespace std;
5
6 #include "name.h"
7
8 extern "C"{
9 #include <general/dstring.h>
10 #include <utilities/ascConfig.h>
11 #include <compiler/compiler.h>
12 #include <compiler/expr_types.h>
13 #include <compiler/symtab.h>
14 #include <compiler/nameio.h>
15 }
16
17 Nam::Nam(){
18 throw runtime_error("Can't create new Nam objects");
19 }
20
21 Nam::Nam(struct Name *name) : name(name){
22 // nothing else
23 }
24
25 Nam::Nam(const SymChar &sym){
26 //cerr << "CREATING NAME from SymChar '" << sym << "'" << endl;
27 name = CreateIdName(sym.getInternalType());
28 }
29
30 Nam::~Nam(){
31 // cerr << "DESTROY NAME" << endl;
32 DestroyName(name);
33 }
34
35 const string
36 Nam::getName() const{
37 /// @TODO Make this more efficient...
38 stringstream ss;
39 char *longname = WriteNameString(name);
40 ss << longname;
41 return ss.str();
42 }
43
44 struct Name *
45 Nam::getInternalType() const{
46 return name;
47 }
48

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