Loading...
Searching...
No Matches
parser.c File Reference
`#include "../test.h"`
`#include "arc/std/bool.h"`
`#include "arc/std/errno.h"`
`#include "arc/std/parser.h"`
`#include "arc/std/parser/helpers.h"`
`#include "arc/std/lexer.h"`
`#include "arc/std/vector.h"`
`#include <stddef.h>`
`#include <stdlib.h>`

Go to the source code of this file.

## Functions

void | TEST_ParserData_CreateStringFn (void **data, ARC_ParserTagToken *parsedData, void *userData)
void | TEST_ParserData_DestroyStringFn (void *data, ARC_Bool clear, void *userData)
void | TEST_Parser_InitLexerRulesFn (ARC_Lexer *lexer)
| ARC_TEST (Parser_Init)
| ARC_TEST (Parser_Basic_Parse)
| ARC_TEST (Parser_Basic_ParseError)
| ARC_TEST (Parser_Basic_GetParsedValue)
| ARC_TEST (Parser_ParserLang_BasicVector)
void | TEST_Parser_InitBasicLexerTokenRules (ARC_Lexer *lexer)
uint32_t | TEST_Parser_GetStringIdFn (ARC_String *string)
void | TEST_ParserData_CreateCharFn (void **data, ARC_ParserTagToken *parsedData, void *userData)
void | TEST_ParserData_DestroyCharFn (void *data, ARC_Bool clear, void *userData)
| ARC_TEST (Parser_Parser_BasicCreateWithStringTest)

## Variables

const uint32_t | TEST_PARSER_CHAR_OR_NUM = 23
const uint32_t | TEST_PARSER_VARIABLE_NAME = 24
const uint32_t | TEST_PARSER_VARIABLE = 25
const uint32_t | TEST_PARSER_ALPHA_LOWER_CHAR = 1
const uint32_t | TEST_PARSER_ALPHA_UPPER_CHAR = 2
const uint32_t | TEST_PARSER_ALPHA_CHAR = 3
uint32_t * | charOrNumTokens [] = { (uint32_t[]){ 1, ARC_LEXER_TOKEN_ALPHA_LOWER_CHAR }, (uint32_t[]){ 1, ARC_LEXER_TOKEN_NUMBER } }
uint32_t * | variableNameTags [] = { (uint32_t[]){ 2, TEST_PARSER_CHAR_OR_NUM, TEST_PARSER_VARIABLE_NAME }, (uint32_t[]){ 1, ARC_PARSER_TAG_LAMBDA } }
uint32_t * | variableTokensOrTags [] = { (uint32_t[]){ 2, ARC_LEXER_TOKEN_ALPHA_LOWER_CHAR, TEST_PARSER_VARIABLE_NAME } }
ARC_ParserTag | testTags [3]
ARC_Array | languageArray

## Function Documentation

## ARC_TEST() [1/6]

ARC_TEST | ( | Parser_Basic_GetParsedValue |  | ) |

Definition at line 167 of file parser.c.

