Synopsis - Cross-Reference
File: /src/Synopsis/ASG/SourceFile.hh1// 2// Copyright (C) 2004 Stefan Seefeld 3// All rights reserved. 4// Licensed to the public under the terms of the GNU LGPL (>= 2), 5// see the file COPYING for details. 6// 7 8#ifndef _Synopsis_ASG_SourceFile_hh 9#define _Synopsis_ASG_SourceFile_hh 10 11#include <Synopsis/Python/Object.hh> 12#include <Synopsis/ASG/Declaration.hh> 13 14namespace Synopsis 15{ 16 17class Include : public Python::Object 18{ 19public: 20 Include(const Python::Object &o) throw(TypeError) : Python::Object(o) { assert_type();} 21 SourceFile target() const { return narrow<SourceFile>(attr("target")());} 22 std::string name() const { return narrow<std::string>(attr("name")());} 23 bool is_macro() const { return narrow<bool>(attr("is_macro")());} 24 bool is_next() const { return narrow<bool>(attr("is_next")());} 25 void assert_type() throw(TypeError) { Python::Object::assert_type("Synopsis.SourceFile", "Include");} 26}; 27 28class MacroCall : public Python::Object 29{ 30public: 31 MacroCall(const Python::Object &o) throw(TypeError) : Python::Object(o) { assert_type();} 32 void assert_type() throw(TypeError) { Python::Object::assert_type("Synopsis.SourceFile", "MacroCall");} 33 std::string name() { return narrow<std::string>(attr("name"));} 34 long start_line() { return narrow<long>(attr("start").get(0));} 35 long start_col() { return narrow<long>(attr("start").get(1));} 36 long end_line() { return narrow<long>(attr("end").get(0));} 37 long end_col() { return narrow<long>(attr("end").get(1));} 38 long e_start_line() { return narrow<long>(attr("expanded_start").get(0));} 39 long e_start_col() { return narrow<long>(attr("expanded_start").get(1));} 40 long e_end_line() { return narrow<long>(attr("expanded_end").get(0));} 41 long e_end_col() { return narrow<long>(attr("expanded_end").get(1));} 42}; 43 44} 45 46#endif