Rizin
unix-like reverse engineering framework and cli tools
parser.h File Reference
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>

Go to the source code of this file.

Classes

struct  TSFieldMapEntry
 
struct  TSFieldMapSlice
 
struct  TSSymbolMetadata
 
struct  TSLexer
 
union  TSParseAction
 
struct  TSLexMode
 
union  TSParseActionEntry
 
struct  TSLanguage
 

Macros

#define ts_builtin_sym_error   ((TSSymbol)-1)
 
#define ts_builtin_sym_end   0
 
#define TREE_SITTER_SERIALIZATION_BUFFER_SIZE   1024
 
#define START_LEXER()
 
#define ADVANCE(state_value)
 
#define SKIP(state_value)
 
#define ACCEPT_TOKEN(symbol_value)
 
#define END_STATE()   return result;
 
#define SMALL_STATE(id)   id - LARGE_STATE_COUNT
 
#define STATE(id)   id
 
#define ACTIONS(id)   id
 
#define SHIFT(state_value)
 
#define SHIFT_REPEAT(state_value)
 
#define SHIFT_EXTRA()
 
#define REDUCE(symbol_val, child_count_val, ...)
 
#define RECOVER()
 
#define ACCEPT_INPUT()
 

Typedefs

typedef uint16_t TSStateId
 
typedef uint16_t TSSymbol
 
typedef uint16_t TSFieldId
 
typedef struct TSLanguage TSLanguage
 
typedef struct TSLexer TSLexer
 

Enumerations

enum  TSParseActionType {
  TSParseActionTypeShift , TSParseActionTypeReduce , TSParseActionTypeAccept , TSParseActionTypeRecover ,
  TSParseActionTypeShift , TSParseActionTypeReduce , TSParseActionTypeAccept , TSParseActionTypeRecover ,
  TSParseActionTypeShift , TSParseActionTypeReduce , TSParseActionTypeAccept , TSParseActionTypeRecover
}
 

Macro Definition Documentation

◆ ACCEPT_INPUT

#define ACCEPT_INPUT ( )
Value:
{{ \
}}
@ TSParseActionTypeAccept
Definition: parser.h:56

Definition at line 215 of file parser.h.

◆ ACCEPT_TOKEN

#define ACCEPT_TOKEN (   symbol_value)
Value:
result = true; \
lexer->result_symbol = symbol_value; \
lexer->mark_end(lexer);

Definition at line 158 of file parser.h.

◆ ACTIONS

#define ACTIONS (   id)    id

Definition at line 173 of file parser.h.

◆ ADVANCE

#define ADVANCE (   state_value)
Value:
{ \
state = state_value; \
goto next_state; \
}

Definition at line 145 of file parser.h.

◆ END_STATE

#define END_STATE ( )    return result;

Definition at line 163 of file parser.h.

◆ RECOVER

#define RECOVER ( )
Value:
{{ \
}}
@ TSParseActionTypeRecover
Definition: parser.h:57

Definition at line 210 of file parser.h.

◆ REDUCE

#define REDUCE (   symbol_val,
  child_count_val,
  ... 
)
Value:
{{ \
.reduce = { \
.symbol = symbol_val, \
.child_count = child_count_val, \
__VA_ARGS__ \
}, \
}}
@ TSParseActionTypeReduce
Definition: parser.h:55

Definition at line 200 of file parser.h.

◆ SHIFT

#define SHIFT (   state_value)
Value:
{{ \
.shift = { \
.state = state_value \
} \
}}
@ TSParseActionTypeShift
Definition: parser.h:54

Definition at line 175 of file parser.h.

◆ SHIFT_EXTRA

#define SHIFT_EXTRA ( )
Value:
{{ \
.shift = { \
.extra = true \
} \
}}

Definition at line 192 of file parser.h.

◆ SHIFT_REPEAT

#define SHIFT_REPEAT (   state_value)
Value:
{{ \
.shift = { \
.state = state_value, \
.repetition = true \
} \
}}

Definition at line 183 of file parser.h.

◆ SKIP

#define SKIP (   state_value)
Value:
{ \
skip = true; \
state = state_value; \
goto next_state; \
}

Definition at line 151 of file parser.h.

◆ SMALL_STATE

#define SMALL_STATE (   id)    id - LARGE_STATE_COUNT

Definition at line 169 of file parser.h.

◆ START_LEXER

#define START_LEXER ( )
Value:
bool result = false; \
bool skip = false; \
bool eof = false; \
int32_t lookahead; \
goto start; \
next_state: \
lexer->advance(lexer, skip); \
start: \
skip = false; \
lookahead = lexer->lookahead;
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len static semflg const void static shmflg const struct timespec struct timespec static rem const char static group const void start
Definition: sflib.h:133
void skip(file *in, unsigned n)
Definition: gzappend.c:202

Definition at line 133 of file parser.h.

◆ STATE

#define STATE (   id)    id

Definition at line 171 of file parser.h.

◆ TREE_SITTER_SERIALIZATION_BUFFER_SIZE

#define TREE_SITTER_SERIALIZATION_BUFFER_SIZE   1024

Definition at line 14 of file parser.h.

◆ ts_builtin_sym_end

#define ts_builtin_sym_end   0

Definition at line 13 of file parser.h.

◆ ts_builtin_sym_error

#define ts_builtin_sym_error   ((TSSymbol)-1)

Definition at line 12 of file parser.h.

Typedef Documentation

◆ TSFieldId

Definition at line 20 of file parser.h.

◆ TSLanguage

typedef struct TSLanguage TSLanguage

Definition at line 20 of file parser.h.

◆ TSLexer

typedef struct TSLexer TSLexer

Definition at line 20 of file parser.h.

◆ TSStateId

Definition at line 16 of file parser.h.

◆ TSSymbol

typedef uint16_t TSSymbol

Definition at line 19 of file parser.h.

Enumeration Type Documentation

◆ TSParseActionType

Enumerator
TSParseActionTypeShift 
TSParseActionTypeReduce 
TSParseActionTypeAccept 
TSParseActionTypeRecover 
TSParseActionTypeShift 
TSParseActionTypeReduce 
TSParseActionTypeAccept 
TSParseActionTypeRecover 
TSParseActionTypeShift 
TSParseActionTypeReduce 
TSParseActionTypeAccept 
TSParseActionTypeRecover 

Definition at line 53 of file parser.h.