{
ARC_Parser *parser;
ARC_ParserData_CreateFn createStringFn = TEST_ParserData_CreateStringFn;
ARC_ParserData_DestroyFn destroyStringFn = TEST_ParserData_DestroyStringFn;
ARC_Parser_Create(&parser, &languageArray, TEST_Parser_InitLexerRulesFn, &createStringFn, &destroyStringFn, NULL);
ARC_String *tempString;
/* ~ first test ~ */
ARC_String_CreateWithStrlen(&tempString, "myvar1");
//this destroys string, so no need for cleanup
ARC_Parser_Parse(parser, &tempString);
ARC_CHECK(arc_errno == 0);
ARC_String *checkValue = (ARC_String *)ARC_Parser_GetData(parser);
ARC_CHECK(ARC_String_EqualsCStringWithStrlen(checkValue, "myvar1"));
/* ~ cleanup ~ */
ARC_Parser_Destroy(parser);
}
arc_errno
int32_t arc_errno
Definition errno.c:5
ARC_ParserData_CreateFn
void(* ARC_ParserData_CreateFn)(void **data, ARC_ParserTagToken *parsedData, void *userData)
TODO: write this.
Definition parser.h:57
ARC_ParserData_DestroyFn
void(* ARC_ParserData_DestroyFn)(void *data, ARC_Bool clear, void *userData)
TODO: write this.
Definition parser.h:62
ARC_Parser_Create
void ARC_Parser_Create(ARC_Parser **parser, ARC_Array *language, ARC_Parser_InitLexerRulesFn initLexerRulesFn, ARC_ParserData_CreateFn *createDataFn, ARC_ParserData_DestroyFn *destroyDataFn, void *userData)
creates an ARC_Parser type
Definition parser.c:24
ARC_Parser_Parse
void ARC_Parser_Parse(ARC_Parser *parser, ARC_String **data)
Definition parser.c:297
ARC_Parser_Destroy
void ARC_Parser_Destroy(ARC_Parser *parser)
destroys an ARC_Parser type
Definition parser.c:127
ARC_Parser_GetData
void * ARC_Parser_GetData(ARC_Parser *parser)
Definition parser.c:368
ARC_String_CreateWithStrlen
void ARC_String_CreateWithStrlen(ARC_String **string, char *data)
creates ARC_String type with strinlen
Definition string.c:32
ARC_String_EqualsCStringWithStrlen
ARC_Bool ARC_String_EqualsCStringWithStrlen(ARC_String *string, const char *cstring)
check if ARC_String and cstring match
Definition string.c:171
ARC_Parser
Definition parser.c:12
ARC_String
substring position within a string
Definition string.h:14
ARC_CHECK
#define ARC_CHECK(TEST)
Definition test.h:33
TEST_Parser_InitLexerRulesFn
void TEST_Parser_InitLexerRulesFn(ARC_Lexer *lexer)
Definition parser.c:62
languageArray
ARC_Array languageArray
Definition parser.c:57
TEST_ParserData_DestroyStringFn
void TEST_ParserData_DestroyStringFn(void *data, ARC_Bool clear, void *userData)
Definition parser.c:25
TEST_ParserData_CreateStringFn
void TEST_ParserData_CreateStringFn(void **data, ARC_ParserTagToken *parsedData, void *userData)
Definition parser.c:19

References ARC_CHECK, arc_errno, ARC_Parser_Create(), ARC_Parser_Destroy(), ARC_Parser_GetData(), ARC_Parser_Parse(), ARC_String_CreateWithStrlen(), ARC_String_EqualsCStringWithStrlen(), languageArray, TEST_Parser_InitLexerRulesFn(), TEST_ParserData_CreateStringFn(), and TEST_ParserData_DestroyStringFn().

## ARC_TEST() [2/6]

ARC_TEST | ( | Parser_Basic_Parse |  | ) |

Definition at line 75 of file parser.c.

{
ARC_Parser *parser;
ARC_Parser_Create(&parser, &languageArray, TEST_Parser_InitLexerRulesFn, NULL, NULL, NULL);
ARC_String *tempString;
/* ~ first test ~ */
ARC_String_CreateWithStrlen(&tempString, "myvar1");
//this destroys string, so no need for cleanup
ARC_Parser_Parse(parser, &tempString);
ARC_CHECK(arc_errno == 0);
/* ~ second test ~ */
ARC_String_CreateWithStrlen(&tempString, "z1xwvq");
//this destroys string, so no need for cleanup
ARC_Parser_Parse(parser, &tempString);
ARC_CHECK(arc_errno == 0);
/* ~ third test ~ */
ARC_String_CreateWithStrlen(&tempString, "z1234");
//this destroys string, so no need for cleanup
ARC_Parser_Parse(parser, &tempString);
ARC_CHECK(arc_errno == 0);
/* ~ fourth test ~ */
ARC_String_CreateWithStrlen(&tempString, "aaaaa");
//this destroys string, so no need for cleanup
ARC_Parser_Parse(parser, &tempString);
ARC_CHECK(arc_errno == 0);
/* ~ cleanup ~ */
ARC_Parser_Destroy(parser);
}

References ARC_CHECK, arc_errno, ARC_Parser_Create(), ARC_Parser_Destroy(), ARC_Parser_Parse(), ARC_String_CreateWithStrlen(), languageArray, and TEST_Parser_InitLexerRulesFn().

## ARC_TEST() [3/6]

ARC_TEST | ( | Parser_Basic_ParseError |  | ) |

