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