Top down parsing

Feb 7, 2013 at 7:52 AM
Hi,

I'm trying to create a grammer using Irony and it work nice. But i had a problem:
So my grammer is like c# code and here is an example of how to use it.
int x=5;
print x;
=> result 5

That's ok but the parsing is down Top so i had an error of parsing saying that "x" is not declared but the evaluation is great.

Is there any way to inverse Parsing?

Thanks a lot.
Coordinator
Feb 7, 2013 at 8:19 PM
honestly I don't understand a word you're saying. evaluation succeeds, but error in parsing? 'x is not declared' does not seem like a parser error, more like interpreter error... what do you mean by 'inverse parsing'?
Feb 8, 2013 at 6:56 AM
Hi,

well the init function is called from the last node to the first. what i need to do is to call this function starting from the first Node going to the last.
Not childre first.

Thanks.
Coordinator
Feb 10, 2013 at 2:51 PM
if you're trying to do variable allocation/scoping analysis, then Init method is wrong place to do it. It should be in a separate run/iteration over the AST tree
So the ordering in Init should not matter
Roman