Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7638779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:15:23+00:00 2026-05-31T08:15:23+00:00

I’ve a fairly simple question about ParseKit and parsing timestamps… how do I go

  • 0

I’ve a fairly simple question about ParseKit and parsing timestamps… how do I go about forcing the symbolic-nature of a dot/period.

For example, if I am trying to parse 2008-01-25, I could use something like date = /\d{4}/ '-' /\d{2}/ '-' /\d{2}/. In fact, there is a date.grammar shipped with ParseKit that does exactly this (interestingly enough, though, the provided grammar doesn’t work in the DemoApp unless you add @symbolState='-';, but I digress…)

However, what do I do if I want to parse a date with dots in it… for example, 2008.01.25 or 2008-01-25-12.34.45. I’ve tried added '.' to the @symbolState directive but it just keeps getting ignored. Note that I am relying on the DemoApp to test my grammars at the moment… not sure if that makes any difference.

Any thoughts would be much appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T08:15:24+00:00Added an answer on May 31, 2026 at 8:15 am

    Developer of ParseKit here.

    First, thanks for the heads up on the bug in the date.grammar file. I have fixed it.


    As for your main question, I’m pretty sure what you are trying was not possible with ParseKit until now.

    That is, ParseKit’s tokenizer (PKTokenizer) was not able to produce only whole number Number tokens. Numbers were always tokenized as floating point which means it was impossible to parse input like 3.14 as three separate tokens 3 (Number) . (Symbol) 14 (Number). Rather it would always be tokenized as 3.14.

    Good news: I’ve added this capability with a new method:

    -[PKNumberState allowsFloatingPoint]
    

    which defaults to YES.

    And I added a matching Tokenizer Directive which you can use in your ParseKit Grammars like:

    @allowsFloatingPoint = NO;
    

    NOTE you’ll need to checkout the latest HEAD of trunk on Google Code to see this feature.

    So, here’s an example date grammar which does roughly what you were asking for with the new feature:

    @symbolState = '.';
    @allowsFloatingPoint = NO;
    
    @start  = date;
    
    date    = year dot month dot day;
    
    year    = /\d{4}/;
    month   = /\d{2}/;
    day     = /\d{2}/;
    
    dot    = '.';
    

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
Seemingly simple, but I cannot find anything relevant on the web. What is the
I am doing a simple coin flipping experiment for class that involves flipping a
i got an object with contents of html markup in it, for example: string
I'm parsing an XML file, the creators of it stuck in a bunch social
I'm making a simple page using Google Maps API 3. My first. One marker

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.