assignment 1

This commit is contained in:
djaidjai committed 2024-02-16 15:34:28 +01:00
commit 00d7dcfa88
13 files changed
+1179

No files matched your search

+37
View File
@@ -0,0 +1,37 @@
#ifndef SCANNER_H
#define SCANNER_H
#define INITIAL_STRING_SIZE 10
// This enum denotes what type of variable a token is.
enum Type {
EXECUTABLE, // a command in either $CWD or $PATH
OPTION, // any options to pass to an executable or builtin
COMPOSITION, // '&&', '||', ';', '\n'
BUILTIN, // one of a few pre-defined builtin executables
PIPELINE, // '|'
REDIRECT, // '<' or '>'
BACKGROUND, // '&'
FILENAME // a file (for redirection)
};
typedef struct ListNode *List;
typedef struct ListNode {
char *t;
enum Type type;
List next;
} ListNode;
char *readInputLine();
List getTokenList(char *s);
bool isEmpty(List l);
void printList(List l);
void freeTokenList(List l);
#endif
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.