libmya 0.1.0
Library to parse Mya language.
Loading...
Searching...
No Matches
globals.c File Reference
#include <stdlib.h>
#include "types/ast.h"
#include "types/keywords.h"
#include "types/operators.h"
#include "version.h"
Include dependency graph for globals.c:

Go to the source code of this file.

Variables

const char * mya_version = VERSION
 
const char * mya_keywords []
 
const char * mya_operators []
 
const char * mya_token_types []
 
const char * mya_node_types []
 

Variable Documentation

◆ mya_keywords

const char* mya_keywords[]
Initial value:
= {
[KEY_BITFIELD] = "bitfield",
[KEY_IMMEDIATE] = "immediate",
[KEY_INCLUDE] = "include",
[KEY_INST] = "inst",
[KEY_REGISTER] = "register",
[KEY_SET] = "set",
NULL,
}
@ KEY_INST
Definition keywords.h:8
@ KEY_IMMEDIATE
Definition keywords.h:6
@ KEY_SET
Definition keywords.h:10
@ KEY_BITFIELD
Definition keywords.h:5
@ KEY_REGISTER
Definition keywords.h:9
@ KEY_INCLUDE
Definition keywords.h:7

Definition at line 10 of file globals.c.

10 {
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};

◆ mya_node_types

const char* mya_node_types[]
Initial value:
= {
[NT_ARG_LIST] = "argument_list",
[NT_BITFIELD_BODY] = "bitfield_body",
[NT_EXPRESSION] = "expression",
[NT_IDENTIFIER] = "identifier",
[NT_INST_BODY] = "inst_body",
[NT_ROOT] = "root",
[NT_SIZE_SPEC] = "size_spec",
[NT_STATEMENT] = "statement",
[NT_STRING] = "string",
[NT_TYPE] = "type_name",
NULL,
}
@ NT_STRING
Definition ast.h:18
@ NT_TYPE
Definition ast.h:19
@ NT_SIZE_SPEC
Definition ast.h:16
@ NT_INST_BODY
Definition ast.h:14
@ NT_IDENTIFIER
Definition ast.h:13
@ NT_STATEMENT
Definition ast.h:17
@ NT_EXPRESSION
Definition ast.h:12
@ NT_ROOT
Definition ast.h:15
@ NT_ARG_LIST
Definition ast.h:10
@ NT_BITFIELD_BODY
Definition ast.h:11

Definition at line 57 of file globals.c.

57 {
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_operators

const char* mya_operators[]
Initial value:
= {
[OP_AND] = "&",
[OP_DIV] = "/",
[OP_MINUS] = "-",
[OP_MULT] = "*",
[OP_NOT] = "~",
[OP_OR] = "|",
[OP_PLUS] = "+",
[OP_SHIFT_LEFT] = "<<",
[OP_SHIFT_RIGHT] = ">>",
[OP_XOR] = "^",
NULL,
}
@ OP_SHIFT_LEFT
Definition operators.h:12
@ OP_NOT
Definition operators.h:9
@ OP_SHIFT_RIGHT
Definition operators.h:13
@ OP_PLUS
Definition operators.h:11
@ OP_DIV
Definition operators.h:6
@ OP_XOR
Definition operators.h:14
@ OP_MULT
Definition operators.h:8
@ OP_AND
Definition operators.h:5
@ OP_MINUS
Definition operators.h:7
@ OP_OR
Definition operators.h:10

Definition at line 21 of file globals.c.

21 {
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};

◆ mya_token_types

const char* mya_token_types[]
Initial value:
= {
[TK_CLOSE_BRACES] = "close_braces",
[TK_CLOSE_BRACKET] = "close_bracket",
[TK_CLOSE_PARENS] = "close_parentheses",
[TK_COLON] = "colon",
[TK_COMMA] = "comma",
[TK_EOF] = "end_of_file",
[TK_EQUAL] = "equal",
[TK_IDENTIFIER] = "identifier",
[TK_KEYWORD] = "keyword",
[TK_NUMBER] = "number",
[TK_OPEN_BRACES] = "open_braces",
[TK_OPEN_BRACKET] = "open_bracket",
[TK_OPEN_PARENS] = "open_parentheses",
[TK_OPERATOR] = "operator",
[TK_SEMICOLON] = "semicolon",
[TK_STRING] = "string",
NULL,
}
@ TK_OPEN_BRACKET
Definition token.h:21
@ TK_NUMBER
Definition token.h:19
@ TK_STRING
Definition token.h:25
@ TK_IDENTIFIER
Definition token.h:17
@ TK_COLON
Definition token.h:13
@ TK_OPEN_BRACES
Definition token.h:20
@ TK_OPEN_PARENS
Definition token.h:22
@ TK_COMMA
Definition token.h:14
@ TK_CLOSE_PARENS
Definition token.h:12
@ TK_KEYWORD
Definition token.h:18
@ TK_OPERATOR
Definition token.h:23
@ TK_CLOSE_BRACKET
Definition token.h:11
@ TK_EOF
Definition token.h:15
@ TK_CLOSE_BRACES
Definition token.h:10
@ TK_EQUAL
Definition token.h:16
@ TK_SEMICOLON
Definition token.h:24

Definition at line 36 of file globals.c.

36 {
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};

◆ mya_version

const char* mya_version = VERSION

Definition at line 8 of file globals.c.