1*ea6c7e11SMasatake YAMATO /* 2*ea6c7e11SMasatake YAMATO * Copyright (c) 2000-2001, Thaddeus Covert <sahuagin@mediaone.net> 3*ea6c7e11SMasatake YAMATO * Copyright (c) 2002 Matthias Veit <matthias_veit@yahoo.de> 4*ea6c7e11SMasatake YAMATO * Copyright (c) 2004 Elliott Hughes <enh@acm.org> 5*ea6c7e11SMasatake YAMATO * 6*ea6c7e11SMasatake YAMATO * This source code is released for free distribution under the terms of the 7*ea6c7e11SMasatake YAMATO * GNU General Public License version 2 or (at your option) any later version. 8*ea6c7e11SMasatake YAMATO * 9*ea6c7e11SMasatake YAMATO * This module contains functions for generating tags for Ruby language 10*ea6c7e11SMasatake YAMATO * files. 11*ea6c7e11SMasatake YAMATO */ 12*ea6c7e11SMasatake YAMATO 13*ea6c7e11SMasatake YAMATO #ifndef CTAGS_PARSER_RUBY_H 14*ea6c7e11SMasatake YAMATO #define CTAGS_PARSER_RUBY_H 15*ea6c7e11SMasatake YAMATO 16*ea6c7e11SMasatake YAMATO /* 17*ea6c7e11SMasatake YAMATO * INCLUDE FILES 18*ea6c7e11SMasatake YAMATO */ 19*ea6c7e11SMasatake YAMATO #include "general.h" /* must always come first */ 20*ea6c7e11SMasatake YAMATO 21*ea6c7e11SMasatake YAMATO #include "subparser.h" 22*ea6c7e11SMasatake YAMATO 23*ea6c7e11SMasatake YAMATO typedef struct sRubySubparser rubySubparser; 24*ea6c7e11SMasatake YAMATO 25*ea6c7e11SMasatake YAMATO struct sRubySubparser { 26*ea6c7e11SMasatake YAMATO subparser subparser; 27*ea6c7e11SMasatake YAMATO /* Returning other than CORK_NIL means the string is consumed. */ 28*ea6c7e11SMasatake YAMATO int (* lineNotify) (rubySubparser *s, const unsigned char **cp); 29*ea6c7e11SMasatake YAMATO void (* enterBlockNotify) (rubySubparser *s, int corkIndex); 30*ea6c7e11SMasatake YAMATO void (* leaveBlockNotify) (rubySubparser *s, int corkIndex); 31*ea6c7e11SMasatake YAMATO /* Privately used in Ruby parser side. */ 32*ea6c7e11SMasatake YAMATO int corkIndex; 33*ea6c7e11SMasatake YAMATO }; 34*ea6c7e11SMasatake YAMATO 35*ea6c7e11SMasatake YAMATO extern void rubySkipWhitespace (const unsigned char **cp); 36*ea6c7e11SMasatake YAMATO extern bool rubyCanMatchKeyword (const unsigned char** s, const char* literal); 37*ea6c7e11SMasatake YAMATO extern bool rubyCanMatchKeywordWithAssign (const unsigned char** s, const char* literal); 38*ea6c7e11SMasatake YAMATO 39*ea6c7e11SMasatake YAMATO extern bool rubyParseString (const unsigned char** cp, unsigned char boundary, vString* vstr); 40*ea6c7e11SMasatake YAMATO extern bool rubyParseMethodName (const unsigned char **cp, vString* vstr); 41*ea6c7e11SMasatake YAMATO extern bool rubyParseModuleName (const unsigned char **cp, vString* vstr); 42*ea6c7e11SMasatake YAMATO 43*ea6c7e11SMasatake YAMATO #endif 44