parser mostly fixed, still needs a lot more testing though, and need to store parsed values in a datatype

This commit is contained in:
herbglitch 2024-11-01 04:39:45 -06:00
parent 963b99c6bd
commit 006b4c63f7
5 changed files with 49 additions and 13 deletions

View file

@ -257,6 +257,13 @@ void ARC_Lexer_LexFile(ARC_Lexer *lexer, ARC_String *path){
}
}
void ARC_Lexer_PrintTokenRules(ARC_Lexer *lexer){
for(uint32_t index = 0; index < ARC_Vector_GetSize(lexer->tokenRules); index++){
ARC_LexerTokenRule *tokenRule = ARC_Vector_Get(lexer->tokenRules, index);
printf("Rule: %02i\tFunction: %p\n", tokenRule->id, tokenRule->automataFn);
}
}
ARC_LexerToken ARC_Lexer_GetToken(ARC_Lexer *lexer, uint32_t index){
//get the token and log if there is an error
ARC_LexerToken *token = ARC_Vector_Get(lexer->tokens, index);