Posts

Showing posts from June, 2022

Priority LinkedList

 /****************************************************************************** Welcome to GDB Online. GDB online is an online compiler and debugger tool for C, C++, Python, PHP, Ruby,  C#, OCaml, VB, Perl, Swift, Prolog, Javascript, Pascal, HTML, CSS, JS Code, Compile, Run and Debug online from anywhere in world. *******************************************************************************/ #include <stdio.h> #include <stdlib.h> typedef enum {     CHAR,     INT,     FLOAT,     STRING,     STRUCT } Prlist_t; struct PriorityList {     int priority;     Prlist_t type;     char size;     void *data;     struct PriorityList* next; }; typedef struct PriorityList prList; prList* prlist_insert(prList *tail,void *data, Prlist_t type, char size,int pr) {   if(tail == NULL) /* create head node and return it */   {       tail = (prList*) malloc(sizeo...

Expression resolution complete

  /******************************************************************************       Expression Resolver v1.0         Designed by Daipayan Bhowal        Using Priority linked list to solve expression evaluation  *******************************************************************************/ #include <stdio.h> #include <ctype.h> #include <stdlib.h> #include <string.h> #define OPERAND 255 #define OPERATOR -255 #define INT 33 #define INIT_PRIORITY -1 enum Priority   {     ZERO_OP,     SUB_OP,     ADD_OP,     DIV_OP,     MUL_OP,     LAST_OP }; struct Symbol {    char *symbol;    char type;    char *value; }; struct Symbol symtbl[256]; int max_sym=0; void Symbol_insert(char *sym,char typ,char *val) {     symtbl[max_sym].symbol =(char*) malloc(sizeof(char)*strlen(sym));     strncpy(s...

Expression resolver incomplete 2

 /****************************************************************************** Welcome to GDB Online. GDB online is an online compiler and debugger tool for C, C++, Python, PHP, Ruby, C#, VB, Perl, Swift, Prolog, Javascript, Pascal, HTML, CSS, JS Code, Compile, Run and Debug online from anywhere in world. *******************************************************************************/ #include <stdio.h> #include <ctype.h> #include <stdlib.h> #include <string.h> #define OPERAND 255 #define OPERATOR -255 #define INT 33 #define INIT_PRIORITY -1 enum Priority   {     ZERO_OP,     SUB_OP,     ADD_OP,     DIV_OP,     MUL_OP,     LAST_OP }; struct Symbol {    char *symbol;    char type;    char *value; }; struct Symbol symtbl[256]; int max_sym=0; void Symbol_insert(char *sym,char typ,char *val) {     symtbl[max_sym].symbol =(char*) malloc(sizeof(char)*str...

Expression resolver incomplete

/****************************************************************************** Welcome to GDB Online. GDB online is an online compiler and debugger tool for C, C++, Python, PHP, Ruby, C#, VB, Perl, Swift, Prolog, Javascript, Pascal, HTML, CSS, JS Code, Compile, Run and Debug online from anywhere in world. *******************************************************************************/ #include <stdio.h> #include <ctype.h> #include <stdlib.h> #include <string.h> #define OPERAND 255 #define OPERATOR -255 #define INT 33 #define INIT_PRIORITY -1 enum Priority   {     ZERO_OP,     SUB_OP,     ADD_OP,     DIV_OP,     MUL_OP,     LAST_OP }; struct Symbol {    char *symbol;    char type;    char *value; }; struct Symbol symtbl[256]; int max_sym=0; void Symbol_insert(char *sym,char typ,char *val) {     symtbl[max_sym].symbol =(char*) malloc(sizeof(char)*strlen(sy...