Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am having trouble, understanding how the parser is using the current_token, to start testing the grammar.
I don't know if I am using the current_token right in parse and match, and if it's just that i am not having it print right. Or if its not set up right to test the grammar.
Any help would be appreciated.

Since the project is kinda large i have the git site right here to my code.
GitHub - lordravenlee/compiler[^]

What I have tried:

I have tried switching it many ways but I must be missing something.
Posted
Updated 30-May-20 23:23pm
v3
Comments
Richard MacCutchan 31-May-20 4:27am    
Sorry, no one is going to download your project and debug it for you. Please edit your question (Please use the Improve question link above), post the code that has the problem, and explain exactly where the problem occurs.

1 solution

Best is to use the strtok of th C library after reading the documentation. It needs some starting token and than returns following founds.
 
Share this answer
 
Comments
Rick York 31-May-20 11:50am    
I use it (strtok) all the time. One must remember it is a destructive parsing function because it will nullify all delimiters it finds. One can achieve similar results, non-destructively, using strcspn in a loop. I suspect strtok was written using strcspn.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900