matio wrote:
> Also how would you use code like this:
> 
> def t_ccode_lbrace(t):
>     r'\{'
>     t.lexer.level +=1
> 
> def t_ccode_rbrace(t):
>     r'\}'
>     t.lexer.level -=1

It is for counting curly brace levels.

> to implement an 'if', do you have to use 'ast' like in GardenSnake

Please do not assume we know anything but PLY.

I have no idea what you mean with the above question. This is a PLY mailing 
list, not a GardenSnake mailing list. Also, I fail to see any relation between 
the lexer functions and your question.

(The lexer functions of your question are nearly the first thing in a parser, 
and an ast is about the last thing in the parser. In between are at least 2 or 
3 other steps that you don't mention at all. Therefore, I cannot make a 
relation between the code and your question.)




In general, if you want useful answers, plz give a concrete coherent concise 
problem description, instead of a random piece of code and a (in my view) 
unrelated random question without any context. Also show what you have done so 
far with respect to that problem.
In addition, a title "Why doesn't this work" is too generic. Please use a more 
specific title, and change the title of the post when you change the subject.
Many readers will decide whether or not read a post based on the title alone.

 From your previous posts I believe that you have little Python experience. 
That is not a problem in itself, but asking basic Python questions here is not 
the most effective way of learning the language. Instead, I'd like to 
recommend you read a few tutorials, and/or subscribe the python-tutor mailing 
list.

To a lesser extent, that also holds for asking basic parsing questions here. 
Your question above seems to indicate (to me) a lack of understanding basic 
parsing terminology. Please make sure you understand what those terms mean and 
how they are related when using them, otherwise they will only confuse the 
discussion.

Sincerely,
Albert

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"ply-hack" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/ply-hack?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to