Advertisement
Guest User

Untitled

a guest
Mar 30th, 2011
985
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.77 KB | None | 0 0
  1. typedef struct  s_list          t_list;
  2. typedef struct  s_token         t_token;
  3.  
  4. struct          s_list
  5. {
  6.   void          *data;
  7.   t_list        *prev;
  8.   t_list        *next;
  9. };
  10.  
  11. typedef enum    e_token_type
  12.   {
  13.     TOKEN_NEWLINE,
  14.     TOKEN_EOF,
  15.     TOKEN_PAR_OPEN,
  16.     TOKEN_PAR_CLOSE,
  17.     TOKEN_IF_AND,
  18.     TOKEN_IF_OR,
  19.     TOKEN_SEMICOLON,
  20.     TOKEN_PIPE
  21.   }             t_token_type;
  22.  
  23. struct          s_token
  24. {
  25.   t_token_type  type;
  26.   char          *data;
  27. };
  28.  
  29.  
  30. const t_token   operators[] =
  31.   {
  32.     { TOKEN_NEWLINE, "\n" },
  33.     { TOKEN_EOF, "\0" },
  34.     { TOKEN_PAR_OPEN, "(" },
  35.     { TOKEN_PAR_CLOSE, ")" },
  36.     { TOKEN_IF_AND, "&&" },
  37.     { TOKEN_IF_OR, "||" },
  38.     { TOKEN_SEMICOLON, ";" },
  39.     { TOKEN_PIPE , "|" },
  40.     { 0, NULL }
  41.   };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement