File: lex-next.c

package info (click to toggle)
bow 19991122-4
  • links: PTS
  • area: main
  • in suites: woody
  • size: 2,544 kB
  • ctags: 2,987
  • sloc: ansic: 38,660; lisp: 1,072; makefile: 594; perl: 492; yacc: 149; sh: 91
file content (76 lines) | stat: -rw-r--r-- 2,215 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/* Implementation of helping functions for lexers that use a nested,
   underlying lexer. */
/* Copyright (C) 1997, 1998, 1999 Andrew McCallum

   Written by:  Andrew Kachites McCallum <mccallum@cs.cmu.edu>

   This file is part of the Bag-Of-Words Library, `libbow'.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public License
   as published by the Free Software Foundation, version 2.
   
   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Library General Public License for more details.

   You should have received a copy of the GNU Library General Public
   License along with this library; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA */


#include <bow/libbow.h>

/* Open the underlying lexer. */
bow_lex *
bow_lexer_next_open_text_fp (bow_lexer *self, FILE *fp,
			     const char *filename)
{
  assert (self->next);
  return self->next->open_text_fp (self->next, fp, filename);
}

/* Open the underlying lexer. */
bow_lex *
bow_lexer_next_open_str (bow_lexer *self, char *buf)
{
  assert (self->next);
  return self->next->open_str (self->next, buf);
}

/* Get a word using the next lexer */
int
bow_lexer_next_get_word (bow_lexer *self, bow_lex *lex, 
			 char *buf, int buflen)
{
  assert (self->next);
  return self->next->get_word (self->next, lex, buf, buflen);
}

/* Get a raw word using the next lexer */
int
bow_lexer_next_get_raw_word (bow_lexer *self, bow_lex *lex, 
			     char *buf, int buflen)
{
  assert (self->next);
  return self->next->get_raw_word (self->next, lex, buf, buflen);
}

/* Postprocess a word using the next lexer */
int
bow_lexer_next_postprocess_word (bow_lexer *self, bow_lex *lex, 
				 char *buf, int buflen)
{
  assert (self->next);
  return self->next->postprocess_word (self->next, lex, 
					     buf, buflen);
}

/* Close the underlying lexer. */
void
bow_lexer_next_close (bow_lexer *self, bow_lex *lex)
{
  assert (self->next);
  self->next->close (self->next, lex);
}