Definition at line 122 of file parser.c.

{
ARC_Parser *parser;
ARC_Parser_Create(&parser, &languageArray, TEST_Parser_InitLexerRulesFn, NULL, NULL, NULL);
ARC_String *tempString;
/* ~ first test ~ */
ARC_String_CreateWithStrlen(&tempString, "!myVar1");
//this destroys string, so no need for cleanup
ARC_Parser_Parse(parser, &tempString);
ARC_CHECK(arc_errno == ARC_ERRNO_DATA);
/* ~ second test ~ */
//check again with moved character
arc_errno = 0;
ARC_String_CreateWithStrlen(&tempString, "my!Var1");
//this destroys string, so no need for cleanup
ARC_Parser_Parse(parser, &tempString);
ARC_CHECK(arc_errno == ARC_ERRNO_DATA);
/* ~ third test ~ */
//check again with moved character
arc_errno = 0;
ARC_String_CreateWithStrlen(&tempString, "myVar1!");
//this destroys string, so no need for cleanup
ARC_Parser_Parse(parser, &tempString);
ARC_CHECK(arc_errno == ARC_ERRNO_DATA);
/* ~ cleanup ~ */
ARC_Parser_Destroy(parser);
//reset for next test
arc_errno = 0;
}
ARC_ERRNO_DATA
#define ARC_ERRNO_DATA
Definition errno.h:7

References ARC_CHECK, arc_errno, ARC_ERRNO_DATA, ARC_Parser_Create(), ARC_Parser_Destroy(), ARC_Parser_Parse(), ARC_String_CreateWithStrlen(), languageArray, and TEST_Parser_InitLexerRulesFn().

## ARC_TEST() [4/6]

ARC_TEST | ( | Parser_Init |  | ) |

Definition at line 66 of file parser.c.

{
ARC_Parser *parser;
ARC_Parser_Create(&parser, &languageArray, TEST_Parser_InitLexerRulesFn, NULL, NULL, NULL);
ARC_Parser_Destroy(parser);
ARC_CHECK(arc_errno == 0);
}

References ARC_CHECK, arc_errno, ARC_Parser_Create(), ARC_Parser_Destroy(), languageArray, and TEST_Parser_InitLexerRulesFn().

## ARC_TEST() [5/6]

ARC_TEST | ( | Parser_Parser_BasicCreateWithStringTest |  | ) |

Definition at line 266 of file parser.c.

{
ARC_Parser *parser;
/* ~ create the language ~ */
ARC_String *languageString;
ARC_String_CreateWithStrlen(&languageString, "<alphaChar> -> ALPHA_LOWER_CHAR | ALPHA_UPPER_CHAR\n");
ARC_ParserData_CreateFn createCharFn = TEST_ParserData_CreateCharFn;
ARC_ParserData_DestroyFn destroyCharFn = TEST_ParserData_DestroyCharFn;
ARC_Parser_CreateFromString(&parser, languageString, TEST_Parser_InitBasicLexerTokenRules, TEST_Parser_GetStringIdFn, &createCharFn, &destroyCharFn, NULL);
ARC_String_Destroy(languageString);
ARC_CHECK(arc_errno == 0);
/* ~ check if a can be parsed ~ */
ARC_String *tempString;
ARC_String_CreateWithStrlen(&tempString, "a");
ARC_Parser_Parse(parser, &tempString);
char *data = (char *)ARC_Parser_GetData(parser);
ARC_CHECK(*data == 'a');
ARC_Parser_ClearData(parser);
/* ~ check if Z can be parsed ~ */
ARC_String_CreateWithStrlen(&tempString, "Z");
ARC_Parser_Parse(parser, &tempString);
data = (char *)ARC_Parser_GetData(parser);
ARC_CHECK(*data == 'Z');
ARC_Parser_ClearData(parser);
/* ~ check if 8 errors ~ */
ARC_String_CreateWithStrlen(&tempString, "8");
ARC_Parser_Parse(parser, &tempString);
data = (char *)ARC_Parser_GetData(parser);
ARC_CHECK(arc_errno == ARC_ERRNO_DATA);
arc_errno = 0;
ARC_Parser_ClearData(parser);
//cleanup
ARC_Parser_Destroy(parser);
}
ARC_Parser_CreateFromString
void ARC_Parser_CreateFromString(ARC_Parser **parser, ARC_String *languageString, ARC_Parser_InitLexerRulesFn initLexerRulesFn, ARC_Parser_GetStringIdFn getStringIdFn, ARC_ParserData_CreateFn *createDataFn, ARC_ParserData_DestroyFn *destroyDataFn, void *userData)
creates an ARC_Parser type from a string
Definition parser.c:105
ARC_Parser_ClearData
void ARC_Parser_ClearData(ARC_Parser *parser)
Definition parser.c:358
ARC_String_Destroy
void ARC_String_Destroy(ARC_String *string)
destroys ARC_String type
Definition string.c:52
TEST_Parser_GetStringIdFn
uint32_t TEST_Parser_GetStringIdFn(ARC_String *string)
Definition parser.c:228
TEST_ParserData_CreateCharFn
void TEST_ParserData_CreateCharFn(void **data, ARC_ParserTagToken *parsedData, void *userData)
Definition parser.c:244
TEST_ParserData_DestroyCharFn
void TEST_ParserData_DestroyCharFn(void *data, ARC_Bool clear, void *userData)
Definition parser.c:258
TEST_Parser_InitBasicLexerTokenRules
void TEST_Parser_InitBasicLexerTokenRules(ARC_Lexer *lexer)
Definition parser.c:219

