libmya
0.1.0
Library to parse Mya language.
Loading...
Searching...
No Matches
src
globals.c
Go to the documentation of this file.
1
#include <stdlib.h>
2
3
#include "
types/ast.h
"
4
#include "
types/keywords.h
"
5
#include "
types/operators.h
"
6
#include "
version.h
"
7
8
const
char
*
mya_version
=
VERSION
;
9
10
const
char
*
mya_keywords
[] = {
11
[
KEY_BITFIELD
] =
"bitfield"
,
12
// clang-format hates me.
13
[
KEY_IMMEDIATE
] =
"immediate"
,
14
[
KEY_INCLUDE
] =
"include"
,
15
[
KEY_INST
] =
"inst"
,
16
[
KEY_REGISTER
] =
"register"
,
17
[
KEY_SET
] =
"set"
,
18
NULL,
19
};
20
21
const
char
*
mya_operators
[] = {
22
[
OP_AND
] =
"&"
,
23
// clang-format hates me.
24
[
OP_DIV
] =
"/"
,
25
[
OP_MINUS
] =
"-"
,
26
[
OP_MULT
] =
"*"
,
27
[
OP_NOT
] =
"~"
,
28
[
OP_OR
] =
"|"
,
29
[
OP_PLUS
] =
"+"
,
30
[
OP_SHIFT_LEFT
] =
"<<"
,
31
[
OP_SHIFT_RIGHT
] =
">>"
,
32
[
OP_XOR
] =
"^"
,
33
NULL,
34
};
35
36
const
char
*
mya_token_types
[] = {
37
[
TK_CLOSE_BRACES
] =
"close_braces"
,
38
// clang-format hates me.
39
[
TK_CLOSE_BRACKET
] =
"close_bracket"
,
40
[
TK_CLOSE_PARENS
] =
"close_parentheses"
,
41
[
TK_COLON
] =
"colon"
,
42
[
TK_COMMA
] =
"comma"
,
43
[
TK_EOF
] =
"end_of_file"
,
44
[
TK_EQUAL
] =
"equal"
,
45
[
TK_IDENTIFIER
] =
"identifier"
,
46
[
TK_KEYWORD
] =
"keyword"
,
47
[
TK_NUMBER
] =
"number"
,
48
[
TK_OPEN_BRACES
] =
"open_braces"
,
49
[
TK_OPEN_BRACKET
] =
"open_bracket"
,
50
[
TK_OPEN_PARENS
] =
"open_parentheses"
,
51
[
TK_OPERATOR
] =
"operator"
,
52
[
TK_SEMICOLON
] =
"semicolon"
,
53
[
TK_STRING
] =
"string"
,
54
NULL,
55
};
56
57
const
char
*
mya_node_types
[] = {
58
[
NT_ARG_LIST
] =
"argument_list"
,
59
// clang-format hates me.
60
[
NT_BITFIELD_BODY
] =
"bitfield_body"
,
61
[
NT_EXPRESSION
] =
"expression"
,
62
[
NT_IDENTIFIER
] =
"identifier"
,
63
[
NT_INST_BODY
] =
"inst_body"
,
64
[
NT_ROOT
] =
"root"
,
65
[
NT_SIZE_SPEC
] =
"size_spec"
,
66
[
NT_STATEMENT
] =
"statement"
,
67
[
NT_STRING
] =
"string"
,
68
[
NT_TYPE
] =
"type_name"
,
69
NULL,
70
};
mya_version
const char * mya_version
Definition
globals.c:8
mya_node_types
const char * mya_node_types[]
Definition
globals.c:57
mya_operators
const char * mya_operators[]
Definition
globals.c:21
mya_token_types
const char * mya_token_types[]
Definition
globals.c:36
mya_keywords
const char * mya_keywords[]
Definition
globals.c:10
keywords.h
KEY_INST
@ KEY_INST
Definition
keywords.h:8
KEY_IMMEDIATE
@ KEY_IMMEDIATE
Definition
keywords.h:6
KEY_SET
@ KEY_SET
Definition
keywords.h:10
KEY_BITFIELD
@ KEY_BITFIELD
Definition
keywords.h:5
KEY_REGISTER
@ KEY_REGISTER
Definition
keywords.h:9
KEY_INCLUDE
@ KEY_INCLUDE
Definition
keywords.h:7
operators.h
OP_SHIFT_LEFT
@ OP_SHIFT_LEFT
Definition
operators.h:12
OP_NOT
@ OP_NOT
Definition
operators.h:9
OP_SHIFT_RIGHT
@ OP_SHIFT_RIGHT
Definition
operators.h:13
OP_PLUS
@ OP_PLUS
Definition
operators.h:11
OP_DIV
@ OP_DIV
Definition
operators.h:6
OP_XOR
@ OP_XOR
Definition
operators.h:14
OP_MULT
@ OP_MULT
Definition
operators.h:8
OP_AND
@ OP_AND
Definition
operators.h:5
OP_MINUS
@ OP_MINUS
Definition
operators.h:7
OP_OR
@ OP_OR
Definition
operators.h:10
ast.h
NT_STRING
@ NT_STRING
Definition
ast.h:18
NT_TYPE
@ NT_TYPE
Definition
ast.h:19
NT_SIZE_SPEC
@ NT_SIZE_SPEC
Definition
ast.h:16
NT_INST_BODY
@ NT_INST_BODY
Definition
ast.h:14
NT_IDENTIFIER
@ NT_IDENTIFIER
Definition
ast.h:13
NT_STATEMENT
@ NT_STATEMENT
Definition
ast.h:17
NT_EXPRESSION
@ NT_EXPRESSION
Definition
ast.h:12
NT_ROOT
@ NT_ROOT
Definition
ast.h:15
NT_ARG_LIST
@ NT_ARG_LIST
Definition
ast.h:10
NT_BITFIELD_BODY
@ NT_BITFIELD_BODY
Definition
ast.h:11
TK_OPEN_BRACKET
@ TK_OPEN_BRACKET
Definition
token.h:21
TK_NUMBER
@ TK_NUMBER
Definition
token.h:19
TK_STRING
@ TK_STRING
Definition
token.h:25
TK_IDENTIFIER
@ TK_IDENTIFIER
Definition
token.h:17
TK_COLON
@ TK_COLON
Definition
token.h:13
TK_OPEN_BRACES
@ TK_OPEN_BRACES
Definition
token.h:20
TK_OPEN_PARENS
@ TK_OPEN_PARENS
Definition
token.h:22
TK_COMMA
@ TK_COMMA
Definition
token.h:14
TK_CLOSE_PARENS
@ TK_CLOSE_PARENS
Definition
token.h:12
TK_KEYWORD
@ TK_KEYWORD
Definition
token.h:18
TK_OPERATOR
@ TK_OPERATOR
Definition
token.h:23
TK_CLOSE_BRACKET
@ TK_CLOSE_BRACKET
Definition
token.h:11
TK_EOF
@ TK_EOF
Definition
token.h:15
TK_CLOSE_BRACES
@ TK_CLOSE_BRACES
Definition
token.h:10
TK_EQUAL
@ TK_EQUAL
Definition
token.h:16
TK_SEMICOLON
@ TK_SEMICOLON
Definition
token.h:24
version.h
VERSION
#define VERSION
Definition
version.h:3
Generated by
1.13.2