Im writing a grammar for a language that supports functions, and a few
different datatypes. It works fine,
however for the functions the default arguments can be specified in a
different file (xml). I'd like to parse just that argument using the
same parser. This 'argument' isn't valid standalone in my grammar
however.

I was trying to use the yacc.yacc(start='foo') functionality to
specify the starting symbol, and that works ok, but only if i manually
delete parsetab.py.

I think the issue has something to do with the signature that gets
written to parsetab.py. It doesn't take into account the starting
symbol it seems. That is, when i call yacc.yacc the code checks the
signature on parsetab.py and returns the parser right away before it
gets to the code that does something about the starting parse symbol.

(if i have 2 parsers, one with start=, and the other without, and i
delete parsetab.py at the start, the first start= will be used for
both i believe).

Is there a better way to do what i'm trying to do? Is there a way to
dynamically inject the current/start symbol instead of at grammar
build time?

(Like a python language, but where a dict isnt valid standalone, but
is valid in assignment or function calls, etc, but in a different mode
i need to parse just a standalone dict and not anything else).

Thanks.

-- 
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