References ARC_CHECK, arc_errno, ARC_ERRNO_DATA, ARC_Parser_ClearData(), ARC_Parser_CreateFromString(), ARC_Parser_Destroy(), ARC_Parser_GetData(), ARC_Parser_Parse(), ARC_String_CreateWithStrlen(), ARC_String_Destroy(), TEST_Parser_GetStringIdFn(), TEST_Parser_InitBasicLexerTokenRules(), TEST_ParserData_CreateCharFn(), and TEST_ParserData_DestroyCharFn().

## ARC_TEST() [6/6]

ARC_TEST | ( | Parser_ParserLang_BasicVector |  | ) |

Definition at line 194 of file parser.c.

{
ARC_Vector *testLanguage;
ARC_Vector_Create(&testLanguage, NULL, NULL);
ARC_Vector_Add(testLanguage, testTags + 0);
ARC_Vector_Add(testLanguage, testTags + 1);
ARC_Vector_Add(testLanguage, testTags + 2);
ARC_Parser *parser;
ARC_Parser_CreateFromVector(&parser, testLanguage, TEST_Parser_InitLexerRulesFn, NULL, NULL, NULL);
ARC_String *tempString;
ARC_String_CreateWithStrlen(&tempString, "variablename");
//this destroys string, so no need for cleanup
ARC_Parser_Parse(parser, &tempString);
//cleanup
ARC_Parser_Destroy(parser);
ARC_Vector_Destroy(testLanguage);
ARC_CHECK(arc_errno == 0);
}
ARC_Parser_CreateFromVector
void ARC_Parser_CreateFromVector(ARC_Parser **parser, ARC_Vector *language, ARC_Parser_InitLexerRulesFn initLexerRulesFn, ARC_ParserData_CreateFn *createDataFn, ARC_ParserData_DestroyFn *destroyDataFn, void *userData)
creates an ARC_Parser type from an arc vector
Definition parser.c:85
ARC_Vector
a private dynamic array type
Definition vector.c:12
testTags
ARC_ParserTag testTags[3]
Definition parser.c:39
ARC_Vector_Add
void ARC_Vector_Add(ARC_Vector *vector, void *data)
adds an item to an ARC_Vector
Definition vector.c:70
ARC_Vector_Destroy
void ARC_Vector_Destroy(ARC_Vector *vector)
destroys an ARC_Vector
Definition vector.c:54
ARC_Vector_Create
void ARC_Vector_Create(ARC_Vector **vector, ARC_Vector_CompareDataFn *compareDataFn, ARC_Vector_DestroyDataFn *destroyDataFn)
creates an ARC_Vector which is an "expandable" array
Definition vector.c:31

References ARC_CHECK, arc_errno, ARC_Parser_CreateFromVector(), ARC_Parser_Destroy(), ARC_Parser_Parse(), ARC_String_CreateWithStrlen(), ARC_Vector_Add(), ARC_Vector_Create(), ARC_Vector_Destroy(), TEST_Parser_InitLexerRulesFn(), and testTags.

