Skip to content

Instantly share code, notes, and snippets.

@aziis98
Last active January 7, 2018 16:10
Show Gist options
  • Select an option

  • Save aziis98/678043c3cac413328c0b40cd9e957cf9 to your computer and use it in GitHub Desktop.

Select an option

Save aziis98/678043c3cac413328c0b40cd9e957cf9 to your computer and use it in GitHub Desktop.
#include "stdio.h"
typedef char *string;
typedef struct node {
void *value;
struct node *next;
} Element;
typedef Element *List;
typedef enum {
MlangType_Expression,
MlangType_Integer,
MlangType_Char,
MlangType_String,
MlangType_Symbol
} MlangType;
typedef struct {
String name;
Element *params;
} MlangExpression;
typedef struct {
MlangType type;
void * value;
} MlangValue;
void getline(string *s, int *size);
int main(void) {
while (1) {
string str;
int size;
printf(" > ");
getline(&str, &size);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment