Rizin
unix-like reverse engineering framework and cli tools
reduce_action.h
Go to the documentation of this file.
1 #ifndef TREE_SITTER_REDUCE_ACTION_H_
2 #define TREE_SITTER_REDUCE_ACTION_H_
3 
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7 
8 #include "./array.h"
9 #include "tree_sitter/api.h"
10 
11 typedef struct {
15  unsigned short production_id;
16 } ReduceAction;
17 
18 typedef Array(ReduceAction) ReduceActionSet;
19 
20 static inline void ts_reduce_action_set_add(ReduceActionSet *self,
21  ReduceAction new_action) {
22  for (uint32_t i = 0; i < self->size; i++) {
23  ReduceAction action = self->contents[i];
24  if (action.symbol == new_action.symbol && action.count == new_action.count)
25  return;
26  }
27  array_push(self, new_action);
28 }
29 
30 #ifdef __cplusplus
31 }
32 #endif
33 
34 #endif // TREE_SITTER_REDUCE_ACTION_H_
lzma_index ** i
Definition: index.h:629
#define array_push(self, element)
Definition: array.h:43
static void ts_reduce_action_set_add(ReduceActionSet *self, ReduceAction new_action)
Definition: reduce_action.h:20
typedef Array(ReduceAction) ReduceActionSet
uint16_t TSSymbol
Definition: parser.h:19
unsigned int uint32_t
Definition: sftypes.h:29
int dynamic_precedence
Definition: reduce_action.h:14
TSSymbol symbol
Definition: reduce_action.h:13
unsigned short production_id
Definition: reduce_action.h:15
uint32_t count
Definition: reduce_action.h:12