## TEST_Parser_GetStringIdFn()

uint32_t TEST_Parser_GetStringIdFn | ( | ARC_String * | string | ) |

Definition at line 228 of file parser.c.

{
if(ARC_String_EqualsCStringWithStrlen(string, "<alphaChar>")){
return TEST_PARSER_ALPHA_CHAR;
}
if(ARC_String_EqualsCStringWithStrlen(string, "ALPHA_LOWER_CHAR")){
return TEST_PARSER_ALPHA_LOWER_CHAR;
}
if(ARC_String_EqualsCStringWithStrlen(string, "ALPHA_UPPER_CHAR")){
return TEST_PARSER_ALPHA_UPPER_CHAR;
}
return ~(uint32_t)0;
}
TEST_PARSER_ALPHA_CHAR
const uint32_t TEST_PARSER_ALPHA_CHAR
Definition parser.c:17
TEST_PARSER_ALPHA_LOWER_CHAR
const uint32_t TEST_PARSER_ALPHA_LOWER_CHAR
Definition parser.c:15
TEST_PARSER_ALPHA_UPPER_CHAR
const uint32_t TEST_PARSER_ALPHA_UPPER_CHAR
Definition parser.c:16

References ARC_String_EqualsCStringWithStrlen(), TEST_PARSER_ALPHA_CHAR, TEST_PARSER_ALPHA_LOWER_CHAR, and TEST_PARSER_ALPHA_UPPER_CHAR.

Referenced by ARC_TEST().

## TEST_Parser_InitBasicLexerTokenRules()

void TEST_Parser_InitBasicLexerTokenRules | ( | ARC_Lexer * | lexer | ) |

Definition at line 219 of file parser.c.

{
//null
ARC_Lexer_RegisterTokenRule(lexer, ARC_LexerTokenRule_CreateAndReturnMatchCharRule(ARC_PARSER_TAG_LAMBDA, 0));
//alpha char
ARC_Lexer_RegisterTokenRule(lexer, ARC_LexerTokenRule_CreateAndReturnMatchCharOrBetween(TEST_PARSER_ALPHA_LOWER_CHAR, 'a', 'z'));
ARC_Lexer_RegisterTokenRule(lexer, ARC_LexerTokenRule_CreateAndReturnMatchCharOrBetween(TEST_PARSER_ALPHA_UPPER_CHAR, 'A', 'Z'));
}
ARC_Lexer_RegisterTokenRule
void ARC_Lexer_RegisterTokenRule(ARC_Lexer *lexer, ARC_LexerTokenRule tokenRule)
adds a token rule to a lexer
Definition lexer.c:79
ARC_LexerTokenRule_CreateAndReturnMatchCharRule
ARC_LexerTokenRule ARC_LexerTokenRule_CreateAndReturnMatchCharRule(uint32_t id, char character)
creates a ARC_LexerTokenRule with a given id and character
Definition lexer.c:378
ARC_LexerTokenRule_CreateAndReturnMatchCharOrBetween
ARC_LexerTokenRule ARC_LexerTokenRule_CreateAndReturnMatchCharOrBetween(uint32_t id, char start, char end)
creates a ARC_LexerTokenRule with a given id and character range
Definition lexer.c:400
ARC_PARSER_TAG_LAMBDA
#define ARC_PARSER_TAG_LAMBDA
basic tag for letting the parser know it is ok to end
Definition parser.h:150

References ARC_Lexer_RegisterTokenRule(), ARC_LexerTokenRule_CreateAndReturnMatchCharOrBetween(), ARC_LexerTokenRule_CreateAndReturnMatchCharRule(), ARC_PARSER_TAG_LAMBDA, TEST_PARSER_ALPHA_LOWER_CHAR, and TEST_PARSER_ALPHA_UPPER_CHAR.

Referenced by ARC_TEST().

## TEST_Parser_InitLexerRulesFn()

void TEST_Parser_InitLexerRulesFn | ( | ARC_Lexer * | lexer | ) |

Definition at line 62 of file parser.c.

