Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Parse token+position with parser combinators
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Simon Schäfer  
View profile  
 More options Sep 12 2012, 6:17 pm
From: Simon Schäfer <m...@antoras.de>
Date: Thu, 13 Sep 2012 00:17:40 +0200
Local: Wed, Sep 12 2012 6:17 pm
Subject: Parse token+position with parser combinators
I want to know if it is possible to parse tokens + their position +
their length with Scalas parser combinators.

I tried to use JavaTokenParsers but they seem not be the best way to
achieve what I want. My current progress: https://gist.github.com/3709623

Main problems are the ugly notation of the tokens and wrong
determination of positions (I can't find out a way to get the length of
identifiers without adding count of whitespace).

StandardTokenParsers are better to parse tokens, I assume, but they
neither offer a simple way to return the position of a token.

Need I to build may own position based token parser? If yes, does
someone know some projects/examples which already tried to do the same?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Luke Vilnis  
View profile  
 More options Sep 12 2012, 6:59 pm
From: Luke Vilnis <lvil...@gmail.com>
Date: Wed, 12 Sep 2012 18:59:15 -0400
Local: Wed, Sep 12 2012 6:59 pm
Subject: Re: [scala-user] Parse token+position with parser combinators

Could you accomplish what you want by copying RegexParsers and modifying to
include the (start, end) info from the regex match groups?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Simon Schäfer  
View profile  
 More options Sep 12 2012, 8:18 pm
From: Simon Schäfer <m...@antoras.de>
Date: Thu, 13 Sep 2012 02:18:24 +0200
Local: Wed, Sep 12 2012 8:18 pm
Subject: Re: [scala-user] Parse token+position with parser combinators
Nice tip! I didn't think at that. I got it to work:
https://gist.github.com/3709623

Not quite perfect. Probably I need to copy the contents of
RegexParsers/JavaTokenParsers and edit them with my changes but when
that will be the only problem I come to, that's a good solution. Thanks!

On Thu 13 Sep 2012 12:59:15 AM CEST, Luke Vilnis wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »