Archeus 0.0.0
A C library and game engine that focuses on documentation
Loading...
Searching...
No Matches
parserlang.h
Go to the documentation of this file.
1#ifndef ARC_STD_PARSER_PARSERLANG_H_
2#define ARC_STD_PARSER_PARSERLANG_H_
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8#include "arc/std/parser.h"
9
10/*
11<line> -> <body> NEWLINE <line> | <body> | NEWLINE <line> | LAMBDA
12<body> -> <tag> <whitespace> ARROW <whitespace> <arguments>
13
14<arguments> -> <argument> <whitespace> OR <whitespace> <arguments> | <argument>
15<argument> -> <tagOrConstant> <whitespace> <argument> | <tagOrConstant>
16<tagOrConstant> -> <tag> | <constant>
17
18<constant> -> ALPHA_UPPER_CHAR <constantBody>
19<constantBody> -> <constantChar> <constantBody> | LAMBDA
20<constantChar> -> ALPHA_UPPER_CHAR | UNDERSCORE
21
22<tag> -> LESS_THAN <variable> GREATER_THAN
23<variable> -> <alphaChar> <variableBody> | UNDERSCORE <variableBody>
24<variableBody> -> <variableChar> <variableBody> | LAMBDA
25<variableChar> -> <alphaChar> | NUMBER | UNDERSCORE
26<alphaChar> -> ALPHA_LOWER_CHAR | ALPHA_UPPER_CHAR
27
28<whitespace> -> WHITESPACE <whitespace> | WHITESPACE
29*/
30
31/**
32 * @brief creates a parser for the Parser Lang
33 *
34 * @note the rules will be inited for the parser lang
35 * @note the parsed data will be saved as a vector of ARC_ParserLanguageTag
36 *
37 * @param[out] parser the parser to create
38*/
40
41#define ARC_PARSERLANG_TOKEN_NULL 0
42#define ARC_PARSERLANG_TOKEN_NUMBER 1
43#define ARC_PARSERLANG_TOKEN_ALPHA_LOWER_CHAR 2
44#define ARC_PARSERLANG_TOKEN_ALPHA_UPPER_CHAR 3
45#define ARC_PARSERLANG_TOKEN_WHITESPACE 4
46
47#define ARC_PARSERLANG_TOKEN_NEWLINE_ID 5
48#define ARC_PARSERLANG_TOKEN_NEWLINE_CHAR '\n'
49#define ARC_PARSERLANG_TOKEN_LESS_THAN_ID 6
50#define ARC_PARSERLANG_TOKEN_LESS_THAN_CHAR '<'
51#define ARC_PARSERLANG_TOKEN_GREATER_THAN_ID 7
52#define ARC_PARSERLANG_TOKEN_GREATER_THAN_CHAR '>'
53#define ARC_PARSERLANG_TOKEN_OR_ID 8
54#define ARC_PARSERLANG_TOKEN_OR_CHAR '|'
55#define ARC_PARSERLANG_TOKEN_UNDERSCORE_ID 9
56#define ARC_PARSERLANG_TOKEN_UNDERSCORE_CHAR '_'
57
58#define ARC_PARSERLANG_TOKEN_ARROW_ID 10
59#define ARC_PARSERLANG_TOKEN_ARROW_CSTRING "->"
60
61#define ARC_PARSERLANG_LAMBDA ARC_PARSER_TAG_LAMBDA
62#define ARC_PARSERLANG_LINE 11
63#define ARC_PARSERLANG_BODY 12
64#define ARC_PARSERLANG_ARGUMENTS 13
65#define ARC_PARSERLANG_ARGUMENT 14
66#define ARC_PARSERLANG_TAG_OR_CONSTANT 15
67#define ARC_PARSERLANG_CONSTANT 16
68#define ARC_PARSERLANG_CONSTANT_BODY 17
69#define ARC_PARSERLANG_CONSTANT_CHAR 18
70#define ARC_PARSERLANG_TAG 19
71#define ARC_PARSERLANG_VARIABLE 20
72#define ARC_PARSERLANG_VARIABLE_BODY 21
73#define ARC_PARSERLANG_VARIABLE_CHAR 22
74#define ARC_PARSERLANG_ALPHA_CHAR 23
75#define ARC_PARSERLANG_WHITESPACE 24
76
77#ifdef __cplusplus
78}
79#endif
80
81#endif //ARC_STD_PARSER_PARSERLANG_H_
uint32_t(* ARC_Parser_GetStringIdFn)(ARC_String *string)
TODO: write this.
Definition parser.h:52
struct ARC_Parser ARC_Parser
a parser type
Definition parser.h:16
void ARC_ParserLang_CreateAsParser(ARC_Parser **parser, ARC_Parser_GetStringIdFn getStringIdFn)
creates a parser for the Parser Lang