{
ARC_Lexer_InitBasicTokenRules(lexer);
}
ARC_Lexer_InitBasicTokenRules
void ARC_Lexer_InitBasicTokenRules(ARC_Lexer *lexer)
adds a bunch of basic token rules (matching the BasicTokens above)
Definition lexer.c:472

References ARC_Lexer_InitBasicTokenRules().

Referenced by ARC_TEST(), ARC_TEST(), ARC_TEST(), ARC_TEST(), and ARC_TEST().

## TEST_ParserData_CreateCharFn()

void TEST_ParserData_CreateCharFn | ( | void ** | data,
|  | ARC_ParserTagToken * | parsedData,
|  | void * | userData )

Definition at line 244 of file parser.c.

{
if(parsedData == NULL){
*data = NULL;
return;
}
char *alphaChar = (char *)malloc(sizeof(char));
ARC_ParserTagToken *tagToken = (ARC_ParserTagToken *)ARC_Vector_Get(parsedData->tagTokens, 0);
*alphaChar = tagToken->token->data->data[0];
*data = (void *)alphaChar;
}
ARC_LexerToken::data
ARC_String * data
Definition lexer.h:20
ARC_ParserTagToken
a parser type used inside of the parser data create function
Definition parser.h:35
ARC_ParserTagToken::token
ARC_LexerToken * token
Definition parser.h:38
ARC_ParserTagToken::tagTokens
ARC_Vector * tagTokens
Definition parser.h:39
ARC_String::data
char * data
Definition string.h:15
ARC_Vector_Get
void * ARC_Vector_Get(ARC_Vector *vector, uint32_t index)
gets an item from an ARC_Vector at a position index
Definition vector.c:153

References ARC_Vector_Get(), ARC_LexerToken::data, ARC_String::data, ARC_ParserTagToken::tagTokens, and ARC_ParserTagToken::token.

Referenced by ARC_TEST().

## TEST_ParserData_CreateStringFn()

void TEST_ParserData_CreateStringFn | ( | void ** | data,
|  | ARC_ParserTagToken * | parsedData,
|  | void * | userData )

Definition at line 19 of file parser.c.

{
ARC_String_Create((ARC_String **)data, NULL, 0);
ARC_ParserData_HelperRecurseStringAdd((ARC_String **)data, parsedData);
}
ARC_ParserData_HelperRecurseStringAdd
void ARC_ParserData_HelperRecurseStringAdd(ARC_String **data, ARC_ParserTagToken *tagToken)
recurses through a tag token adding token strings to a main string
Definition helpers.c:4
ARC_String_Create
void ARC_String_Create(ARC_String **string, char *data, uint64_t length)
creates ARC_String type
Definition string.c:9

References ARC_ParserData_HelperRecurseStringAdd(), and ARC_String_Create().

Referenced by ARC_TEST().

## TEST_ParserData_DestroyCharFn()

void TEST_ParserData_DestroyCharFn | ( | void * | data,
|  | ARC_Bool | clear,
|  | void * | userData )

Definition at line 258 of file parser.c.

{
if(data == NULL){
return;
}
free((char *)data);
}

Referenced by ARC_TEST().

## TEST_ParserData_DestroyStringFn()

void TEST_ParserData_DestroyStringFn | ( | void * | data,
|  | ARC_Bool | clear,
|  | void * | userData )

Definition at line 25 of file parser.c.

{
if(data == NULL){
return;
}
ARC_String_Destroy((ARC_String *)data);
}

References ARC_String_Destroy().

Referenced by ARC_TEST().

## Variable Documentation

## charOrNumTokens

uint32_t* charOrNumTokens[] = { (uint32_t[]){ 1, ARC_LEXER_TOKEN_ALPHA_LOWER_CHAR }, (uint32_t[]){ 1, ARC_LEXER_TOKEN_NUMBER } }

Definition at line 33 of file parser.c.

{ (uint32_t[]){ 1, ARC_LEXER_TOKEN_ALPHA_LOWER_CHAR }, (uint32_t[]){ 1, ARC_LEXER_TOKEN_NUMBER } };
ARC_LEXER_TOKEN_ALPHA_LOWER_CHAR
#define ARC_LEXER_TOKEN_ALPHA_LOWER_CHAR
Definition lexer.h:250
ARC_LEXER_TOKEN_NUMBER
#define ARC_LEXER_TOKEN_NUMBER
Definition lexer.h:249

## languageArray

ARC_Array languageArray

Initial value:
= {
3,
testTags
}

Definition at line 57 of file parser.c.

{
3, //size
testTags //data
};

Referenced by ARC_Parser_CreateFromVector(), ARC_TEST(), ARC_TEST(), ARC_TEST(), and ARC_TEST().

## TEST_PARSER_ALPHA_CHAR

const uint32_t TEST_PARSER_ALPHA_CHAR = 3

Definition at line 17 of file parser.c.

Referenced by TEST_Parser_GetStringIdFn().

## TEST_PARSER_ALPHA_LOWER_CHAR

const uint32_t TEST_PARSER_ALPHA_LOWER_CHAR = 1

Definition at line 15 of file parser.c.

Referenced by TEST_Parser_GetStringIdFn(), and TEST_Parser_InitBasicLexerTokenRules().

## TEST_PARSER_ALPHA_UPPER_CHAR

const uint32_t TEST_PARSER_ALPHA_UPPER_CHAR = 2

Definition at line 16 of file parser.c.

Referenced by TEST_Parser_GetStringIdFn(), and TEST_Parser_InitBasicLexerTokenRules().

## TEST_PARSER_CHAR_OR_NUM

const uint32_t TEST_PARSER_CHAR_OR_NUM = 23

Definition at line 11 of file parser.c.

## TEST_PARSER_VARIABLE

const uint32_t TEST_PARSER_VARIABLE = 25

Definition at line 13 of file parser.c.

## TEST_PARSER_VARIABLE_NAME

const uint32_t TEST_PARSER_VARIABLE_NAME = 24

Definition at line 12 of file parser.c.

## testTags

ARC_ParserTag testTags[3]

Initial value:
= {
{
TEST_PARSER_VARIABLE,
variableTokensOrTags,
1
},
{
TEST_PARSER_VARIABLE_NAME,
variableNameTags,
2
},
{
TEST_PARSER_CHAR_OR_NUM,
charOrNumTokens,
2
}
}
TEST_PARSER_VARIABLE_NAME
const uint32_t TEST_PARSER_VARIABLE_NAME
Definition parser.c:12
variableTokensOrTags
uint32_t * variableTokensOrTags[]
Definition parser.c:35
TEST_PARSER_VARIABLE
const uint32_t TEST_PARSER_VARIABLE
Definition parser.c:13
variableNameTags
uint32_t * variableNameTags[]
Definition parser.c:34
charOrNumTokens
uint32_t * charOrNumTokens[]
Definition parser.c:33
TEST_PARSER_CHAR_OR_NUM
const uint32_t TEST_PARSER_CHAR_OR_NUM
Definition parser.c:11

Definition at line 39 of file parser.c.

{
{
TEST_PARSER_VARIABLE, //tagId
variableTokensOrTags, //tokensOrTags
1 //tokenOrTagsSize
},
{
TEST_PARSER_VARIABLE_NAME, //tagId
variableNameTags, //tokensOrTags
2 //tokenOrTagsSize
},
{
TEST_PARSER_CHAR_OR_NUM, //tagId
charOrNumTokens, //tokensOrTags
2 //tokenOrTagsSize
}
};

Referenced by ARC_TEST().

## variableNameTags

uint32_t* variableNameTags[] = { (uint32_t[]){ 2, TEST_PARSER_CHAR_OR_NUM, TEST_PARSER_VARIABLE_NAME }, (uint32_t[]){ 1, ARC_PARSER_TAG_LAMBDA } }

Definition at line 34 of file parser.c.

{ (uint32_t[]){ 2, TEST_PARSER_CHAR_OR_NUM, TEST_PARSER_VARIABLE_NAME }, (uint32_t[]){ 1, ARC_PARSER_TAG_LAMBDA } };

## variableTokensOrTags

uint32_t* variableTokensOrTags[] = { (uint32_t[]){ 2, ARC_LEXER_TOKEN_ALPHA_LOWER_CHAR, TEST_PARSER_VARIABLE_NAME } }

Definition at line 35 of file parser.c.

{ (uint32_t[]){ 2, ARC_LEXER_TOKEN_ALPHA_LOWER_CHAR, TEST_PARSER_VARIABLE_NAME } };