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

Stefan Seefeld stefan at synopsis.fresco.org
Tue Jan 13 07:42:12 UTC 2004


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

Modified Files:
	ASTModule.hh SourceFile.hh 
Log Message:
bug fixes, and support for 'MacroCall' type

Index: ASTModule.hh
===================================================================
RCS file: /cvs/synopsis/Synopsis/include/Synopsis/AST/ASTModule.hh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -d -r1.1 -r1.2
--- ASTModule.hh	10 Jan 2004 22:50:34 -0000	1.1
+++ ASTModule.hh	13 Jan 2004 07:42:09 -0000	1.2
@@ -39,6 +39,10 @@ public:
       params.set(i, Object(parameters[i]));
     return create<Macro>("Macro", Tuple(sf, line, lang, type, name, params, text));
   }
+  MacroCall create_macro_call(const std::string &name, int start, int end, int diff)
+  {
+    return create<MacroCall>("MacroCall", Tuple(name, start, end, diff));
+  }
   SourceFile create_source_file(const std::string &name,
 				const std::string &longname,
 				const std::string &language)

Index: SourceFile.hh
===================================================================
RCS file: /cvs/synopsis/Synopsis/include/Synopsis/AST/SourceFile.hh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -d -r1.2 -r1.3
--- SourceFile.hh	11 Jan 2004 19:46:29 -0000	1.2
+++ SourceFile.hh	13 Jan 2004 07:42:09 -0000	1.3
@@ -26,6 +26,7 @@ public:
   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());}
+  Dict macro_calls() { return Dict(Callable(attr("macro_calls")).call());}
 };
 
 class Include : public Object
@@ -38,6 +39,17 @@ public:
   void assert_type() throw(TypeError) { Object::assert_type("Synopsis.AST", "Include");}
 };
 
+class MacroCall : public Object
+{
+public:
+  MacroCall(const Object &o) throw(TypeError) : Object(o) { assert_type();}
+  void assert_type() throw(TypeError) { Object::assert_type("Synopsis.AST", "MacroCall");}
+  std::string name() { return narrow<std::string>(attr("name"));}
+  int start() { return narrow<int>(attr("start"));}
+  int end() { return narrow<int>(attr("end"));}
+  int diff() { return narrow<int>(attr("diff"));}
+};
+
 }
 
 #endif





More information about the Synopsis-changes mailing list