File: command_lexer.h

package info (click to toggle)
cgdb 0.6.7-2
  • links: PTS
  • area: main
  • in suites: bullseye, buster, jessie, jessie-kfreebsd, stretch
  • size: 3,276 kB
  • sloc: ansic: 17,828; sh: 5,176; exp: 1,019; lex: 611; makefile: 287; yacc: 255; cpp: 10
file content (44 lines) | stat: -rw-r--r-- 1,002 bytes parent folder | download
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
#ifndef COMMAND_LEXER_H
#define COMMAND_LEXER_H

/* enum TOKENS: the set of tokens that can be recognized by yylex
 * -------------
 *  SET: "set"
 *  UNSET: for future expansion
 *  BIND: for future expansion
 *  MACRO: for future expansion
 *  BOOLEAN: yes or no
 *  NUMBER: a series of digits
 *  IDENTIFIER: a valid identifier (letter followed by letters or numbers)
 *  COMMAND: a recognized command (for future expansion)
 *  STRING: a quoted-string.
 *  EOL: end of line
 */
enum TOKENS {
    SET = 255,
    UNSET,
    BIND,
    MACRO,
    SHELL,
    BANG,
    BOOLEAN,
    NUMBER,
    IDENTIFIER,
    COMMAND,
    STRING,
    EOL
};

/* yylex: retreive the next token from the current scan buffer
 * --------------
 *  return: an integer value representing the token type (enum TOKEN).  0 when
 *          no more input.
 */
int yylex(void);

/* get_token: Get the scanned token.  This value will change the next time yylex is called 
 * --------------
 */
const char *get_token(void);

#endif