6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 24 package jdk.internal.clang; 25 26 import clang.*; 27 import clang.Index; 28 29 import static clang.Index.CXCursor; 30 import static clang.Index.CXSourceLocation; 31 import static clang.Index.CXSourceRange; 32 33 import java.foreign.memory.Pointer; 34 import java.foreign.Scope; 35 import java.util.ArrayList; 36 import java.util.stream.Stream; 37 38 public class Cursor { 39 40 private final CXCursor cursor; 41 private final int kind; 42 43 Cursor(CXCursor cursor) { 44 this.cursor = cursor; 45 kind = LibClang.lib.clang_getCursorKind(cursor); 46 } 47 public boolean isDeclaration() { 48 return LibClang.lib.clang_isDeclaration(kind) != 0; 49 } 50 51 public boolean isPreprocessing() { return LibClang.lib.clang_isPreprocessing(kind) != 0; } | 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 24 package jdk.internal.clang; 25 26 import static clang.Index_h.CXCursor; 27 import static clang.Index_h.CXSourceLocation; 28 import static clang.Index_h.CXSourceRange; 29 30 import java.foreign.memory.Pointer; 31 import java.foreign.Scope; 32 import java.util.ArrayList; 33 import java.util.stream.Stream; 34 35 public class Cursor { 36 37 private final CXCursor cursor; 38 private final int kind; 39 40 Cursor(CXCursor cursor) { 41 this.cursor = cursor; 42 kind = LibClang.lib.clang_getCursorKind(cursor); 43 } 44 public boolean isDeclaration() { 45 return LibClang.lib.clang_isDeclaration(kind) != 0; 46 } 47 48 public boolean isPreprocessing() { return LibClang.lib.clang_isPreprocessing(kind) != 0; } |