back to scratko.xyz
summaryrefslogtreecommitdiff
path: root/lexical_analysis.h
blob: 9d7d55671c6ddd7220645f517bf10e1652ebd7b0 (plain)
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 LEXICAL_ANALYSIS_H_SENTRY
#define LEXICAL_ANALYSIS_H_SENTRY

#include "shell.h"
#include "readline.h"

int is_double_quotes_pair(struct param_type params);
int escape_double_quotes_or_backslash(int ch, struct param_type params);
int double_quotes_again(int ch, struct param_type params);
int check_separation(int ch, struct param_type params);
int ignore_spaces(int ch, struct param_type params);
int change_mode(int ch, struct param_type params);
int start_escape_sequence(int ch, struct param_type params);
int is_empty_word(int ch, struct param_type params);
int command_execution_condition(struct param_type *params);

int is_special_token(int ch, int next_ch);
int is_redirect_token(int ch, int next_ch);
int excessive_words(int ch, struct param_type *params);

void add_word_or_filename(struct w_queue *word_chain,
                          struct dynamic_array *tmp_word,
                          struct param_type *params);

int validate_redirections(int ch, int next_ch, struct param_type *params);
int is_double_token(struct param_type *params);

int stream_redirect_tokens(struct w_queue *word_chain,
                           struct dynamic_array *tmp_word,
                           int ch, struct param_type *params,
                           struct readline_type *readline);

int double_quotes_again(int ch, struct param_type params);

int pipeline_token_processing(struct w_queue *word_chain,
                              struct c_queue *cmdlines,
                              struct dynamic_array *tmp_word,
                              struct param_type *params);

int special_tokens(struct w_queue *word_chain, struct c_queue *cmdlines,
                   struct dynamic_array *tmp_word, int ch,
                   struct param_type *params, struct readline_type *readline);

#endif