Posts

Showing posts from May, 2022

Expression storage complete

/****************************************************************************** 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*)...

Expression storage with corner conditions

/****************************************************************************** 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 Storage with Normal structure array as priority queue

 /****************************************************************************** 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 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));   ...

Expression storage

/****************************************************************************** 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 <string.h> #define OPERAND 255 #define OPERATOR -255 enum Priority   {     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 = sym;     symtbl[max_sym].type = typ;     symtbl[max_sym].value = val;     max_sym++; } in...