How to parse formal comments?

View: New views
4 Messages — Rating Filter:   Alert me  

How to parse formal comments?

by Artur Rataj :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello!

How would you suggest to parse the code and formal comments in the same parser?

I have formal comments currently defined as special tokens, as in the
demo grammars for Java. Can the contents of the comments be obtained
there just before an instruction after the comment is parsed? Or is it
possible to put formal comments into the parser part and allow them to
occur anywhere, yet still being parsed?

Best regards,
Artur

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: How to parse formal comments?

by Artur Rataj :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ok, I have read the user guide, and there is a variable with contents
of special tokens. So another parser can be run on the contents or
something like that.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Re: How to parse formal comments?

by J.Chris Findlay :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Something like that would be easier than altering the grammar to allow
them wherever they could appear.  It's harder still if you are after
any kind of comments as they _can_ appear almost anywhere.

On 6/29/08, Artur Rataj <arturrataj@...> wrote:

> Ok, I have read the user guide, and there is a variable with contents
>  of special tokens. So another parser can be run on the contents or
>  something like that.
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: users-unsubscribe@...
>  For additional commands, e-mail: users-help@...
>
>


--
 - J.Chris Findlay
   (c:

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


RE: How to parse formal comments?

by Laughing Man :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
I'm going to guess here that what you're trying to do is related to your original message, and that you're trying to handle both comments and code. And you're attempting to do this in a unique way. Possibly because you don't know the standard way.

If that is the case, I recommend using Lexical States. I had a bit of trouble with them, but it turns out they're not really hard to use, and they're great stuff. Mess around with them a bit (with a different, simpler grammar) and send another message if you're having trouble with them.

If the problem is unrelated,

Either way it sounds like you're doing something interesting, but Lexical states would be an easier of handling comments.







Get news, entertainment and everything you care about at Live.com. Check it out!
LightInTheBox - Buy quality products at wholesale price