-
Notifications
You must be signed in to change notification settings - Fork 0
/
helpers.h
31 lines (20 loc) · 1.09 KB
/
helpers.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include "token.h"
#ifndef ADVCALC_INTERPRETER_HELPERS_H
#define ADVCALC_INTERPRETER_HELPERS_H
// Function that slices a string and copies it to destination starting at start(inclusive), ending at end(exclusive).
void sliceString(char *string, char *destination, int start, int end);
// counts how many parentheses are (output: 1 is error / 0 is no error)
int parCheck(Token tokens[], int size);
// counts how many same type tokens are
int tokenTypeCounter(TokenType type, Token tokens[], int size);
// there is at least one sequential
int isSeqArr(Token tokens[], int size, TokenType tokenTypes1[], int size1, TokenType tokenTypes2[], int size2);
int isSeq(Token tokens[], int size, TokenType tokenType1, TokenType tokenType2);
// there is at least one not sequential
int isNotSeqArr(Token tokens[], int size, TokenType tokenTypes1[], int size1, TokenType tokenTypes2[], int size2);
int isNotSeq(Token tokens[], int size, TokenType tokenType1, TokenType tokenType2);
int intToBinary(int dec);
int binToInt(int bin);
int loggg(int num);
int twoArgFunc(Token tokens[], int size, int startIndex);
#endif