473,325 Members | 2,816 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

documenting PLYed parsers

Hi,

I am using PLY (Python-Lex-Yacc) to write my parsers. However, it seems
to me that PLY is using comments (especially multiline comments) in the
Yacc component such as

def p_expression(p):
'''expression : term PLUS term'''
....

So I was thinking about how can I document my codes, which can be
processed by epydoc or happydoc? Will my comments, enclosed by ''',
interferes with PLY?

Any comments?

Thanks
Maurice
Jul 18 '05 #1
2 1155
Maurice LING wrote:
Hi,

I am using PLY (Python-Lex-Yacc) to write my parsers. However, it seems
to me that PLY is using comments (especially multiline comments) in the
Yacc component such as

def p_expression(p):
'''expression : term PLUS term'''
...

So I was thinking about how can I document my codes, which can be
processed by epydoc or happydoc? Will my comments, enclosed by ''',
interferes with PLY?

Any comments?


How about trying it? I use spark, which utilizes comment strings, too - but
as it simply loops over the comment lines and tries to use them as grammar
rules without bailing out if a line isn't a grammar rule, I can happily put
comments in there.

And after all, you don't need to comment using the doc-string, you can use
#. And I personally believe that a parser doesn't need to be
api-documented on every grammar rule, so you don't lose anything here.
--
Regards,

Diez B. Roggisch
Jul 18 '05 #2
Maurice LING wrote:

So I was thinking about how can I document my codes, which can be
processed by epydoc or happydoc? Will my comments, enclosed by ''',
interferes with PLY?


You could also use pythondoc that uses
comments that are listed before a function
defintion (the java way).

http://effbot.org/downloads/#pythondoc

Istvan.
Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Will Stuyvesant | last post by:
There seems to be no XML parser that can do validation in the Python Standard Libraries. And I am stuck with Python 2.1.1. until my web master upgrades (I use Python for CGI). I know pyXML has...
0
by: Magnus Lie Hetland | last post by:
I'm working on a project where I have to create parsers on the fly, based on input to my program. I think Spark seems like a good candidate for the parser generation part, but it seems very geared...
5
by: Isaac Rodriguez | last post by:
Hi, Are there any standarized ways of documenting Python code? When I check the __doc__ attribute of the standard modules, the results are kind of plain. Is everyone using this style? Since...
2
by: Dale Strickland-Clark | last post by:
A few days ago there was a discussion about which XML parser to use with Python. However, the discussion didn't cover validating parsers, at least, not w3.org XML Schemas. I looked into all the...
1
by: strauss.sean | last post by:
I have been asked to begin documenting the ongoing development and changes to a database that I maintain. Not the entry of data; this is about the changes to how tables are restructured, and any...
8
by: Spleenwort | last post by:
With regard to XML comments in c#. I think that #regions should be self-documenting relative to XML comments or that a <region> tag should be defined and auto-inserted when you type #region...
2
by: dwelch91 | last post by:
Hi, c.l.p.'ers- I am having a problem with the import of xml.parsers.expat that has gotten me completely stumped. I have two programs, one a PyQt program and one a command line (text) program...
0
by: JosAH | last post by:
Greetings, welcome back at the sequel of the parsers article chapter. This part is dedicated to the ExpressionParser, the largest parser class for our little language. This class parses a...
0
by: JosAH | last post by:
Greetings, this week's article part discusses the parsers used for our little language. We will implement the parsers according to the grammar rules we defined in the second part of this...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.