Re: Weird Rule Matching

2022-04-07 Thread tom2
Thanks for the reply Chris. The full definition for my conditional rule is: conditional:     IF comparison '{' END program '}' END { F_CONDITIONAL_BLOCK -= 1; std::cout << line_num << " F_CONDITIONAL_BLOCK: " << F_CONDITIONAL_BLOCK << std::endl;         if (F_CONDITIONAL_BLOCK > 0) { F_CONDITI

Re: Weird Rule Matching

2022-04-07 Thread Hans Åberg
> On 7 Apr 2022, at 10:14, tom2 wrote: > > It does actually cause an issue because I am rely on the idea that the rule > will be matched before the next if token is found, in order to have nested > conditionals. Typically, one build an AST (abstract syntax/semantic tree) that can be execute

Re: Weird Rule Matching

2022-04-07 Thread tom2
I have heard of an AST, and, against my better judgement, thought they were to complex for my needs and decided to represent the instructions as one long list, that gets edited by loops/conditionals. I see the error of my ways now, but I am too close to the deadline of this project for me to g

Re: Weird Rule Matching

2022-04-07 Thread Hans Åberg
> On 7 Apr 2022, at 12:00, tom2 wrote: > > I have heard of an AST, and, against my better judgement, thought they were > to complex for my needs and decided to represent the instructions as one long > list, that gets edited by loops/conditionals. > > I see the error of my ways now, but I am

Re: [Suspected Spam] Weird Rule Matching

2022-04-07 Thread Hans Åberg
> On 7 Apr 2022, at 16:35, Tom Flux wrote: > > Thanks a lot for the example, that's pretty close to how I modeled my > instructions, I think I'm am just storing them slightly weirdly. > > Think I am finally getting the hang of it... :) Make sure to post replies to the list so that others can