Parrot Parser: AST position information

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Parrot Parser: AST position information

Milles, Eric (TR Technology & Ops)

I just gave the Parrot Parser a quick try out for Groovy 2.6 / Eclipse 4.8.  One thing I'm noticing right away is that the parser sets the line and column information of AST nodes, but leaves position properties start, end, nameStart and nameEnd unset.  Is there a way to request these properties get set?  Or is there an available line,col -> offset function somewhere?

 

Eric Milles
Lead Software Engineer

Thomson Reuters

Email: [hidden email]

Phone: 651-848-7040

 

Reply | Threaded
Open this post in threaded view
|

Re: Parrot Parser: AST position information

Daniel Sun
Hi Eric,

   Parrot will set node position of `ASTNode`, i.e. `lineNumber`,
`columnNumber`, `lastLineNumber`, `lastColumnNumber`. As for `start`, `end`,
`nameStart` and `nameEnd`,  I can not find them in the Apache Groovy
project. Can you tell me which class contains them?

Cheers,
Daniel.Sun




--
Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html
Reply | Threaded
Open this post in threaded view
|

RE: Parrot Parser: AST position information

Milles, Eric (TR Technology & Ops)
Sorry, yes Eclipse adds those.  I wasn't aware the patching began at such a low level.  It would be nice to have the option of getting an offset instead of line,column.  But I can't see an easy path to that.

-----Original Message-----
From: Daniel Sun [mailto:[hidden email]]
Sent: Monday, March 12, 2018 6:51 PM
To: [hidden email]
Subject: Re: Parrot Parser: AST position information

Hi Eric,

   Parrot will set node position of `ASTNode`, i.e. `lineNumber`, `columnNumber`, `lastLineNumber`, `lastColumnNumber`. As for `start`, `end`, `nameStart` and `nameEnd`,  I can not find them in the Apache Groovy project. Can you tell me which class contains them?

Cheers,
Daniel.Sun=
Reply | Threaded
Open this post in threaded view
|

RE: Parrot Parser: AST position information

Daniel.Sun
It does not matter ;-)



--
Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html
Daniel Sun
Apache Groovy committer

Blog: http://blog.sunlan.me
Twitter: @daniel_sun