[Synopsis-changes] Synopsis/Synopsis/include/Synopsis/AST AST.hh,1.1,1.2 Declaration.hh,1.1,1.2 SourceFile.hh,1.1,1.2

Stefan Seefeld stefan at synopsis.fresco.org
Sun Jan 11 19:46:31 UTC 2004


Update of /cvs/synopsis/Synopsis/include/Synopsis/AST
In directory frida:/tmp/cvs-serv6573/include/Synopsis/AST

Modified Files:
	AST.hh Declaration.hh SourceFile.hh 
Log Message:
refinements

Index: AST.hh
===================================================================
RCS file: /cvs/synopsis/Synopsis/include/Synopsis/AST/AST.hh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -d -r1.1 -r1.2
--- AST.hh	10 Jan 2004 22:50:34 -0000	1.1
+++ AST.hh	11 Jan 2004 19:46:29 -0000	1.2
@@ -10,6 +10,7 @@
 #define _Synopsis_AST_AST_hh
 
 #include <Synopsis/Object.hh>
+#include <Synopsis/Callable.hh>
 #include <Synopsis/Dict.hh>
 #include <Synopsis/Tuple.hh>
 #include <Synopsis/AST/Declaration.hh>
@@ -23,8 +24,8 @@ public:
   AST() {}
   AST(const Object &o) throw(TypeError) : Object(o) { assert_type();}
 
-  Dict files() { return Dict(call("files"));}
-  List declarations() { return List(call("declarations"));}
+  Dict files() { return Dict(Callable(attr("files")).call());}
+  List declarations() { return List(Callable(attr("declarations")).call());}
   void assert_type() throw(TypeError) { Object::assert_type("Synopsis.AST", "AST");}
 };
 

Index: Declaration.hh
===================================================================
RCS file: /cvs/synopsis/Synopsis/include/Synopsis/AST/Declaration.hh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -d -r1.1 -r1.2
--- Declaration.hh	10 Jan 2004 22:50:34 -0000	1.1
+++ Declaration.hh	11 Jan 2004 19:46:29 -0000	1.2
@@ -19,12 +19,12 @@ class Declaration : public Object
 {
 public:
   Declaration(const Object &o) : Object(o) { assert_type();}
-  SourceFile file() { return narrow<SourceFile>(call("file"));}
-  int line() { return narrow<int>(call("line"));}
-  bool language() { return narrow<const char *>(call("language"));}
-  const char *type() { return narrow<const char *>(call("type"));}
-  const char *name() { return narrow<const char *>(call("name"));}
-  List comments() { return List(call("comments"));}
+  SourceFile file() { return narrow<SourceFile>(Callable(attr("file")).call());}
+  int line() { return narrow<int>(Callable(attr("line")).call());}
+  bool language() { return narrow<const char *>(Callable(attr("language")).call());}
+  const char *type() { return narrow<const char *>(Callable(attr("type")).call());}
+  const char *name() { return narrow<const char *>(Callable(attr("name")).call());}
+  List comments() { return List(Callable(attr("comments")).call());}
   void assert_type() throw(TypeError) 
   { Object::assert_type("Synopsis.AST", "Declaration");}
 };
@@ -33,8 +33,8 @@ class Macro : public Declaration
 {
 public:
   Macro(const Object &o) : Declaration(o) {}
-  List parameters() { return List(call("parameters"));}
-  const char *text() { return narrow<const char *>(call("text"));}
+  List parameters() { return List(Callable(attr("parameters")).call());}
+  const char *text() { return narrow<const char *>(Callable(attr("text")).call());}
 };
 
 }

Index: SourceFile.hh
===================================================================
RCS file: /cvs/synopsis/Synopsis/include/Synopsis/AST/SourceFile.hh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -d -r1.1 -r1.2
--- SourceFile.hh	10 Jan 2004 22:50:34 -0000	1.1
+++ SourceFile.hh	11 Jan 2004 19:46:29 -0000	1.2
@@ -10,6 +10,8 @@
 #define _Synopsis_AST_SourceFile_hh
 
 #include <Synopsis/Object.hh>
+#include <Synopsis/Tuple.hh>
+#include <Synopsis/Callable.hh>
 
 namespace Synopsis
 {
@@ -19,20 +21,20 @@ class SourceFile : public Object
 public:
   SourceFile() {}
   SourceFile(const Object &o) : Object(o) {}
-  std::string name() { return narrow<std::string>(call("filename"));}
-  std::string long_name() { return narrow<std::string>(call("full_filename"));}
-  bool is_main() { return narrow<bool>(call("is_main"));}
-  void is_main(bool flag) { call("set_is_main", flag);}
-  List includes() { return List(call("includes"));}
+  std::string name() { return narrow<std::string>(Callable(attr("filename")).call());}
+  std::string long_name() { return narrow<std::string>(Callable(attr("full_filename")).call());}
+  bool is_main() { return narrow<bool>(Callable(attr("is_main")).call());}
+  void is_main(bool flag) { Callable c(attr("set_is_main")); c.call(Tuple(flag));}
+  List includes() { return List(Callable(attr("includes")).call());}
 };
 
 class Include : public Object
 {
 public:
   Include(const Object &o) throw(TypeError) : Object(o) { assert_type();}
-  SourceFile target() const { return narrow<SourceFile>(attr("target"));}
-  bool is_macro() const { return narrow<bool>(attr("is_macro"));}
-  bool is_next() const { return narrow<bool>(attr("is_next"));}
+  SourceFile target() const { return narrow<SourceFile>(Callable(attr("target")).call());}
+  bool is_macro() const { return narrow<bool>(Callable(attr("is_macro")).call());}
+  bool is_next() const { return narrow<bool>(Callable(attr("is_next")).call());}
   void assert_type() throw(TypeError) { Object::assert_type("Synopsis.AST", "Include");}
 };
 





More information about the Synopsis-changes mailing list