a bit more work on parser, pushing to work on it at school
This commit is contained in:
parent
24fd8d6b25
commit
7a3495f7ae
1 changed files with 12 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
|||
#include "arc/std/parser.h"
|
||||
#include "arc/std/errno.h"
|
||||
#include "arc/std/lexer.h"
|
||||
#include "arc/std/vector.h"
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
|
@ -45,7 +46,7 @@ void ARC_Parser_Destroy(ARC_Parser *parser){
|
|||
}
|
||||
|
||||
//private recusive function to parse a tag
|
||||
void ARC_Parser_ParseTag(ARC_Parser *parser, ARC_String *subdata, uint32_t tagId){
|
||||
void ARC_Parser_ParseTag(ARC_Parser *parser, uint32_t lexerIndex, uint32_t tagId){
|
||||
//get the current tag
|
||||
ARC_ParserLanguageTag *tag = NULL;
|
||||
for(uint32_t index = 0; index < parser->language.size; index++){
|
||||
|
|
@ -62,6 +63,16 @@ void ARC_Parser_ParseTag(ARC_Parser *parser, ARC_String *subdata, uint32_t tagId
|
|||
ARC_DEBUG_LOG_ERROR_WITH_VARIABLES("ARC_Parser_ParseTag(parser, subdata, tagId), could not find tag with id: %u", tagId);
|
||||
return;
|
||||
}
|
||||
|
||||
//loop through each or section of the tags and tokens
|
||||
for(uint32_t orIndex = 0; orIndex < tag->tokensOrTagsSize; orIndex++){
|
||||
//loop through each token or tag to check if the lexed data matches
|
||||
uint32_t lexerCheckIndex = lexerIndex;
|
||||
for(uint32_t tokenOrTagIndex = 1; tokenOrTagIndex < tag->tokensOrTags[orIndex][0] + 1; tokenOrTagIndex++){
|
||||
|
||||
}
|
||||
//
|
||||
}
|
||||
}
|
||||
|
||||
void ARC_Parser_Parse(ARC_Parser *parser, ARC_String *data){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue