-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexpressionable.c
More file actions
28 lines (25 loc) · 1.36 KB
/
Copy pathexpressionable.c
File metadata and controls
28 lines (25 loc) · 1.36 KB
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
//
// Created by David Ensikat on 19/5/2023.
//
#include "compiler.h"
#include <stdlib.h>
/**
* Format: {operator1, operator2, operator3, NULL}
*/
struct expressionable_op_precedence_group op_precedence[TOTAL_OPERATOR_GROUPS] = {
{.operators={"++", "--", "()", "[]", "(", "[", ".", "->", NULL}, .associativity=ASSOCIATIVITY_LEFT_TO_RIGHT},
{.operators={"*", "/", "%", NULL}, .associativity=ASSOCIATIVITY_LEFT_TO_RIGHT},
{.operators={"+", "-", NULL}, .associativity=ASSOCIATIVITY_LEFT_TO_RIGHT},
{.operators={"<<", ">>", NULL}, .associativity=ASSOCIATIVITY_LEFT_TO_RIGHT},
{.operators={"<", "<=", ">", ">=", NULL}, .associativity=ASSOCIATIVITY_LEFT_TO_RIGHT},
{.operators={"==", "!=", NULL}, .associativity=ASSOCIATIVITY_LEFT_TO_RIGHT},
{.operators={"&", NULL}, .associativity=ASSOCIATIVITY_LEFT_TO_RIGHT},
{.operators={"^", NULL}, .associativity=ASSOCIATIVITY_LEFT_TO_RIGHT},
{.operators={"|", NULL}, .associativity=ASSOCIATIVITY_LEFT_TO_RIGHT},
{.operators={"&&", NULL}, .associativity=ASSOCIATIVITY_LEFT_TO_RIGHT},
{.operators={"||", NULL}, .associativity=ASSOCIATIVITY_LEFT_TO_RIGHT},
{.operators={"?", ":", NULL}, .associativity=ASSOCIATIVITY_RIGHT_TO_LEFT},
{.operators={"=", "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", "&=",
"^=", "|=", NULL}, .associativity=ASSOCIATIVITY_RIGHT_TO_LEFT},
{.operators={",", NULL}, .associativity=ASSOCIATIVITY_LEFT_TO_RIGHT}
};