MiniDevil As beautiful as a shell
structs.h File Reference

Central type definitions for mandatory part. More...

+ This graph shows which files directly or indirectly include this file:

Detailed Description

Central type definitions for mandatory part.

Defines tokens, AST nodes, environment list & shell state.

Definition in file structs.h.

Enumerations

enum  t_token_type {
  TOKEN_WORD , TOKEN_PIPE , TOKEN_REDIR_IN , TOKEN_REDIR_OUT ,
  TOKEN_APPEND , TOKEN_HEREDOC , TOKEN_AND , TOKEN_OR ,
  TOKEN_LPAREN , TOKEN_RPAREN
}
 Token types produced by Lexer. More...
 
enum  t_quote_type { QUOTE_NONE , QUOTE_SINGLE , QUOTE_DOUBLE }
 Quote context of a token. More...
 
enum  t_node_type {
  NODE_COMMAND , NODE_PIPE , NODE_REDIR_IN , NODE_REDIR_OUT ,
  NODE_REDIR_APPEND , NODE_REDIR_HEREDOC , NODE_AND , NODE_OR ,
  NODE_SUBSHELL
}
 AST node types. More...
 
enum  t_syntax_error {
  ERR_NONE = 0 , ERR_EMPTY_INPUT , ERR_PIPE_START , ERR_PIPE_END ,
  ERR_PIPE_DOUBLE , ERR_PIPE_NO_CMD , ERR_REDIR_NO_FILE , ERR_REDIR_AFTER_PIPE ,
  ERR_AND_UNEXPECTED , ERR_OR_UNEXPECTED , ERR_PAREN_OPEN , ERR_PAREN_CLOSE ,
  ERR_PAREN_EMPTY , ERR_UNEXPECTED_LPAREN
}
 Syntax error codes (for parser) More...
 

Enumeration Documentation

◆ t_token_type

Token types produced by Lexer.

Enumerator
TOKEN_WORD 
TOKEN_PIPE 
TOKEN_REDIR_IN 
TOKEN_REDIR_OUT 
TOKEN_APPEND 
TOKEN_HEREDOC 
TOKEN_AND 
TOKEN_OR 
TOKEN_LPAREN 
TOKEN_RPAREN 

Definition at line 23 of file structs.h.

◆ t_quote_type

Quote context of a token.

Enumerator
QUOTE_NONE 
QUOTE_SINGLE 
QUOTE_DOUBLE 

Definition at line 40 of file structs.h.

◆ t_node_type

AST node types.

Enumerator
NODE_COMMAND 
NODE_PIPE 
NODE_REDIR_IN 
NODE_REDIR_OUT 
NODE_REDIR_APPEND 
NODE_REDIR_HEREDOC 
NODE_AND 
NODE_OR 
NODE_SUBSHELL 

Definition at line 50 of file structs.h.

◆ t_syntax_error

Syntax error codes (for parser)

Enumerator
ERR_NONE 
ERR_EMPTY_INPUT 
ERR_PIPE_START 
ERR_PIPE_END 
ERR_PIPE_DOUBLE 
ERR_PIPE_NO_CMD 
ERR_REDIR_NO_FILE 
ERR_REDIR_AFTER_PIPE 
ERR_AND_UNEXPECTED 
ERR_OR_UNEXPECTED 
ERR_PAREN_OPEN 
ERR_PAREN_CLOSE 
ERR_PAREN_EMPTY 
ERR_UNEXPECTED_LPAREN 

Definition at line 183 of file structs.h.

Go to the source code of this file.